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

    Constructors
    Constructor
    Description
    Creates a new action with the given text that monitors selection changes within the given selection provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    Notifies this action that the given (non-structured) selection has changed in the selection provider.
    void
    Notifies this action that the given structured selection has changed in the selection provider.
    final void
    The SelectionProviderAction implementation of this ISelectionChangedListener method calls selectionChanged(IStructuredSelection) if the selection is a structured selection but selectionChanged(ISelection) if it is not.
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DeferredSelectionProviderAction

      public DeferredSelectionProviderAction(String text)
      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, or null if there is no text
  • Method Details

    • setSelectionProvider

      public void setSelectionProvider(ISelectionProvider provider)
      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 be null
    • 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

      public ISelection getSelection()
      Returns the current selection in the selection provider.
      Returns:
      the current selection in the selection provider, or null if none
    • getSelectionProvider

      public ISelectionProvider 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

      public IStructuredSelection 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

      public void selectionChanged(ISelection selection)
      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 be null
    • selectionChanged

      public void selectionChanged(IStructuredSelection selection)
      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 be null
    • selectionChanged

      public final void selectionChanged(SelectionChangedEvent event)
      The SelectionProviderAction implementation of this ISelectionChangedListener method calls selectionChanged(IStructuredSelection) if the selection is a structured selection but selectionChanged(ISelection) if it is not.

      Subclasses should override either of those methods method to react to selection changes.

      Specified by:
      selectionChanged in interface ISelectionChangedListener