Class PaletteContainer

java.lang.Object
org.eclipse.gef.palette.PaletteEntry
org.eclipse.gef.palette.PaletteContainer
Direct Known Subclasses:
PaletteDrawer, PaletteGroup, PaletteRoot, PaletteStack, PaletteToolbar

public class PaletteContainer extends PaletteEntry
Default implementation of PaletteContainer
  • Field Details

    • PROPERTY_CHILDREN

      public static final String PROPERTY_CHILDREN
      Property name indicating that this PaletteContainer's children have changed
      See Also:
    • children

      protected List children
      This container's contents
  • Constructor Details

    • PaletteContainer

      protected PaletteContainer(String label, String desc, ImageDescriptor icon, Object type)
      Constructor

      Any parameter can be null.

      Parameters:
      label - The container's name
      desc - The container's description
      icon - The small icon to represent this container
      type - The container's type
  • Method Details

    • acceptsType

      public boolean acceptsType(Object type)
      Returns true if this type can be a child of this container.
      Parameters:
      type - the type being requested
      Returns:
      true if this can be a child of this container
    • add

      public void add(PaletteEntry entry)
      Adds the given entry to the end of this PaletteContainer
      Parameters:
      entry - the PaletteEntry to add
    • add

      public void add(int index, PaletteEntry entry)
      Adds the given PaletteEntry at position index.
      Parameters:
      index - position to add the PaletteEntry
      entry - the PaletteEntry to add
    • addAll

      public void addAll(List list)
      Adds the list of PaletteEntry objects to this PaletteContainer.
      Parameters:
      list - a list of PaletteEntry objects to add to this PaletteContainer
    • appendToSection

      public void appendToSection(String id, PaletteEntry entry)
      Appends the given entry after the entry with the given id, but before the next separator.
      Parameters:
      id - the id of the entry to append after
      entry - the entry to add
    • getChildren

      public List getChildren()
      Returns:
      the children of this container
    • moveDown

      public boolean moveDown(PaletteEntry entry)
      Moves the given entry down, if possible. This method only handles moving the child within this container.
      Parameters:
      entry - The entry to be moved
      Returns:
      true if the given entry was successfully moved down
    • moveUp

      public boolean moveUp(PaletteEntry entry)
      Moves the given entry up, if possible. This method only handles moving the child within this container.
      Parameters:
      entry - The entry to be moved
      Returns:
      true if the given entry was successfully moved up
    • remove

      public void remove(PaletteEntry entry)
      Removes the given PaletteEntry from this PaletteContainer
      Parameters:
      entry - the PaletteEntry to remove
    • setChildren

      public void setChildren(List list)
      Sets the children of this PaletteContainer to the given list of PaletteEntry objects.
      Parameters:
      list - the list of children
    • toString

      public String toString()
      Overrides:
      toString in class PaletteEntry
      See Also: