Package com.iizigo.jface
Class PartAction
- All Implemented Interfaces:
IAction
- Direct Known Subclasses:
CollapseAllAction,CreateVSFieldAction,ExpandAllAction
A part action is an action that is registered globally for the part in the action bars, but is retargeted for a group of controls. When a control inside a parent gets focus, that action is enabled.
This also serves as a replacement for Action if no parent composites are registered.
- Author:
- Christopher Mindus
Field Summary
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXTConstructor Summary
ConstructorsConstructorDescriptionPartAction(String text) Creates the part action.PartAction(String text, int style) Creates the part action.PartAction(String text, String tooltip, ImageDescriptor image) Creates the part action.PartAction(String text, String tooltip, ImageDescriptor image, int style) Creates the part action.PartAction(String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage) Creates the part action.PartAction(String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage, int style) Creates the part action.PartAction(String text, ImageDescriptor image) Creates the part action.PartAction(String text, ImageDescriptor image, int style) Creates the part action.PartAction(IWorkbenchPart part, String id) Creates the part action.PartAction(IWorkbenchPart extension, String id, String text, String tooltip, ImageDescriptor image) Creates the part action.PartAction(IWorkbenchPart part, String id, String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage) Creates the part action.PartAction(IWorkbenchPart part, String id, String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage, int style) Creates the part action.Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new parent composite and its childrenvoiddispose()Disposes of the instance.voidrefreshChildren(Composite parent) Refreshes the children for a parent.voidRemoves a parent composite from the action list.voidrun()The default implementation of thisIActionmethod does nothing.final voidrunWithEvent(Event event) This method cannot be overridden, use therun()method instead.voidsetMenuItemTooltips(boolean on) Sets the flag indicating tooltip should be used for menu items as well.booleanReturns the flag indicating tooltip should be used for menu items as well.Assigns a run method to execute instead of overriding the "run" method.Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipTextMethods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListenerMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
Constructor Details
PartAction
Creates the part action.PartAction
Creates the part action.PartAction
Creates the part action.PartAction
Creates the part action.PartAction
Creates the part action.PartAction
Creates the part action.PartAction
Creates the part action.PartAction
public PartAction(String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage) Creates the part action.PartAction
public PartAction(String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage, int style) Creates the part action.PartAction
public PartAction(IWorkbenchPart extension, String id, String text, String tooltip, ImageDescriptor image) Creates the part action.PartAction
public PartAction(IWorkbenchPart part, String id, String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage) Creates the part action.PartAction
public PartAction(IWorkbenchPart part, String id, String text, String tooltip, ImageDescriptor image, ImageDescriptor disabledImage, int style) Creates the part action.
Method Details
with
Assigns a run method to execute instead of overriding the "run" method.- Parameters:
r- This actions newrun()implementation, null to remove it.- Returns:
- "this" instance for method concatenation.
setMenuItemTooltips
public void setMenuItemTooltips(boolean on) Sets the flag indicating tooltip should be used for menu items as well. This call must be made prior to the action contributor creating the menu item.- Parameters:
on- The flag.
useMenuItemTooltips
public boolean useMenuItemTooltips()Returns the flag indicating tooltip should be used for menu items as well.- Returns:
- Default false, unless changed using {#setMenuItemTooltips(boolean)}.
add
Adds a new parent composite and its childrenrefreshChildren
Refreshes the children for a parent.remove
Removes a parent composite from the action list.dispose
public void dispose()Disposes of the instance.runWithEvent
This method cannot be overridden, use therun()method instead.- Specified by:
runWithEventin interfaceIAction- Overrides:
runWithEventin classAction- Parameters:
event- The SWT event which triggered this action being run.
run
public void run()The default implementation of thisIActionmethod does nothing. Subclasses should override this method if they do not need information from the triggering event, or overriderunWithEvent(Event)if they do.