Package org.eclipse.ui.internal

# Class SwitchToWindowMenu

java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.ui.internal.SwitchToWindowMenu

All Implemented Interfaces:
  `IContributionItem`

public class SwitchToWindowMenu extends ContributionItem
A dynamic menu item to switch to other opened workbench windows.

## Constructor Summary

Constructors
Constructor
Description
`SwitchToWindowMenu(IWorkbenchWindow window, String id, boolean showSeparator)`
Creates a new instance of this class.

## Method Summary

Modifier and Type
Method
Description
`void`
`dispose()`
The default implementation of this `IContributionItem` method does nothing.
`void`
`fill(Menu menu, int index)`
Fills the given menu with menu items for all opened workbench windows.
`boolean`
`isDirty()`
Overridden to always return true and force dynamic menu building.
`boolean`
`isDynamic()`
Overridden to always return true and force dynamic menu building.

### Methods inherited from class org.eclipse.jface.action.ContributionItem

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

### Methods inherited from class java.lang.Object

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

## Constructor Details

### SwitchToWindowMenu

public SwitchToWindowMenu(IWorkbenchWindow window, String id, boolean showSeparator)
Creates a new instance of this class.

Parameters:
  `window` - the workbench window this action applies to
  `showSeparator` - whether to add a separator in the menu

## Method Details

### fill

public void fill(Menu menu, int index)
Fills the given menu with menu items for all opened workbench windows.

Specified by:
  `fill` in interface `IContributionItem`
Overrides:
  `fill` in class `ContributionItem`
Parameters:
  `menu` - the parent menu
  `index` - the index where the controls are inserted, or `-1` to insert at the end

### isDirty

public boolean isDirty()
Overridden to always return true and force dynamic menu building.

Specified by:
  `isDirty` in interface `IContributionItem`
Overrides:
  `isDirty` in class `ContributionItem`
Returns:
  `true` if this item is dirty

### isDynamic

public boolean isDynamic()
Overridden to always return true and force dynamic menu building.

Specified by:
  `isDynamic` in interface `IContributionItem`
Overrides:
  `isDynamic` in class `ContributionItem`
Returns:
  `true` if this item is dynamic, and `false` for normal items

### dispose

public void dispose()
Description copied from class: `ContributionItem`
The default implementation of this `IContributionItem` method does nothing. Subclasses may override.

Specified by:
  `dispose` in interface `IContributionItem`
Overrides:
  `dispose` in class `ContributionItem`