Class AbstractTrimWidget

  • All Implemented Interfaces:
    IWidget
    Direct Known Subclasses:
    AbstractWorkbenchTrimWidget

    public abstract class AbstractTrimWidget
    extends Object
    implements IWidget
    This extension to the IWidget interface allows clients adding elements to the trim to receive notifications if the User moves the widget to another trim area.

    This class is intended to be the base for any trim contributions.

    Since:
    3.2
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void dispose()
      Disposes of the underlying widgets.
      void fill​(Composite parent)
      Fills the given composite control with controls representing this widget.
      abstract void fill​(Composite parent, int oldSide, int newSide)
      This method is called to initially construct the widget and is also called whenever the widget's composite has been moved to a trim area on a different side of the workbench.
      void fill​(CoolBar parent, int index)
      Fills the given cool bar with controls representing this contribution item.
      void fill​(Menu parent, int index)
      Fills the given menu with controls representing this widget.
      void fill​(ToolBar parent, int index)
      Fills the given tool bar with controls representing this contribution item.
    • Constructor Detail

      • AbstractTrimWidget

        public AbstractTrimWidget()
    • Method Detail

      • fill

        public abstract void fill​(Composite parent,
                                  int oldSide,
                                  int newSide)
        This method is called to initially construct the widget and is also called whenever the widget's composite has been moved to a trim area on a different side of the workbench. It is the client's responsibility to control the life-cycle of the Control it manages.

        For example: If the implementation is constructing a ToolBar and the orientation were to change from horizontal to vertical it would have to dispose its old ToolBar and create a new one with the correct orientation.

        The sides can be one of:

        Parameters:
        parent - The parent to (re)create the widget under
        oldSide - The previous side (SWT.DEFAULT on the initial fill)
        newSide - The current side
      • dispose

        public abstract void dispose()
        Description copied from interface: IWidget
        Disposes of the underlying widgets. This can be called when the widget is becoming hidden.
        Specified by:
        dispose in interface IWidget
      • fill

        public void fill​(Composite parent)
        Description copied from interface: IWidget
        Fills the given composite control with controls representing this widget.
        Specified by:
        fill in interface IWidget
        Parameters:
        parent - the parent control
      • fill

        public void fill​(Menu parent,
                         int index)
        Description copied from interface: IWidget
        Fills the given menu with controls representing this widget.
        Specified by:
        fill in interface IWidget
        Parameters:
        parent - the parent menu
        index - the index where the controls are inserted, or -1 to insert at the end
      • fill

        public void fill​(ToolBar parent,
                         int index)
        Description copied from interface: IWidget
        Fills the given tool bar with controls representing this contribution item.
        Specified by:
        fill in interface IWidget
        Parameters:
        parent - the parent tool bar
        index - the index where the controls are inserted, or -1 to insert at the end
      • fill

        public void fill​(CoolBar parent,
                         int index)
        Description copied from interface: IWidget
        Fills the given cool bar with controls representing this contribution item.
        Specified by:
        fill in interface IWidget
        Parameters:
        parent - the parent cool bar
        index - the index where the controls are inserted, or -1 to insert at the end