| org.eclipse.ui.internal.PluginAction
All known Subclasses: org.eclipse.ui.internal.ObjectPluginAction, org.eclipse.ui.internal.WWinPluginAction, org.eclipse.ui.internal.PartPluginAction,
PluginAction | abstract public class PluginAction extends Action implements ISelectionListener,ISelectionChangedListener,INullSelectionListener,IPluginContribution(Code) | | A PluginAction is a proxy for an action extension.
At startup we read the registry and create a PluginAction for each action extension.
This plugin action looks like the real action ( label, icon, etc ) and acts as
a proxy for the action until invoked. At that point the proxy will instantiate
the real action and delegate the run method to the real action.
This makes it possible to load the action extension lazily.
Occasionally the class will ask if it is OK to
load the delegate (on selection changes). If the plugin containing
the action extension has been loaded then the action extension itself
will be instantiated.
|
Constructor Summary | |
public | PluginAction(IConfigurationElement actionElement, String id, int style) PluginAction constructor. |
PluginAction | public PluginAction(IConfigurationElement actionElement, String id, int style)(Code) | | PluginAction constructor.
Parameters: actionElement - the element Parameters: id - the identifier Parameters: style - the style bits |
createDelegate | final protected void createDelegate()(Code) | | Creates the delegate and refreshes its enablement.
|
dispose | public void dispose()(Code) | | Disposes this plugin action.
since: 3.1 |
disposeDelegate | public void disposeDelegate()(Code) | | Disposes the delegate, if created.
since: 3.1 |
getConfigElement | protected IConfigurationElement getConfigElement()(Code) | | the IConfigurationElement used to create this PluginAction. since: 3.0 |
getDelegate | protected IActionDelegate getDelegate()(Code) | | Returns the action delegate if created. Can be null
if the delegate is not created yet or if previous delegate
creation failed.
|
getOverrideActionId | public String getOverrideActionId()(Code) | | Returns the action identifier this action overrides.
Default implementation returns null .
the action identifier to override or null |
getSelection | public ISelection getSelection()(Code) | | For testing purposes only.
the selection since: 3.1 |
initDelegate | protected void initDelegate()(Code) | | Initialize the action delegate by calling its lifecycle method.
Subclasses may override but must call this implementation first.
|
isOkToCreateDelegate | protected boolean isOkToCreateDelegate()(Code) | | Returns true if the declaring plugin has been loaded
and there is no need to delay creating the delegate
any more.
|
refreshEnablement | protected void refreshEnablement()(Code) | | Refresh the action enablement.
|
runWithEvent | public void runWithEvent(Event event)(Code) | | |
selectionChanged | public void selectionChanged(ISelection newSelection)(Code) | | Handles selection change. If rule-based enabled is
defined, it will be first to call it. If the delegate
is loaded, it will also be given a chance.
Parameters: newSelection - the new selection |
selectionChanged | public void selectionChanged(SelectionChangedEvent event)(Code) | | The SelectionChangedEventAction implementation of this
ISelectionChangedListener method calls
selectionChanged(IStructuredSelection) when the selection is
a structured one.
|
selectionChanged | public void selectionChanged(IWorkbenchPart part, ISelection sel)(Code) | | The SelectionChangedEventAction implementation of this
ISelectionListener method calls
selectionChanged(IStructuredSelection) when the selection is
a structured one. Subclasses may extend this method to react to the change.
|
validateDelegate | protected IActionDelegate validateDelegate(Object obj) throws WorkbenchException(Code) | | Validates the object is a delegate of the expected type. Subclasses can
override to check for specific delegate types.
Note: Calls to the object are not allowed during this method.
Parameters: obj - a possible action delegate implementation the IActionDelegate implementation for the object throws: WorkbenchException - if not of the expected delegate type |
|
|