# Class OpenPerspectiveMenu

java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.ui.actions.PerspectiveMenu
org.eclipse.ui.actions.OpenPerspectiveMenu

All Implemented Interfaces:
  `IContributionItem`

@Deprecated public class OpenPerspectiveMenu extends PerspectiveMenu
Deprecated.
See IWorkbench.showPerspective methods.
A menu for window creation in the workbench.

An `OpenPerspectiveMenu` is used to populate a menu with actions that will open a new perspective. If the user selects one of these items either a new page is added to the workbench, a new workbench window is created with the chosen perspective or the current perspective will be replaced with the new onw.

The visible perspectives within the menu may also be updated dynamically to reflect user preference.

The input for the page is determined by the value of `pageInput`. The input should be passed into the constructor of this class or set using the `setPageInput` method.

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 inherited from class PerspectiveMenu

`SHOW_PERSP_ID`

## Constructor Summary

Constructors
Constructor
Description
`OpenPerspectiveMenu(IMenuManager menuManager, IWorkbenchWindow window)`
Deprecated.
`OpenPerspectiveMenu(IWorkbenchWindow window)`
Deprecated.
`OpenPerspectiveMenu(IWorkbenchWindow window, IAdaptable input)`
Deprecated.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`run(IPerspectiveDescriptor desc)`
Deprecated.
`protected void`
`run(IPerspectiveDescriptor desc, SelectionEvent event)`
Deprecated.
`void`
`setPageInput(IAdaptable input)`
Deprecated.
`void`
`setReplaceEnabled(boolean isEnabled)`
Deprecated.

### Methods inherited from class PerspectiveMenu

`dispose, fill, getPerspectiveItems, getShowActive, getWindow, isDirty, isDynamic, showActive`

### Methods inherited from class ContributionItem

`fill, fill, fill, getId, getParent, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### OpenPerspectiveMenu

@Deprecated public OpenPerspectiveMenu(IMenuManager menuManager, IWorkbenchWindow window)
Deprecated.
Constructs a new menu.

Parameters:
  `menuManager` - the menu manager
  `window` - the window where a new page is created if an item within the menu is selected

### OpenPerspectiveMenu

@Deprecated public OpenPerspectiveMenu(IWorkbenchWindow window)
Deprecated.
Constructs a new instance of `OpenNewPageMenu`.

If this method is used be sure to set the page input by invoking `setPageInput`. The page input is required when the user selects an item in the menu. At that point the menu will attempt to open a new page with the selected perspective and page input. If there is no page input an error dialog will be opened.

Parameters:
  `window` - the window where a new page is created if an item within the menu is selected

### OpenPerspectiveMenu

@Deprecated public OpenPerspectiveMenu(IWorkbenchWindow window, IAdaptable input)
Deprecated.
Constructs a new instance of `OpenNewPageMenu`.

Parameters:
  `window` - the window where a new page is created if an item within the menu is selected
  `input` - the page input

## Method Details

### run

@Deprecated protected void run(IPerspectiveDescriptor desc)
Deprecated.
Runs an action for a particular perspective. Opens the perspective supplied in a new window or a new page depending on the workbench preference.

Specified by:
  `run` in class `PerspectiveMenu`
Parameters:
  `desc` - the selected perspective

### run

@Deprecated protected void run(IPerspectiveDescriptor desc, SelectionEvent event)
Deprecated.
Runs an action for a particular perspective.

Overrides:
  `run` in class `PerspectiveMenu`
Parameters:
  `desc` - the selected perspective
  `event` - the event sent along with the selection callback

### setPageInput

@Deprecated public void setPageInput(IAdaptable input)
Deprecated.
Sets the page input.

Parameters:
  `input` - the page input

### setReplaceEnabled

@Deprecated public void setReplaceEnabled(boolean isEnabled)
Deprecated.

Parameters:
  `isEnabled` - true if replace menu item is enabled within its parent menu.