Class AbstractUiPlugIn
java.lang.Object
com.vividsolutions.jump.workbench.plugin.AbstractPlugIn
org.openjump.core.ui.plugin.AbstractUiPlugIn
- All Implemented Interfaces:
EnableChecked, Iconified, PlugIn, Recordable, ShortcutEnabled, ActionListener, EventListener
- Direct Known Subclasses:
AbstractThreadedUiPlugIn, AddImageLayerPlugIn, AutoAssignAttributePlugIn, CreateGridPlugIn, FileDragDropPlugin, GenerateRandomNumberPlugIn, GenerateRandomStringPlugIn, GenerateUniqueRandomIdPlugIn, MosaicInternalFramesPlugIn, OpenRecentPlugIn, SynchronizationPlugIn
Default implementation of PlugIn, with useful functions for auto-generating a
name, converting a PlugIn into an ActionListener (for use with JButtons, for
example), and supporting undo.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected EnableCheckprotected WorkbenchContextThe workbench context.Fields inherited from class AbstractPlugIn
shortcutKeys, shortcutModifiers -
Constructor Summary
ConstructorsConstructorDescriptionAbstractUiPlugIn(String name) AbstractUiPlugIn(String name, String toolTip) AbstractUiPlugIn(String name, Icon icon) AbstractUiPlugIn(String name, Icon icon, String toolTip) AbstractUiPlugIn(Icon icon) -
Method Summary
Modifier and TypeMethodDescriptionvoidWrap the plug-in as an ActionListener.booleanexecute(PlugInContext context) Method to be overridden by implementations to execute the plug-in.Use reflection to find an EnableCheck object defined by old method createEnableCheck in this plugin.getIcon()Get the icon for the plug-in.getName()Get the name of the plug-in.Get the tool-tip for the plug-in.voidinitialize(PlugInContext context) Method to be overridden by implementations to initialize the plug-in.protected booleanisRollingBackInvalidEdits(PlugInContext context) protected voidreportNothingToUndoYet(PlugInContext context) Indicates that this plug-in either (1) is undoable but hasn't modified the system yet or (2) does not modify the system.protected voidsetWorkbenchContext(WorkbenchContext workbenchContext) Methods inherited from class AbstractPlugIn
addParameter, createName, execute, execute, getBooleanParam, getContext, getDoubleParam, getIcon, getIcon, getIntegerParam, getParameter, getParameters, getShortcutKeys, getShortcutKeyStroke, getShortcutModifiers, getStringParam, getWorkbenchContext, isShortcutEnabled, setParameters, setShortcutKeys, setShortcutModifiers, toActionListener, toString
-
Field Details
-
workbenchContext
The workbench context. -
enableCheck
-
-
Constructor Details
-
AbstractUiPlugIn
public AbstractUiPlugIn() -
AbstractUiPlugIn
-
AbstractUiPlugIn
-
AbstractUiPlugIn
-
AbstractUiPlugIn
-
AbstractUiPlugIn
-
-
Method Details
-
initialize
Method to be overridden by implementations to initialize the plug-in. Plug-ins must invoke super.initialize().- Specified by:
initializein interfacePlugIn- Overrides:
initializein classAbstractPlugIn- Parameters:
context- The plug-in context.- Throws:
Exception- if an exception occur during initialization
-
execute
Method to be overridden by implementations to execute the plug-in.- Specified by:
executein interfacePlugIn- Overrides:
executein classAbstractPlugIn- Parameters:
context- The plug-in context.- Returns:
- true if the PlugIn has been executed
- Throws:
Exception- if an Exception occurs during execution- See Also:
-
reportNothingToUndoYet
Indicates that this plug-in either (1) is undoable but hasn't modified the system yet or (2) does not modify the system. In either case, the undo history will be preserved. If this method is not called, then this plug-in will be assumed to be non-undoable, and the undo history will be truncated.- Overrides:
reportNothingToUndoYetin classAbstractPlugIn- Parameters:
context- plugin context
-
isRollingBackInvalidEdits
- Overrides:
isRollingBackInvalidEditsin classAbstractPlugIn
-
actionPerformed
Wrap the plug-in as an ActionListener.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
e- The action event.
-
getEnableCheck
Description copied from class:AbstractPlugInUse reflection to find an EnableCheck object defined by old method createEnableCheck in this plugin.- Specified by:
getEnableCheckin interfaceEnableChecked- Overrides:
getEnableCheckin classAbstractPlugIn- Returns:
- the EnableCheck defined the old way
-
getIcon
Get the icon for the plug-in.- Specified by:
getIconin interfaceIconified- Overrides:
getIconin classAbstractPlugIn- Returns:
- The icon.
-
getName
Get the name of the plug-in. If a name was not specified ask super class.- Specified by:
getNamein interfacePlugIn- Overrides:
getNamein classAbstractPlugIn- Returns:
- The plug-in name.
-
getToolTip
-
setWorkbenchContext
- Parameters:
workbenchContext- the workbenchContext to set
-