|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jface.action.ContributionItem org.eclipse.ui.actions.PerspectiveMenu
A menu for perspective selection.
A PerspectiveMenu is used to populate a menu with perspective shortcut items. If the user selects one of these items an action is performed for the selected perspective.
The visible perspective items within the menu are dynamic and reflect the available set generated by each subclass. The default available set consists of the perspective shortcut list of the current perspective.
This class is abstract. Subclasses must implement the run method, which performs a specialized action for the selected perspective.
Constructor Summary | |
PerspectiveMenu(IWorkbenchWindow window,
String id)
Constructs a new instance of PerspectiveMenu. |
Method Summary | |
void | fill(Menu menu,
int index)
The default implementation of this IContributionItem method does nothing. |
protected ArrayList | getPerspectiveItems()
Returns the available list of perspectives to display in the menu. |
protected boolean | getShowActive()
Returns whether the menu item representing the active perspective will have a check mark. |
protected IWorkbenchWindow | getWindow()
Returns the window for this menu. |
boolean | isDirty()
The default implementation of this IContributionItem method returns false. |
boolean | isDynamic()
The default implementation of this IContributionItem method returns false. |
protected abstract void | run(IPerspectiveDescriptor desc)
Runs an action for a particular perspective. |
protected void | run(IPerspectiveDescriptor desc,
SelectionEvent event)
Runs an action for a particular perspective. |
protected void | showActive(boolean b)
Sets the showActive flag. |
Methods inherited from class org.eclipse.jface.action.ContributionItem |
dispose, fill, fill, fill, getId, getParent, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setParent, setVisible, toString, update, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PerspectiveMenu(IWorkbenchWindow window, String id)
Method Detail |
public void fill(Menu menu, int index)
protected ArrayList getPerspectiveItems()
By default, the list contains the perspective shortcuts for the current perspective.
Subclasses can override this method to return a different list.
protected boolean getShowActive()
protected IWorkbenchWindow getWindow()
public boolean isDirty()
public boolean isDynamic()
protected abstract void run(IPerspectiveDescriptor desc)
protected void run(IPerspectiveDescriptor desc, SelectionEvent event)
protected void showActive(boolean b)
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.