kawigi.cmd
Class SnippetContext

java.lang.Object
  extended by kawigi.cmd.SnippetContext

public class SnippetContext
extends java.lang.Object

A set of global values to store the state of snippets. Instead of having all static fields, perhaps there should be an instance of this as an object associated with each CodePane, since snippet actions require one as a context anyways. However, there isn't any particular advantage to that, especially since the use of all these fields by default is modal.


Constructor Summary
SnippetContext()
           
 
Method Summary
static java.lang.String getCategory()
          Returns the current category from the snippet dialog.
static java.lang.String getInsertCode()
          Returns the code that should be inserted by actInsertSnippet.
static java.lang.String getSnippetName()
          Returns the current snippet name from the snippet dialog.
static void setCategory(java.lang.String s)
          Sets the category from the snippet dialog.
static void setInsertCode(java.lang.String s)
          Sets the code that should be inserted by actInsertSnippet.
static void setSnippetName(java.lang.String s)
          Sets the snippet name from the snippet dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnippetContext

public SnippetContext()
Method Detail

getCategory

public static java.lang.String getCategory()
Returns the current category from the snippet dialog.


getSnippetName

public static java.lang.String getSnippetName()
Returns the current snippet name from the snippet dialog.


setCategory

public static void setCategory(java.lang.String s)
Sets the category from the snippet dialog. Perhaps "Updates" would be a better verb, since this is usually set when the user types in the text box.


setSnippetName

public static void setSnippetName(java.lang.String s)
Sets the snippet name from the snippet dialog. This generally called when the user types into the text box, or when KawigiEdit guesses the name of the snippet before the dialog is shown.


getInsertCode

public static java.lang.String getInsertCode()
Returns the code that should be inserted by actInsertSnippet.


setInsertCode

public static void setInsertCode(java.lang.String s)
Sets the code that should be inserted by actInsertSnippet. This is set whenever you use a snippet.