public abstract static class IlvDiagrammerAction.ToggleAction extends IlvDiagrammerAction
perform(java.awt.event.ActionEvent, ilog.views.diagrammer.IlvDiagrammer)
method that toggles the "selected" state of the
action and calls the abstract
isSelected(IlvDiagrammer)
and
setSelected(IlvDiagrammer,boolean)
methods.
To write your own toggle action, you just need to implement the
isSelected(IlvDiagrammer)
and
setSelected(IlvDiagrammer,boolean)
methods.
IlvDiagrammerAction.ErrorHandler, IlvDiagrammerAction.FileAction, IlvDiagrammerAction.Handler, IlvDiagrammerAction.StatusEvent, IlvDiagrammerAction.StatusListener, IlvDiagrammerAction.ToggleAction
_new, about, ABOUT_APPLICATION_NAME, alignBottom, alignHorizontalCenter, alignLeft, alignRight, alignTop, alignVerticalCenter, autoEditLabel, autoLabelLayout, autoLinkLayout, autoNodeLayout, callBuilder, clearPrintArea, close, copy, createLink, createNode, cut, delete, distributeHorizontally, distributeVertically, duplicate, editing, editLabel, exit, fitToContents, grid, gridSpacing, group, help, layoutAllNodes, layoutSelectedNodes, open, openStyleSheet, pageSetup, pan, paste, printPreview, printToBitmap, printWithDialog, printWithoutDialog, read, redo, refresh, resetZoom, resizing, save, saveAs, select, selectAll, setPrintArea, stickyModes, undo, ungroup, zoom, zoomIn, zoomOut
hideToolbarButtonBordersOnOceanTheme
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
ToggleAction(String prefix)
Creates a new toggle action.
|
ToggleAction(String prefix,
ResourceBundle bundle)
Creates a new toggle action.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isSelectable()
Returns
true . |
protected abstract boolean |
isSelected(IlvDiagrammer diagrammer)
This method is called to determine if this action is currently selected.
|
void |
perform(ActionEvent e,
IlvDiagrammer diagrammer)
Toggles the "selected" state of the
action and calls the abstract
isSelected(IlvDiagrammer) and
setSelected(IlvDiagrammer,boolean)
methods. |
protected abstract void |
setSelected(IlvDiagrammer diagrammer,
boolean selected)
This method is called when the selected state of the action changes.
|
addActionToUpdate, addStatusListener, call, chooseFile, getActionFileChooser, getDefaultResourceBundle, getDefaultSelectedFile, getErrorHandler, getFileChooserDirectory, getString, isEnabled, isEnabled, isSelected, perform, removeActionToUpdate, removeStatusListener, setDefaultSelectedFile, setErrorHandler, setFileChooserDirectory, setHandler, update, update, updateActions
actionPerformed, addActionToUpdate, addPropertyChangeListener, addStatusListener, call, clone, createMenuItem, createToolBarButton, delayedUpdateActions, error, fireActionFinished, fireActionStarted, getActionErrorHandler, getPrefix, getResourceBundle, getSmallIconSize, init, isSelected, removeActions, removeActionToUpdate, removeStatusListener, setActionErrorHandler, setHandler, setSelected, setSmallIconSize, updateActions
firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public ToggleAction(String prefix)
prefix
- The localization prefix key.public ToggleAction(String prefix, ResourceBundle bundle)
prefix
- The localization prefix key.bundle
- The resource bundle from which to get the properties of the action.public boolean isSelectable()
true
.isSelectable
in class ilog.views.util.swing.context.ComponentAction
public void perform(ActionEvent e, IlvDiagrammer diagrammer) throws Exception
isSelected(IlvDiagrammer)
and
setSelected(IlvDiagrammer,boolean)
methods.perform
in class IlvDiagrammerAction
e
- The action event that caused this action to be performed.diagrammer
- The IlvDiagrammer
on which the action is to be performed
(may be null if there is no current diagram component).Exception
- When an error occurs while performing the action.protected abstract boolean isSelected(IlvDiagrammer diagrammer) throws Exception
isSelected
in class IlvDiagrammerAction
diagrammer
- The IlvDiagrammer
instance on which the action is to be performed
(may be null if there is no current diagram component).Exception
- When an error occurs while getting the state of the action.protected abstract void setSelected(IlvDiagrammer diagrammer, boolean selected) throws Exception
diagrammer
- The IlvDiagrammer
isntance on which the action is performed
(may be null if there is no current diagram component).selected
- The new selected state.Exception
- When an error occurs while getting the state of the action.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.