Class DeferredSelectionProviderAction
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
com._1c.g5.v8.dt.internal.platform.services.ui.DeferredSelectionProviderAction
- All Implemented Interfaces:
org.eclipse.jface.action.IAction
,ISelectionChangedListener
- Direct Known Subclasses:
AbstractInfobaseCommandAction
,AbstractPublishAction
,AddInfobaseAction
,CopyPublicationAction
,DeleteInfobaseAction
,DeleteWebServerOrPublicationAction
,DeployConfigurationAction
,ImportConfigurationAction
,ImportExtensionsAction
,LaunchDesignerAction
,PastePublicationAction
,RefreshInfobasesAction
,RefreshWebServersAction
,RenameEObjectAction
,RestartWebServerAction
,ShowAssociatedInfobaseAction
public class DeferredSelectionProviderAction
extends org.eclipse.jface.action.Action
implements ISelectionChangedListener
SelectionProviderAction
alternative with ability to deferral set ISelectionProvider
.
This allows to create action with Guice Provider
and then set selection provider manually.
Method setSelectionProvider(ISelectionProvider)
must be invoked after action instantiation.
- See Also:
-
SelectionProviderAction
-
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_TEXT
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new action with the given text that monitors selection changes within the given selection provider. -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes this action by removing it as a listener from the selection provider.Returns the current selection in the selection provider.Returns the selection provider that is the target of this action.Returns the current structured selection in the selection provider, or an empty selection if nothing is selected or if selection does not include objects (for example, raw text).void
selectionChanged
(ISelection selection) Notifies this action that the given (non-structured) selection has changed in the selection provider.void
selectionChanged
(IStructuredSelection selection) Notifies this action that the given structured selection has changed in the selection provider.final void
TheSelectionProviderAction
implementation of thisISelectionChangedListener
method callsselectionChanged(IStructuredSelection)
if the selection is a structured selection butselectionChanged(ISelection)
if it is not.void
setSelectionProvider
(ISelectionProvider provider) Set selection provider for this action.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, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Constructor Details
-
DeferredSelectionProviderAction
Creates a new action with the given text that monitors selection changes within the given selection provider.Method
setSelectionProvider(ISelectionProvider)
must be invoked after action instantiation.- Parameters:
text
- the string used as the text for the action, ornull
if there is no text
-
-
Method Details
-
setSelectionProvider
Set selection provider for this action. The action will be added as a listener on the selection provider.- Parameters:
provider
- the selection provider that will provide selection notification, cannot benull
-
dispose
public void dispose()Disposes this action by removing it as a listener from the selection provider. This must be called by the creator of the action when the action is no longer needed. -
getSelection
Returns the current selection in the selection provider.- Returns:
- the current selection in the selection provider, or
null
if none
-
getSelectionProvider
Returns the selection provider that is the target of this action.- Returns:
- the target selection provider of this action, or
null
if none
-
getStructuredSelection
Returns the current structured selection in the selection provider, or an empty selection if nothing is selected or if selection does not include objects (for example, raw text).- Returns:
- the current structured selection in the selection provider, never
null
-
selectionChanged
Notifies this action that the given (non-structured) selection has changed in the selection provider.The
SelectionProviderAction
implementation of this method does nothing. Subclasses may reimplement to react to this selection change.- Parameters:
selection
- the new selection, cannot benull
-
selectionChanged
Notifies this action that the given structured selection has changed in the selection provider.The
SelectionProviderAction
implementation of this method does nothing. Subclasses may reimplement to react to this selection change.- Parameters:
selection
- the new selection, cannot benull
-
selectionChanged
TheSelectionProviderAction
implementation of thisISelectionChangedListener
method callsselectionChanged(IStructuredSelection)
if the selection is a structured selection butselectionChanged(ISelection)
if it is not.Subclasses should override either of those methods method to react to selection changes.
- Specified by:
selectionChanged
in interfaceISelectionChangedListener
-