public class DefaultMenuWrangler extends Object implements MenuWrangler
Modifier and Type | Class and Description |
---|---|
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 . |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
DefaultMenuWrangler(Console console) |
Modifier and Type | Method and Description |
---|---|
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.
|
private static final org.slf4j.Logger logger
private final DefaultMenuWrangler.CutTextAction cutAction
private final DefaultMenuWrangler.CopyTextAction copyAction
private final DefaultMenuWrangler.PasteTextAction pasteAction
private final DefaultMenuWrangler.ClearBufferAction clearAction
private final DefaultMenuWrangler.SelectBufferAction selectAction
public DefaultMenuWrangler(Console console)
public JPopupMenu buildMenu()
buildMenu
in interface MenuWrangler
public void stateChanged()
stateChanged
in interface MenuWrangler
private JMenu makeLocalsMenu()
JMenu
that
allows for (limited) introspection.JMenu
containing the local namespace.