Class CoolBarToTrimManager

java.lang.Object
org.eclipse.jface.action.ContributionManager
org.eclipse.ui.internal.CoolBarToTrimManager
All Implemented Interfaces:
IContributionManager, ICoolBarManager, org.eclipse.jface.internal.provisional.action.ICoolBarManager2

public class CoolBarToTrimManager extends ContributionManager implements org.eclipse.jface.internal.provisional.action.ICoolBarManager2
Since:
3.5
  • Field Details

  • Constructor Details

  • Method Details

    • add

      public void add(IAction action)
      Description copied from interface: IContributionManager
      Adds an action as a contribution item to this manager. Equivalent to add(new ActionContributionItem(action)).
      Specified by:
      add in interface IContributionManager
      Overrides:
      add in class ContributionManager
      Parameters:
      action - the action, this cannot be null
    • add

      public void add(IContributionItem item)
      Description copied from interface: IContributionManager
      Adds a contribution item to this manager.
      Specified by:
      add in interface IContributionManager
      Overrides:
      add in class ContributionManager
      Parameters:
      item - the contribution item, this cannot be null
    • getToolbarLabel

      public static String getToolbarLabel(MApplication application, MUIElement elt)
    • add

      public void add(IToolBarManager toolBarManager)
      Description copied from interface: ICoolBarManager
      A convenience method to add a tool bar as a contribution item to this cool bar manager. Equivalent to add(new ToolBarContributionManager(toolBarManager)).
      Specified by:
      add in interface ICoolBarManager
      Parameters:
      toolBarManager - the tool bar manager to be added
      See Also:
    • appendToGroup

      public void appendToGroup(String groupName, IAction action)
      Description copied from interface: IContributionManager
      Adds a contribution item for the given action at the end of the group with the given name. Equivalent to appendToGroup(groupName,new ActionContributionItem(action)).
      Specified by:
      appendToGroup in interface IContributionManager
      Overrides:
      appendToGroup in class ContributionManager
      Parameters:
      groupName - the name of the group
      action - the action
    • appendToGroup

      public void appendToGroup(String groupName, IContributionItem item)
      Description copied from interface: IContributionManager
      Adds a contribution item to this manager at the end of the group with the given name.
      Specified by:
      appendToGroup in interface IContributionManager
      Overrides:
      appendToGroup in class ContributionManager
      Parameters:
      groupName - the name of the group
      item - the contribution item
    • createControl2

      public Control createControl2(Composite parent)
      Description copied from interface: org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Creates and returns this manager's control. Does not create a new control if one already exists.
      Specified by:
      createControl2 in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Parameters:
      parent - the parent control
      Returns:
      the control
    • dispose

      public void dispose()
      Description copied from interface: org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Disposes the resources for this manager.

      EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

      Specified by:
      dispose in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
    • find

      public IContributionItem find(String id)
      Description copied from interface: IContributionManager
      Finds the contribution item with the given id.
      Specified by:
      find in interface IContributionManager
      Overrides:
      find in class ContributionManager
      Parameters:
      id - the contribution item id
      Returns:
      the contribution item, or null if no item with the given id can be found
    • getContextMenuManager

      public IMenuManager getContextMenuManager()
      Description copied from interface: ICoolBarManager
      Returns the context menu manager used by this cool bar manager. This context menu manager is used by the cool bar manager except for cool items that provide their own.
      Specified by:
      getContextMenuManager in interface ICoolBarManager
      Returns:
      the context menu manager, or null if none
      See Also:
    • getControl2

      public Control getControl2()
      Description copied from interface: org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Returns the bar control for this manager.

      EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

      Specified by:
      getControl2 in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Returns:
      the bar control, or null if none
    • getItems

      public IContributionItem[] getItems()
      Description copied from interface: IContributionManager
      Returns all contribution items known to this manager.
      Specified by:
      getItems in interface IContributionManager
      Overrides:
      getItems in class ContributionManager
      Returns:
      a list of contribution items
    • getLockLayout

      public boolean getLockLayout()
      Description copied from interface: ICoolBarManager
      Returns whether the layout of the underlying cool bar widget is locked.
      Specified by:
      getLockLayout in interface ICoolBarManager
      Returns:
      true if cool bar layout is locked, false otherwise
    • getOverrides

      public IContributionManagerOverrides getOverrides()
      Description copied from class: ContributionManager
      The ContributionManager implementation of this method declared on IContributionManager returns the current overrides. If there is no overrides it lazily creates one which overrides no item state.
      Specified by:
      getOverrides in interface IContributionManager
      Overrides:
      getOverrides in class ContributionManager
      Returns:
      the overrides for the items of this manager
    • getStyle

      public int getStyle()
      Description copied from interface: ICoolBarManager
      Returns the style of the underlying cool bar widget.
      Specified by:
      getStyle in interface ICoolBarManager
      Returns:
      the style of the cool bar
    • insertAfter

      public void insertAfter(String id, IAction action)
      Description copied from interface: IContributionManager
      Inserts a contribution item for the given action after the item with the given id. Equivalent to insertAfter(id,new ActionContributionItem(action)).
      Specified by:
      insertAfter in interface IContributionManager
      Overrides:
      insertAfter in class ContributionManager
      Parameters:
      id - the contribution item id
      action - the action to insert
    • insertAfter

      public void insertAfter(String id, IContributionItem item)
      Description copied from interface: IContributionManager
      Inserts a contribution item after the item with the given id.
      Specified by:
      insertAfter in interface IContributionManager
      Overrides:
      insertAfter in class ContributionManager
      Parameters:
      id - the contribution item id
      item - the contribution item to insert
    • insertBefore

      public void insertBefore(String id, IAction action)
      Description copied from interface: IContributionManager
      Inserts a contribution item for the given action before the item with the given id. Equivalent to insertBefore(id,new ActionContributionItem(action)).
      Specified by:
      insertBefore in interface IContributionManager
      Overrides:
      insertBefore in class ContributionManager
      Parameters:
      id - the contribution item id
      action - the action to insert
    • insertBefore

      public void insertBefore(String id, IContributionItem item)
      Description copied from interface: IContributionManager
      Inserts a contribution item before the item with the given id.
      Specified by:
      insertBefore in interface IContributionManager
      Overrides:
      insertBefore in class ContributionManager
      Parameters:
      id - the contribution item id
      item - the contribution item to insert
    • isDirty

      public boolean isDirty()
      Description copied from interface: IContributionManager
      Returns whether the list of contributions has recently changed and has yet to be reflected in the corresponding widgets.
      Specified by:
      isDirty in interface IContributionManager
      Overrides:
      isDirty in class ContributionManager
      Returns:
      true if this manager is dirty, and false if it is up-to-date
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: IContributionManager
      Returns whether this manager has any contribution items.
      Specified by:
      isEmpty in interface IContributionManager
      Overrides:
      isEmpty in class ContributionManager
      Returns:
      true if there are no items, and false otherwise
    • markDirty

      public void markDirty()
      Description copied from interface: IContributionManager
      Marks this contribution manager as dirty.
      Specified by:
      markDirty in interface IContributionManager
      Overrides:
      markDirty in class ContributionManager
    • prependToGroup

      public void prependToGroup(String groupName, IAction action)
      Description copied from interface: IContributionManager
      Adds a contribution item for the given action at the beginning of the group with the given name. Equivalent to prependToGroup(groupName,new ActionContributionItem(action)).
      Specified by:
      prependToGroup in interface IContributionManager
      Overrides:
      prependToGroup in class ContributionManager
      Parameters:
      groupName - the name of the group
      action - the action
    • prependToGroup

      public void prependToGroup(String groupName, IContributionItem item)
      Description copied from interface: IContributionManager
      Adds a contribution item to this manager at the beginning of the group with the given name.
      Specified by:
      prependToGroup in interface IContributionManager
      Overrides:
      prependToGroup in class ContributionManager
      Parameters:
      groupName - the name of the group
      item - the contribution item
    • refresh

      public void refresh()
      Description copied from interface: org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Synchronizes the visual order of the cool items in the control with this manager's internal data structures. This method should be called before requesting the order of the contribution items to ensure that the order is accurate.

      Note that update() and refresh() are converses: update() changes the visual order to match the internal structures, and refresh changes the internal structures to match the visual order.

      EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

      Specified by:
      refresh in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
    • remove

      public IContributionItem remove(IContributionItem item)
      Description copied from interface: IContributionManager
      Removes the given contribution item from the contribution items known to this manager.
      Specified by:
      remove in interface IContributionManager
      Overrides:
      remove in class ContributionManager
      Parameters:
      item - the contribution item
      Returns:
      the item parameter if the item was removed, and null if it was not found
    • remove

      public IContributionItem remove(String id)
      Description copied from interface: IContributionManager
      Removes and returns the contribution item with the given id from this manager. Returns null if this manager has no contribution items with the given id.
      Specified by:
      remove in interface IContributionManager
      Overrides:
      remove in class ContributionManager
      Parameters:
      id - the contribution item id
      Returns:
      the item that was found and removed, or null if none
    • removeAll

      public void removeAll()
      Description copied from interface: IContributionManager
      Removes all contribution items from this manager.

      Note: The items will not get disposed.

      Specified by:
      removeAll in interface IContributionManager
      Overrides:
      removeAll in class ContributionManager
    • resetItemOrder

      public void resetItemOrder()
      Description copied from interface: org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Restores the canonical order of this cool bar manager. The canonical order is the order in which the contribution items where added.

      EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

      Specified by:
      resetItemOrder in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
    • setContextMenuManager

      public void setContextMenuManager(IMenuManager menuManager)
      Description copied from interface: ICoolBarManager
      Sets the context menu of this cool bar manager to the given menu manager.
      Specified by:
      setContextMenuManager in interface ICoolBarManager
      Parameters:
      menuManager - the context menu manager, or null if none
      See Also:
    • setItems

      public void setItems(IContributionItem[] newItems)
      Description copied from interface: org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Replaces the current items with the given items. Forces an update.

      EXPERIMENTAL. This class or interface has been added as part of a work in progress. There is a guarantee neither that this API will work nor that it will remain the same. Please do not use this API without consulting with the Platform/UI team.

      Specified by:
      setItems in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Parameters:
      newItems - the items with which to replace the current items
    • setLockLayout

      public void setLockLayout(boolean value)
      Description copied from interface: ICoolBarManager
      Locks or unlocks the layout of the underlying cool bar widget. Once the cool bar is locked, cool items cannot be repositioned by the user.

      Note that items can be added or removed programmatically even while the cool bar is locked.

      Specified by:
      setLockLayout in interface ICoolBarManager
      Parameters:
      value - true to lock the cool bar, false to unlock
    • setOverrides

      public void setOverrides(IContributionManagerOverrides newOverrides)
      Description copied from class: ContributionManager
      Sets the overrides for this contribution manager
      Specified by:
      setOverrides in interface org.eclipse.jface.internal.provisional.action.ICoolBarManager2
      Overrides:
      setOverrides in class ContributionManager
      Parameters:
      newOverrides - the overrides for the items of this manager
    • update

      public void update(boolean force)
      Description copied from interface: IContributionManager
      Updates this manager's underlying widget(s) with any changes which have been made to it or its items. Normally changes to a contribution manager merely mark it as dirty, without updating the underlying widgets. This brings the underlying widgets up to date with any changes.
      Specified by:
      update in interface IContributionManager
      Parameters:
      force - true means update even if not dirty, and false for normal incremental updating
    • getTopTrim

      public MTrimBar getTopTrim()