public class TGOpenWithMenu extends ContributionItem
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.
OpenWithMenu
Modifier and Type | Field and Description |
---|---|
static String |
ID
The id of this action.
|
Constructor and Description |
---|
TGOpenWithMenu(IWorkbenchPage page)
Constructs a new instance of
OpenWithMenu . |
TGOpenWithMenu(IWorkbenchPage page,
IAdaptable file)
Constructs a new instance of
OpenWithMenu . |
Modifier and Type | Method and Description |
---|---|
void |
fill(Menu menu,
int index) |
boolean |
isDynamic() |
dispose, fill, fill, fill, getId, getParent, isDirty, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
public static final String ID
public TGOpenWithMenu(IWorkbenchPage page)
OpenWithMenu
.
If this method is used be sure to set the selected file by invoking
setFile
. The file input is required when the user selects an
item in the menu. At that point the menu will attempt to open an editor
with the file as its input.
page
- the page where the editor is opened if an item within the menu
is selectedpublic TGOpenWithMenu(IWorkbenchPage page, IAdaptable file)
OpenWithMenu
.page
- the page where the editor is opened if an item within the menu
is selectedfile
- the selected filepublic void fill(Menu menu, int index)
fill
in interface IContributionItem
fill
in class ContributionItem
public boolean isDynamic()
isDynamic
in interface IContributionItem
isDynamic
in class ContributionItem