Package org.eclipse.handly.ui.action
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.ActionShows a history list in a drop-down.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHistoryDropDownAction.History<E>Represents the underlying history for theHistoryDropDownAction.
-
Constructor Summary
Constructors Constructor Description HistoryDropDownAction(HistoryDropDownAction.History<E> history)Constructs aHistoryDropDownActionon the given history.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMenuEntries(org.eclipse.jface.action.IMenuManager manager)Allows subclasses to place additional menu entries to the history drop-down.protected voidconfigureHistoryListAction(org.eclipse.jface.action.IAction action)Configures the history list action.protected org.eclipse.jface.action.IActiongetClearHistoryAction()Returns a 'clear history' action.protected java.lang.StringgetHistoryListDialogMessage()Returns the message for the history list dialog.protected java.lang.StringgetHistoryListDialogTitle()Returns the title for the history list dialog.protected intgetMaxEntriesInDropDown()Returns the maximum number of entries in the history drop-down.protected org.eclipse.swt.widgets.ShellgetShell()Returns the shell to use as the parent shell of the history list dialog.voidrun()-
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
-
-
-
-
Constructor Detail
-
HistoryDropDownAction
public HistoryDropDownAction(HistoryDropDownAction.History<E> history)
Constructs aHistoryDropDownActionon the given history.- Parameters:
history- notnull
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfaceorg.eclipse.jface.action.IAction- Overrides:
runin classorg.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- nevernull
-
getHistoryListDialogTitle
protected java.lang.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 java.lang.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 callsHistoryDropDownAction.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- nevernull
-
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)
-
-