- java.lang.Object
-
- org.praxislive.code.ControlDescriptor
-
- Direct Known Subclasses:
InfoProperty.Descriptor,PropertyControl.Descriptor,ResourceProperty.Descriptor,TriggerControl.Descriptor
public abstract class ControlDescriptor extends Object
A ControlDescriptor wraps a Control in a CodeContext. It includes ID, category, order and info, as well as configuring the control on attachment and reset. The underlying control may be configured from the previous iteration or carried across.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classControlDescriptor.CategoryCategories of control, which also affects broad ordering of controls.
-
Constructor Summary
Constructors Modifier Constructor Description protectedControlDescriptor(String id, ControlDescriptor.Category category, int index)Create a ControlDescriptor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract voidattach(CodeContext<?> context, Control previous)Configure the control for the provided context during attachment.voiddispose()Hook called on code context disposal for any control descriptors not carried over.ControlDescriptor.CategorygetCategory()Get the category.abstract ControlgetControl()Get the wrapped control.StringgetID()Get the ID.intgetIndex()Get the index.abstract ControlInfogetInfo()Get the control info for this control.voidreset(boolean full)Hook called to reset during attachment / detachment, or execution context state changes.voidstopping()Deprecated.
-
-
-
Constructor Detail
-
ControlDescriptor
protected ControlDescriptor(String id, ControlDescriptor.Category category, int index)
Create a ControlDescriptor.- Parameters:
id- the ID (must be a valid control ID)category- the categoryindex- the index within the category (used for ordering - must be unique)
-
-
Method Detail
-
getID
public final String getID()
Get the ID.- Returns:
- id
-
getCategory
public ControlDescriptor.Category getCategory()
Get the category.- Returns:
- category
-
getIndex
public int getIndex()
Get the index.- Returns:
- index
-
getInfo
public abstract ControlInfo getInfo()
Get the control info for this control.- Returns:
- info
-
attach
public abstract void attach(CodeContext<?> context, Control previous)
Configure the control for the provided context during attachment. The previous control with the same ID is provided - it may be null or of a different type.Note : any control passed in as previous will not be disposed
- Parameters:
context- context being attached toprevious- previous control with same ID, may be null or different type
-
getControl
public abstract Control getControl()
Get the wrapped control. Should only be called when attached - behaviour is otherwise undefined.- Returns:
- control
-
reset
public void reset(boolean full)
Hook called to reset during attachment / detachment, or execution context state changes. Full reset happens on execution context changes.- Parameters:
full- true if execution context state
-
stopping
@Deprecated public void stopping()
Deprecated.Deprecated hook - no op!
-
dispose
public void dispose()
Hook called on code context disposal for any control descriptors not carried over.
-
-