Interface DockingActionIf
-
- All Superinterfaces:
HelpDescriptor
- All Known Subinterfaces:
ToggleDockingActionIf
- All Known Implementing Classes:
ghidra.app.plugin.core.functioncompare.AbstractApplyFunctionSignatureAction,AbstractFindReferencesDataTypeAction,AbstractSelectionNavigationAction,AbstractSharedKeybindingAction,AddAllFieldAction,AddFieldAction,AddSpacerFieldAction,ApplyFunctionSignatureAction,ApplyFunctionSignatureAction,ClearCutAction,DeleteTableRowAction,DisableFieldAction,DockingAction,DockingActionProxy,DomainFileProviderContextAction,DummyKeyBindingsOptionsAction,EnableFieldAction,FindCheckoutsAction,FSBAction,HelpAction,HorizontalRuleAction,InsertRowAction,KeyBindingAction,ListingContextAction,MultiActionDockingAction,MultiStateDockingAction,NavigatableContextAction,NextRangeAction,NonToolbarMultiStateAction,PreviousRangeAction,ProgramContextAction,ProgramLocationContextAction,ProgramSymbolContextAction,ProjectDataCollapseAction,ProjectDataContextAction,ProjectDataContextToggleAction,ProjectDataCopyAction,ProjectDataCopyCutBaseAction,ProjectDataCutAction,ProjectDataDeleteAction,ProjectDataExpandAction,ProjectDataNewFolderAction,ProjectDataOpenDefaultToolAction,ProjectDataOpenToolAction,ProjectDataPasteAction,ProjectDataReadOnlyAction,ProjectDataRefreshAction,ProjectDataRenameAction,ProjectDataSelectAction,ProjectDataTreeContextAction,RemoveAllFieldsAction,RemoveFieldAction,RemoveRowAction,ResetAllFormatsAction,ResetFormatAction,ResetTranslationAction,SaveImageAction,SelectionNavigationAction,SetSpacerTextAction,ShowAllComponentsAction,ShowFocusCycleAction,ShowFocusInfoAction,ToggleDockingAction,VersionControlAction,VersionControlAddAction,VersionControlCheckInAction,VersionControlCheckOutAction,VersionControlDataTypeArchiveUndoCheckoutAction,VersionControlShowHistoryAction,VersionControlUndoCheckOutAction,VersionControlUndoHijackAction,VersionControlUpdateAction,VersionControlViewCheckOutAction,ViewInstructionDetailsAction,ZoomInAction,ZoomOutAction,ZoomResetAction
public interface DockingActionIf extends HelpDescriptor
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDESCRIPTION_PROPERTYstatic java.lang.StringENABLEMENT_PROPERTYstatic java.lang.StringGLOBALCONTEXT_PROPERTYstatic java.lang.StringKEYBINDING_DATA_PROPERTYstatic java.lang.StringMENUBAR_DATA_PROPERTYstatic java.lang.StringPOPUP_MENU_DATA_PROPERTYstatic java.lang.StringTOOLBAR_DATA_PROPERTY
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidactionPerformed(ActionContext context)method to actually perform the action logic for this action.voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds a listener to be notified if any property changes.javax.swing.JButtoncreateButton()Returns a JButton that is suitable for this action.javax.swing.JMenuItemcreateMenuItem(boolean isPopup)Returns a JMenuItem that is suitable for this action.KeyBindingDatagetDefaultKeyBindingData()Returns the defaultKeyBindingDatato be used to assign this action to a key binding.java.lang.StringgetDescription()Returns a short description of this action.java.lang.StringgetFullName()Returns the full name (the action name combined with the owner name)java.lang.StringgetInceptionInformation()Returns a string that includes source file and line number information of where this action was created.javax.swing.KeyStrokegetKeyBinding()Convenience method for getting the keybinding for this action.KeyBindingDatagetKeyBindingData()Returns theKeyBindingDatato be used to assign this action to a key binding.MenuDatagetMenuBarData()Returns theMenuDatato be used to put this action in the menu bar.java.lang.StringgetName()Returns the name of the action.java.lang.StringgetOwner()Returns the owner of this action.MenuDatagetPopupMenuData()Returns theMenuDatato be used to put this action in a popup menu.ToolBarDatagetToolBarData()Returns theToolBarDatato be used to put this action in a toolbar.booleanisAddToPopup(ActionContext context)method is used to determine if this action should be displayed on the current popup.booleanisEnabled()Returns true if the action is enabled.booleanisEnabledForContext(ActionContext context)Method used to determine if this action should be enabled for the given context.booleanisKeyBindingManaged()Returns true if this action can have its keybinding information changed by the user.booleanisValidContext(ActionContext context)Method that actions implement to indicate if this action is valid (knows how to work with, is appropriate for) for the given context.booleanisValidGlobalContext(ActionContext globalContext)Method that actions implement to indicate if this action is valid (knows how to work with, is appropriate for) for the given global context.voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes a listener to be notified of property changes.booleansetEnabled(boolean newValue)Enables or disables the action.voidsetKeyBindingData(KeyBindingData keyBindingData)Sets theKeyBindingDataon an action to either assign a keybinding or remove it (keyBindingData = null).voidsetUnvalidatedKeyBindingData(KeyBindingData newKeyBindingData)Users creating actions should not call this method, but should instead callsetKeyBindingData(KeyBindingData).booleanshouldAddToWindow(boolean isMainWindow, java.util.Set<java.lang.Class<?>> contextTypes)Determines whether this action should be added to a window (either the main window or a secondary detached window).-
Methods inherited from interface docking.help.HelpDescriptor
getHelpInfo, getHelpObject
-
-
-
-
Field Detail
-
ENABLEMENT_PROPERTY
static final java.lang.String ENABLEMENT_PROPERTY
- See Also:
- Constant Field Values
-
GLOBALCONTEXT_PROPERTY
static final java.lang.String GLOBALCONTEXT_PROPERTY
- See Also:
- Constant Field Values
-
DESCRIPTION_PROPERTY
static final java.lang.String DESCRIPTION_PROPERTY
- See Also:
- Constant Field Values
-
KEYBINDING_DATA_PROPERTY
static final java.lang.String KEYBINDING_DATA_PROPERTY
- See Also:
- Constant Field Values
-
MENUBAR_DATA_PROPERTY
static final java.lang.String MENUBAR_DATA_PROPERTY
- See Also:
- Constant Field Values
-
POPUP_MENU_DATA_PROPERTY
static final java.lang.String POPUP_MENU_DATA_PROPERTY
- See Also:
- Constant Field Values
-
TOOLBAR_DATA_PROPERTY
static final java.lang.String TOOLBAR_DATA_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of the action.
-
getOwner
java.lang.String getOwner()
Returns the owner of this action.
-
getDescription
java.lang.String getDescription()
Returns a short description of this action. Generally used for a tooltip.
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified if any property changes.- Parameters:
listener- The property change listener that will be notified of property change events.- See Also:
AbstractAction.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener to be notified of property changes.- Parameters:
listener- The property change listener that will be notified of property change events.- See Also:
addPropertyChangeListener(PropertyChangeListener),AbstractAction.addPropertyChangeListener(java.beans.PropertyChangeListener)
-
setEnabled
boolean setEnabled(boolean newValue)
Enables or disables the action.- Parameters:
newValue- true to enable the action, false to disable it
-
isEnabled
boolean isEnabled()
Returns true if the action is enabled.- Returns:
- true if the action is enabled, false otherwise
-
getMenuBarData
MenuData getMenuBarData()
Returns theMenuDatato be used to put this action in the menu bar. The MenuData will be null if the action in not set to be in the menu bar.- Returns:
- the
MenuDatafor the menu bar or null if the action is not in the menu bar.
-
getPopupMenuData
MenuData getPopupMenuData()
Returns theMenuDatato be used to put this action in a popup menu. The MenuData will be null if the action in not set to be in a popup menu.- Returns:
- the
MenuDatafor a popup menu or null if the action is not to be in a popup menu.
-
getToolBarData
ToolBarData getToolBarData()
Returns theToolBarDatato be used to put this action in a toolbar. The ToolBarData will be null if the action in not set to be in a tool bar.- Returns:
- the
ToolBarDatafor the popup menu or null if the action is not in a popup menu.
-
getKeyBindingData
KeyBindingData getKeyBindingData()
Returns theKeyBindingDatato be used to assign this action to a key binding. The KeyBindingData will be null if the action is not set to have a keyBinding.- Returns:
- the
KeyBindingDatafor the action or null if the action does not have a keyBinding.
-
getDefaultKeyBindingData
KeyBindingData getDefaultKeyBindingData()
Returns the defaultKeyBindingDatato be used to assign this action to a key binding. The KeyBindingData will be null if the action is not set to have a keyBinding.- Returns:
- the
KeyBindingDatafor the action or null if the action does not have a keyBinding.
-
getKeyBinding
javax.swing.KeyStroke getKeyBinding()
Convenience method for getting the keybinding for this action.- Returns:
- the
KeyStroketo be used as a keybinding for this action or null if there is no
-
getFullName
java.lang.String getFullName()
Returns the full name (the action name combined with the owner name)
-
actionPerformed
void actionPerformed(ActionContext context)
method to actually perform the action logic for this action.- Parameters:
context- theActionContextobject that provides information about where and how this action was invoked.
-
isAddToPopup
boolean isAddToPopup(ActionContext context)
method is used to determine if this action should be displayed on the current popup. This method will only be called if the action has popupPopupMenuDataset.Generally, actions don't need to override this method as the default implementation will defer to the
#isEnabledForContext(), which will have the effect of adding the action to the popup only if it is enabled for a given context. By overriding this method, you can change this behavior so that the action will be added to the popup, even if it is disabled for the context, by having this method return true even if the#isEnabledForContext()method will return false, resulting in the action appearing in the popup menu, but begin disabled.- Parameters:
context- theActionContextfrom the active provider.- Returns:
- true if this action is appropriate for the given context.
-
isValidContext
boolean isValidContext(ActionContext context)
Method that actions implement to indicate if this action is valid (knows how to work with, is appropriate for) for the given context. This method is used to determine if the action should be enabled based on the either the local context or the global context. The action is first asked if it is valid for the local context and if not, then it is asked if it is valid for the global context. If a context is valid, then it will then be asked if it is enabled for that context.- Parameters:
context- theActionContextfrom the active provider.- Returns:
- true if this action is appropriate for the given context.
-
isValidGlobalContext
boolean isValidGlobalContext(ActionContext globalContext)
Method that actions implement to indicate if this action is valid (knows how to work with, is appropriate for) for the given global context. This method is just like the isValidContext and in fact calls that method by default. Many actions will work with either the active provider context or the global (the main listing) context if the local context is not valid. If you want a global action to only work on the global context, then override this method and return false.- Parameters:
context- the globalActionContextfrom the active provider.- Returns:
- true if this action is appropriate for the given context.
-
isEnabledForContext
boolean isEnabledForContext(ActionContext context)
Method used to determine if this action should be enabled for the given context.This is the method implementors override to control when the action may be used.
This method will be called by the DockingWindowManager for actions on the global menuBar and toolBar and for actions that have a keyBinding.
This method will be called whenever one of the following events occur:
- when the user invokes the action via its keyBinding,
- the user changes focus from one component provider to another,
- the user moves a component to another position in the window or into another window,
- a component provider reports a change in it's context,
- any plugin or software component reports a general change in context (calls the tool.contextChanged(ComponentProvider) with a null parameter).
- Parameters:
context- the currentActionContextfor the window.- Returns:
- true if the action should be enabled for the context or false otherwise.
-
getInceptionInformation
java.lang.String getInceptionInformation()
Returns a string that includes source file and line number information of where this action was created.
-
createButton
javax.swing.JButton createButton()
Returns a JButton that is suitable for this action. For example, It creates a ToggleButton if the action is aToggleDockingActionIf.- Returns:
- a JButton to be used in a toolbar or null if the action does not have ToolBarData set.
-
createMenuItem
javax.swing.JMenuItem createMenuItem(boolean isPopup)
Returns a JMenuItem that is suitable for this action. For example, if the action is aToggleDockingActionIf, then a JCheckBoxMenuItem will be created.- Parameters:
isPopup- true if the action should use its Popup MenuData, else it uses the MenuBar MenuData.- Returns:
- a JMenuItem for placement in either the menu bar or a popup menu.
-
shouldAddToWindow
boolean shouldAddToWindow(boolean isMainWindow, java.util.Set<java.lang.Class<?>> contextTypes)Determines whether this action should be added to a window (either the main window or a secondary detached window). By default, this method will return true for the main window and false otherwise. Actions that want to also appear in other windows should override this method to return true when appropriate for the context types- Parameters:
isMainWindow- true if the window in question is the main window. Otherwise, the window is a secondary window.contextTypes- a list of contextTypes (Classes) based on the providers that are currently in the window.- Returns:
- true if this action should be added to the window, false otherwise.
-
isKeyBindingManaged
boolean isKeyBindingManaged()
Returns true if this action can have its keybinding information changed by the user.- Returns:
- true if this action can have its keybinding information changed by the user.
-
setKeyBindingData
void setKeyBindingData(KeyBindingData keyBindingData)
Sets theKeyBindingDataon an action to either assign a keybinding or remove it (keyBindingData = null).- Parameters:
keyBindingData- if non-null, assigns a keybinding to the action. Otherwise, removes any keybinding from the action.
-
setUnvalidatedKeyBindingData
void setUnvalidatedKeyBindingData(KeyBindingData newKeyBindingData)
Users creating actions should not call this method, but should instead callsetKeyBindingData(KeyBindingData).Call this method when you wish to bypass the validation of
setKeyBindingData(KeyBindingData)so that keybindings are set exactly as they are given.- Parameters:
newKeyBindingData- the KeyBindingData to be used to assign this action to a keybinding.validate- true signals that this method should convert keybindings to their OS-dependent form (for example, on Mac a Ctrl key is changed to the Command key).
-
-