Class HistoryDropDownAction<E>

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.handly.ui.action.HistoryDropDownAction<E>
Type Parameters:
E - the type of elements managed by the history
All Implemented Interfaces:
org.eclipse.jface.action.IAction

public class HistoryDropDownAction<E> extends org.eclipse.jface.action.Action
Shows a history list in a drop-down.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Represents the underlying history for the HistoryDropDownAction.
  • 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
    Constructs a HistoryDropDownAction on the given history.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addMenuEntries(org.eclipse.jface.action.IMenuManager manager)
    Allows subclasses to place additional menu entries to the history drop-down.
    protected void
    configureHistoryListAction(org.eclipse.jface.action.IAction action)
    Configures the history list action.
    protected org.eclipse.jface.action.IAction
    Returns a 'clear history' action.
    protected String
    Returns the message for the history list dialog.
    protected String
    Returns the title for the history list dialog.
    protected int
    Returns the maximum number of entries in the history drop-down.
    protected org.eclipse.swt.widgets.Shell
    Returns the shell to use as the parent shell of the history list dialog.
    void
    run()
     

    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, 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

    • HistoryDropDownAction

      public HistoryDropDownAction(HistoryDropDownAction.History<E> history)
      Constructs a HistoryDropDownAction on the given history.
      Parameters:
      history - not null
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface org.eclipse.jface.action.IAction
      Overrides:
      run in class org.eclipse.jface.action.Action
    • configureHistoryListAction

      protected void configureHistoryListAction(org.eclipse.jface.action.IAction action)
      Configures the history list action. Default implementation does nothing. Subclasses may override (e.g., to set a more specific text or an image for the action).
      Parameters:
      action - never null
    • getHistoryListDialogTitle

      protected String getHistoryListDialogTitle()
      Returns the title for the history list dialog. Default implementation returns a generic title.
      Returns:
      the title for the history list dialog (not null)
    • getHistoryListDialogMessage

      protected String getHistoryListDialogMessage()
      Returns the message for the history list dialog. Default implementation returns a generic message which prompts the user to select the element to open.
      Returns:
      the message for the history list dialog (not null)
    • getClearHistoryAction

      protected org.eclipse.jface.action.IAction getClearHistoryAction()
      Returns a 'clear history' action. Default implementation returns a generic action, which calls HistoryDropDownAction.History.setHistoryEntries(List) with an empty list.
      Returns:
      the 'clear history' action (may be null, in which case no 'clear history' action will be contributed to the history drop-down)
    • addMenuEntries

      protected void addMenuEntries(org.eclipse.jface.action.IMenuManager manager)
      Allows subclasses to place additional menu entries to the history drop-down. Default implementation does nothing.
      Parameters:
      manager - never null
    • getMaxEntriesInDropDown

      protected int getMaxEntriesInDropDown()
      Returns the maximum number of entries in the history drop-down.
      Returns:
      the maximum number of entries in the history drop-down
    • getShell

      protected org.eclipse.swt.widgets.Shell getShell()
      Returns the shell to use as the parent shell of the history list dialog. Default implementation returns the currently active shell.
      Returns:
      the shell (may be null)