Package com.appiancorp.suiteapi.process
Class Palette
java.lang.Object
com.appiancorp.suiteapi.common.Identity
com.appiancorp.suiteapi.process.Palette
- All Implemented Interfaces:
LocalId,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-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA name/id object that can be used by the UI -
Field Summary
Fields inherited from interface com.appiancorp.suiteapi.common.XMLable
DEFAULT_BUFFER_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds anActivityClassSchemato the existing schemas for this palette.voidaddItem(PaletteItem paletteItem) Adds aPaletteItemto the existing items for this palette.booleancontainsPaletteItem(PaletteItem paletteItem) Returnstrueif this palette contains the specifiedPaletteItem.Returns the palette's categorygetItems()Returns thePaletteItems on the paletteReturns the activity class schemas associated with the palettebooleanbooleanisSystem()Whether the palette is provided by the system or is a custom one.voidremovePaletteItem(PaletteItem paletteItemToRemove) Removes the providedPaletteItemfrom the palette.voidremovePaletteItems(List<PaletteItem> paletteItemsToRemove) Removes the providedPaletteItems from the palette.voidsetCategory(Long category_) Sets the palette's categoryvoidsetEnabled(boolean enabled) voidsetItems(PaletteItem[] items) Sets the items in the palette.voidsetSchemas(ActivityClassSchema[] newSchemas) Sets the activity class schemas to be associated with this palette (removing the existing ones).voidsetSystem(boolean system) Sets the palette's system property which marks it as a system-provided palette.toXML()Converts the palette to XML and returns it as as stringvoidtoXML(StringBuilder buffer) Converts the palette to XML and stores it in a StringBufferMethods inherited from class com.appiancorp.suiteapi.common.Identity
equals, getId, getName, getUuid, hashCode, setId, setName, setUuid, toString
-
Constructor Details
-
Palette
public Palette() -
Palette
Creates a new Palette as a deep copy of a given one.- Parameters:
palette- ThePaletteon 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
Returns the palette's category- Returns:
- the ID of the category containing this palette
-
setCategory
Sets the palette's category- Parameters:
category_- the ID of the category in which to place this palette
-
getItems
Returns thePaletteItems on the palette- Returns:
- an
Arraycontaining thePaletteItems on this palette
-
setItems
Sets the items in the palette. Removes the items previously in the palette.- Parameters:
items_- thePaletteItems to place in this palette
-
getSchemas
Returns the activity class schemas associated with the palette- Returns:
- the
ActivityClassSchemas associated with the palette
-
setSchemas
Sets the activity class schemas to be associated with this palette (removing the existing ones). Those schemas that are not mapped to an existingPaletteItemin the palette then it will not be added.- Parameters:
newSchemas- TheActivityClassSchemas to be associated with this palette.
-
addActivityClassSchema
Adds anActivityClassSchemato the existing schemas for this palette. If the schema is not mapped to an existingPaletteItemin 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
Adds aPaletteItemto the existing items for this palette. If the palette already contains aPaletteItemwith the same name then the existingPaletteItemis replaced with this new one.- Parameters:
paletteItem- ThePaletteItemto add to the palette
-
removePaletteItem
Removes the providedPaletteItemfrom the palette. TheActivityClassSchemaassociated with the palette item is also removed.- Parameters:
paletteItemToRemove- The palette item to remove
-
removePaletteItems
Removes the providedPaletteItems from the palette. TheActivityClassSchemas associated with the palette items are also removed.- Parameters:
paletteItemsToRemove- The list of palette items to remove
-
containsPaletteItem
Returnstrueif this palette contains the specifiedPaletteItem. Specifically, returnstrueif there is aPaletteItemwith the same name as the one of the providedPaletteItem.- Parameters:
paletteItem-PaletteItemto look for- Returns:
trueif there is aPaletteItemwith the givenPaletteItem's name
-
toXML
Converts the palette to XML and returns it as as string -
toXML
Converts the palette to XML and stores it in a StringBuffer
-