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 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