Package org.eclipse.ui.actions
Class OpenWithMenu
java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.ui.actions.OpenWithMenu
- All Implemented Interfaces:
IContributionItem
A menu for opening files in the workbench.
An OpenWithMenu is used to populate a menu with
"Open With" actions. One action is added for each editor which is applicable
to the selected file. If the user selects one of these items, the corresponding
editor is opened on the file.
This class may be instantiated; it is not intended to be subclassed.
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenWithMenu(IWorkbenchPage page) Deprecated.As there is no way to set the file with this constructor use a different constructor.OpenWithMenu(IWorkbenchPage page, IAdaptable file) Constructs a new instance ofOpenWithMenu. -
Method Summary
Modifier and TypeMethodDescriptionvoidThe default implementation of thisIContributionItemmethod does nothing.booleanThe default implementation of thisIContributionItemmethod returnsfalse.protected voidopenEditor(IEditorDescriptor editorDescriptor, boolean openUsingDescriptor) Opens the given editor on the selected file.Methods inherited from class org.eclipse.jface.action.ContributionItem
dispose, fill, fill, fill, getId, getParent, isDirty, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
-
Field Details
-
ID
The id of this action.- See Also:
-
-
Constructor Details
-
OpenWithMenu
Deprecated.As there is no way to set the file with this constructor use a different constructor.Constructs a new instance ofOpenWithMenu.- Parameters:
page- the page where the editor is opened if an item within the menu is selected
-
OpenWithMenu
Constructs a new instance ofOpenWithMenu.- Parameters:
page- the page where the editor is opened if an item within the menu is selectedfile- the selected file
-
-
Method Details
-
fill
Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod does nothing. Subclasses may override.- Specified by:
fillin interfaceIContributionItem- Overrides:
fillin classContributionItem- Parameters:
menu- the parent menuindex- the index where the controls are inserted, or-1to insert at the end
-
isDynamic
public boolean isDynamic()Description copied from class:ContributionItemThe default implementation of thisIContributionItemmethod returnsfalse. Subclasses may override.- Specified by:
isDynamicin interfaceIContributionItem- Overrides:
isDynamicin classContributionItem- Returns:
trueif this item is dynamic, andfalsefor normal items
-
openEditor
Opens the given editor on the selected file.- Parameters:
editorDescriptor- the editor descriptor, or null for the system editoropenUsingDescriptor- use the descriptor's editor ID for opening if false (normal case), or use the descriptor itself if true (needed to fix bug 178235).- Since:
- 3.5
-