edu.wisc.ssec.mcidasv.jython
Class DefaultMenuWrangler

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.jython.DefaultMenuWrangler
All Implemented Interfaces:
MenuWrangler

public class DefaultMenuWrangler
extends Object
implements MenuWrangler


Nested Class Summary
private static class DefaultMenuWrangler.ClearBufferAction
          Clears out the console's JTextPane, though a fresh jython prompt is shown afterwards.
private static class DefaultMenuWrangler.CopyTextAction
          Basic "copy" operation.
private static class DefaultMenuWrangler.CutTextAction
          Allows the user to trigger a "cut" operation.
private static class DefaultMenuWrangler.MenuAction
          Generalized representation of a "context popup menu".
private static class DefaultMenuWrangler.PasteTextAction
          Allows the user to (attempt) to paste the contents of the system clipboard.
private static class DefaultMenuWrangler.SelectBufferAction
          Selects everything contained in the console's JTextPane.
 
Field Summary
private  DefaultMenuWrangler.ClearBufferAction clearAction
          Allows the user to clear out the buffer via the menu.
private  Console console
          The Console whose menus we're "wrangling".
private  DefaultMenuWrangler.CopyTextAction copyAction
          Handles "copy" requests that originate from the menu.
private  DefaultMenuWrangler.CutTextAction cutAction
          Handles "cut" requests that originate from the menu.
private static org.slf4j.Logger logger
           
private  DefaultMenuWrangler.PasteTextAction pasteAction
          Handles "paste" requests that originate from the menu.
private  DefaultMenuWrangler.SelectBufferAction selectAction
          Allows the user to select the buffer's contents.
 
Constructor Summary
DefaultMenuWrangler(Console console)
           
 
Method Summary
 JPopupMenu buildMenu()
           
private  JMenu makeLocalsMenu()
          Returns the contents of Jython's local namespace as a JMenu that allows for (limited) introspection.
 void stateChanged()
          Don't need to handle this just yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.slf4j.Logger logger

console

private final Console console
The Console whose menus we're "wrangling".


cutAction

private final DefaultMenuWrangler.CutTextAction cutAction
Handles "cut" requests that originate from the menu.


copyAction

private final DefaultMenuWrangler.CopyTextAction copyAction
Handles "copy" requests that originate from the menu.


pasteAction

private final DefaultMenuWrangler.PasteTextAction pasteAction
Handles "paste" requests that originate from the menu.


clearAction

private final DefaultMenuWrangler.ClearBufferAction clearAction
Allows the user to clear out the buffer via the menu.


selectAction

private final DefaultMenuWrangler.SelectBufferAction selectAction
Allows the user to select the buffer's contents.

Constructor Detail

DefaultMenuWrangler

public DefaultMenuWrangler(Console console)
Method Detail

buildMenu

public JPopupMenu buildMenu()
Specified by:
buildMenu in interface MenuWrangler

stateChanged

public void stateChanged()
Don't need to handle this just yet.

Specified by:
stateChanged in interface MenuWrangler

makeLocalsMenu

private JMenu makeLocalsMenu()
Returns the contents of Jython's local namespace as a JMenu that allows for (limited) introspection.

Returns:
JMenu containing the local namespace.