Class ReopenEditorMenu

java.lang.Object
org.eclipse.jface.action.ContributionItem
org.eclipse.ui.internal.ReopenEditorMenu
All Implemented Interfaces:
IContributionItem

public class ReopenEditorMenu extends ContributionItem
A dynamic menu item which supports to switch to other Windows.
  • Constructor Details

    • ReopenEditorMenu

      public ReopenEditorMenu(IWorkbenchWindow window, String id, boolean showSeparator)
      Create a new instance.
      Parameters:
      window - the window on which the menu is to be created
      id - menu's id
      showSeparator - whether or not to show a separator
  • Method Details

    • calcText

      public static String calcText(int index, String name, String toolTip, boolean rtl)
      Return a string suitable for a file MRU list. This should not be called outside the framework.
      Parameters:
      index - the index in the MRU list
      name - the file name
      toolTip - potentially the path
      rtl - should it be right-to-left
      Returns:
      a string suitable for an MRU file menu
    • fill

      public void fill(Menu menu, int index)
      Fills the given menu with menu items for all 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
    • 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