Class Palette

java.lang.Object
com.appiancorp.suiteapi.common.Identity
com.appiancorp.suiteapi.process.Palette
All Implemented Interfaces:
LocalId, XMLable, Serializable

public class Palette extends Identity implements XMLable, Serializable
Holds a collection of nodes that can be dropped onto a canvas in the designer to create a process. Each node is represented as a PaletteItem, and the activity class schema the node represents is stored as an ActivityClassSchema
See Also:
  • Constructor Details

    • Palette

      public Palette()
    • Palette

      public Palette(Palette palette)
      Creates a new Palette as a deep copy of a given one.
      Parameters:
      palette - The Palette on which this instance should be based.
  • Method Details

    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • isSystem

      public boolean isSystem()
      Whether the palette is provided by the system or is a custom one.
      Returns:
      true if the palette has been provided by the system or false otherwise.
    • setSystem

      public void setSystem(boolean system)
      Sets the palette's system property which marks it as a system-provided palette.
      Parameters:
      system - whether the palette is provided by the system or is a custom one.
    • getCategory

      public Long getCategory()
      Returns the palette's category
      Returns:
      the ID of the category containing this palette
    • setCategory

      public void setCategory(Long category_)
      Sets the palette's category
      Parameters:
      category_ - the ID of the category in which to place this palette
    • getItems

      public PaletteItem[] getItems()
      Returns the PaletteItems on the palette
      Returns:
      an Array containing the PaletteItems on this palette
    • setItems

      public void setItems(PaletteItem[] items)
      Sets the items in the palette. Removes the items previously in the palette.
      Parameters:
      items_ - the PaletteItems to place in this palette
    • getSchemas

      public ActivityClassSchema[] getSchemas()
      Returns the activity class schemas associated with the palette
      Returns:
      the ActivityClassSchemas associated with the palette
    • setSchemas

      public void setSchemas(ActivityClassSchema[] newSchemas)
      Sets the activity class schemas to be associated with this palette (removing the existing ones). Those schemas that are not mapped to an existing PaletteItem in the palette then it will not be added.
      Parameters:
      newSchemas - The ActivityClassSchemas to be associated with this palette.
    • addActivityClassSchema

      public void addActivityClassSchema(ActivityClassSchema acs)
      Adds an ActivityClassSchema to the existing schemas for this palette. If the schema is not mapped to an existing PaletteItem in the palette then it will not be added. If the schema already exists in the palette then it will not overwrite the existing one.
      Parameters:
      acs - the schema to add to the list
    • addItem

      public void addItem(PaletteItem paletteItem)
      Adds a PaletteItem to the existing items for this palette. If the palette already contains a PaletteItem with the same name then the existing PaletteItem is replaced with this new one.
      Parameters:
      paletteItem - The PaletteItem to add to the palette
    • removePaletteItem

      public void removePaletteItem(PaletteItem paletteItemToRemove)
      Removes the provided PaletteItem from the palette. The ActivityClassSchema associated with the palette item is also removed.
      Parameters:
      paletteItemToRemove - The palette item to remove
    • removePaletteItems

      public void removePaletteItems(List<PaletteItem> paletteItemsToRemove)
      Removes the provided PaletteItems from the palette. The ActivityClassSchemas associated with the palette items are also removed.
      Parameters:
      paletteItemsToRemove - The list of palette items to remove
    • containsPaletteItem

      public boolean containsPaletteItem(PaletteItem paletteItem)
      Returns true if this palette contains the specified PaletteItem. Specifically, returns true if there is a PaletteItem with the same name as the one of the provided PaletteItem.
      Parameters:
      paletteItem - PaletteItem to look for
      Returns:
      true if there is a PaletteItem with the given PaletteItem's name
    • toXML

      public String toXML()
      Converts the palette to XML and returns it as as string
      Specified by:
      toXML in interface XMLable
      Returns:
      a String containing the XML serialization of this palette
    • toXML

      public void toXML(StringBuilder buffer)
      Converts the palette to XML and stores it in a StringBuffer
      Specified by:
      toXML in interface XMLable
      Parameters:
      buffer - the StringBuffer to append the XML to