Class AbstractContainerEditpart

java.lang.Object
org.eclipse.gef.editparts.AbstractEditPart
org.eclipse.gef.editparts.AbstractGraphicalEditPart
org.csstudio.opibuilder.editparts.AbstractBaseEditPart
org.csstudio.opibuilder.editparts.AbstractContainerEditpart
All Implemented Interfaces:
IAdaptable, org.eclipse.gef.EditPart, org.eclipse.gef.GraphicalEditPart, org.eclipse.gef.NodeEditPart, org.eclipse.gef.RequestConstants
Direct Known Subclasses:
AbstractScrollableEditpart, ArrayEditPart, DisplayEditpart, GroupingContainerEditPart, SashContainerEditPart, TabEditPart

public abstract class AbstractContainerEditpart extends AbstractBaseEditPart
The editpart for AbstractContainerModel
  • Constructor Details

    • AbstractContainerEditpart

      public AbstractContainerEditpart()
  • Method Details

    • createEditPolicies

      protected void createEditPolicies()
      Overrides:
      createEditPolicies in class AbstractBaseEditPart
    • getChild

      public AbstractBaseEditPart getChild(String name)
      Get a child of this container by name.
      Parameters:
      name - the name of the child widget
      Returns:
      the widgetController of the child. null if the child doesn't exist.
    • getWidget

      public org.eclipse.gef.EditPart getWidget(String name) throws Exception
      Get the widget which is a descendant of the container by name.
      Parameters:
      name - the name of the widget.
      Returns:
      the widget controller.
      Throws:
      Exception - If widget with this name doesn't exist
    • getAllRuntimePVNames

      public Set<String> getAllRuntimePVNames()
      Returns:
      all pv names attached to this container and its children at runtime.
    • addChild

      public void addChild(AbstractWidgetModel widgetModel)
      Add a child widget to the container.
    • addChildToRight

      public void addChildToRight(AbstractWidgetModel widgetModel)
      Add a child widget to the right of the container.
    • addChildToBottom

      public void addChildToBottom(AbstractWidgetModel widgetModel)
      Add a child widget to the bottom of the container.
    • removeChildByName

      public void removeChildByName(String widgetName)
      Remove a child widget by its name.
      Throws:
      RuntimeException - if the widget name does not exist.
    • removeChild

      public void removeChild(AbstractBaseEditPart child)
    • removeChild

      public void removeChild(int index)
    • removeAllChildren

      public void removeAllChildren()
    • setModel

      public void setModel(Object model)
      Specified by:
      setModel in interface org.eclipse.gef.EditPart
      Overrides:
      setModel in class org.eclipse.gef.editparts.AbstractEditPart
    • registerBasePropertyChangeHandlers

      protected void registerBasePropertyChangeHandlers()
      Overrides:
      registerBasePropertyChangeHandlers in class AbstractBaseEditPart
    • deactivate

      public void deactivate()
      Specified by:
      deactivate in interface org.eclipse.gef.EditPart
      Overrides:
      deactivate in class AbstractBaseEditPart
    • getModelChildren

      protected List<AbstractWidgetModel> getModelChildren()
      Overrides:
      getModelChildren in class org.eclipse.gef.editparts.AbstractEditPart
    • getWidgetModel

      public AbstractContainerModel getWidgetModel()
      Overrides:
      getWidgetModel in class AbstractBaseEditPart
    • getLayoutWidget

      public AbstractLayoutEditpart getLayoutWidget()
    • refreshChildren

      protected void refreshChildren()
      Overrides:
      refreshChildren in class org.eclipse.gef.editparts.AbstractEditPart
    • layout

      public void layout()
    • performAutosize

      public void performAutosize()
      Automatically set the container size according its children's geography size.
    • getValue

      public Object getValue()
      By default, it returns an Object Array of its children's value. If setValue(Object) was called with a non Object[] input value, it will return the value of its first child.
      Overrides:
      getValue in class AbstractBaseEditPart
      Returns:
      The value of the widget.
    • setValue

      public void setValue(Object value)
      If input value is instance of Object[] and its length is equal or larger than children size, it will write each element of value to each child according children's order. Otherwise, it will write the input value as an whole Object to every child.
      Overrides:
      setValue in class AbstractBaseEditPart
      Parameters:
      value - the value to be set. It must be the compatible type for the widget. For example, a boolean widget only accept boolean or number.
    • getAdapter

      public Object getAdapter(Class adapter)
      Specified by:
      getAdapter in interface IAdaptable
      Overrides:
      getAdapter in class AbstractBaseEditPart