Class PartZoomComboContributionItem

java.lang.Object
org.eclipse.jface.action.ContributionItem
org.csstudio.opibuilder.visualparts.PartZoomComboContributionItem
All Implemented Interfaces:
org.eclipse.draw2d.zoom.ZoomListener, org.eclipse.gef.editparts.ZoomListener, IContributionItem

public class PartZoomComboContributionItem extends ContributionItem implements org.eclipse.gef.editparts.ZoomListener
Tweak ZoomComboContributionItem to dedicate to a part. A ControlContribution that uses a Combo as its control
  • Constructor Details

    • PartZoomComboContributionItem

      public PartZoomComboContributionItem(IPartService partService)
      Constructor for ComboToolItem.
      Parameters:
      partService - used to add a PartListener
    • PartZoomComboContributionItem

      public PartZoomComboContributionItem(IPartService partService, String initString)
      Constructor for ComboToolItem.
      Parameters:
      partService - used to add a PartListener
      initString - the initial string displayed in the combo
    • PartZoomComboContributionItem

      public PartZoomComboContributionItem(IPartService partService, String[] initStrings)
      Constructor for ComboToolItem.
      Parameters:
      partService - used to add a PartListener
      initStrings - the initial string displayed in the combo
  • Method Details

    • computeWidth

      protected int computeWidth(Control control)
      Computes the width required by control
      Parameters:
      control - The control to compute width
      Returns:
      int The width required
    • createControl

      protected Control createControl(Composite parent)
      Creates and returns the control for this contribution item under the given parent composite.
      Parameters:
      parent - the parent composite
      Returns:
      the new control
    • dispose

      public void dispose()
      Specified by:
      dispose in interface IContributionItem
      Overrides:
      dispose in class ContributionItem
    • fill

      public void fill(Composite parent)
      The control item implementation of this IContributionItem method calls the createControl framework method. Subclasses must implement createControl rather than overriding this method.
      Specified by:
      fill in interface IContributionItem
      Overrides:
      fill in class ContributionItem
    • fill

      public void fill(Menu parent, int index)
      The control item implementation of this IContributionItem method throws an exception since controls cannot be added to menus.
      Specified by:
      fill in interface IContributionItem
      Overrides:
      fill in class ContributionItem
    • fill

      public void fill(ToolBar parent, int index)
      The control item implementation of this IContributionItem method calls the createControl framework method to create a control under the given parent, and then creates a new tool item to hold it. Subclasses must implement createControl rather than overriding this method.
      Specified by:
      fill in interface IContributionItem
      Overrides:
      fill in class ContributionItem
    • getZoomManager

      public org.eclipse.gef.editparts.ZoomManager getZoomManager()
    • setZoomManager

      public void setZoomManager(org.eclipse.gef.editparts.ZoomManager zm)
    • zoomChanged

      public void zoomChanged(double zoom)
      Specified by:
      zoomChanged in interface org.eclipse.draw2d.zoom.ZoomListener
    • setPart

      public void setPart(IWorkbenchPart part)
      Parameters:
      part - a part which must have a ZoomManager Adapter.