Package org.eclipse.ui.internal
Class ReopenEditorMenu
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.ui.internal.ReopenEditorMenu
- All Implemented Interfaces:
IContributionItem
A dynamic menu item which supports to switch to other Windows.
-
Constructor Summary
ConstructorDescriptionReopenEditorMenu
(IWorkbenchWindow window, String id, boolean showSeparator) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Return a string suitable for a file MRU list.void
dispose()
The default implementation of thisIContributionItem
method does nothing.void
Fills the given menu with menu items for all windows.boolean
Overridden to always return true and force dynamic menu building.Methods inherited from class org.eclipse.jface.action.ContributionItem
fill, fill, fill, getId, getParent, isDirty, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
-
Constructor Details
-
ReopenEditorMenu
Create a new instance.- Parameters:
window
- the window on which the menu is to be createdid
- menu's idshowSeparator
- whether or not to show a separator
-
-
Method Details
-
calcText
Return a string suitable for a file MRU list. This should not be called outside the framework.- Parameters:
index
- the index in the MRU listname
- the file nametoolTip
- potentially the pathrtl
- should it be right-to-left- Returns:
- a string suitable for an MRU file menu
-
fill
Fills the given menu with menu items for all windows.- Specified by:
fill
in interfaceIContributionItem
- Overrides:
fill
in classContributionItem
- Parameters:
menu
- the parent menuindex
- the index where the controls are inserted, or-1
to insert at the end
-
isDynamic
public boolean isDynamic()Overridden to always return true and force dynamic menu building.- Specified by:
isDynamic
in interfaceIContributionItem
- Overrides:
isDynamic
in classContributionItem
- Returns:
true
if this item is dynamic, andfalse
for normal items
-
dispose
public void dispose()Description copied from class:ContributionItem
The default implementation of thisIContributionItem
method does nothing. Subclasses may override.- Specified by:
dispose
in interfaceIContributionItem
- Overrides:
dispose
in classContributionItem
-