Interface PropertyPanel<T>
- Type Parameters:
T- The type that the properties all hold.
- All Known Implementing Classes:
BooleanProperty,ColourProperty,IDProperty,IntProperty,ObjectProperty,StringProperty,Vector3Property
public interface PropertyPanel<T>
PropertyPanel is the interface which defines how a
PropertyEntry's sub panel
displays and edits components.
This interface exists such as to allow all sub panels to access the entire list of
Property associated with it.
The following classes implement this interface:
BooleanProperty, ColourProperty, IDProperty, IntProperty,
ObjectProperty, StringProperty, Vector3Property
- Author:
- Lehlogonolo Poole
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetActionDesc(String type, Object val) Generates a description for an action based on whether it's a single or batch edit, the type of property, and the new value.Returns a list of properties that this panel is responsible for displaying and editing.Returns the single property managed by this panel.default voidrunAndAddAction(T value, String type) Executes an action that modifies the properties and adds it to the history for undo/redo functionality.voidUpdates the UI fields of the panel to reflect the current values of the properties.default booleanChecks if this panel is managing a single property or multiple properties.typeConvert(ArrayList<Property<?, ?>> properties) Converts a list of generic properties to a list of properties of the specific typeT.
-
Method Details
-
getProperties
Returns a list of properties that this panel is responsible for displaying and editing. -
setFields
void setFields()Updates the UI fields of the panel to reflect the current values of the properties. -
typeConvert
Converts a list of generic properties to a list of properties of the specific typeT. This method assumes that all properties in the input list are indeed of typeT. -
singleProperty
default boolean singleProperty()Checks if this panel is managing a single property or multiple properties.- Returns:
trueif the panel manages only one property,falseotherwise.
-
getSingleProperty
Returns the single property managed by this panel.- Returns:
- The single
Propertyobject.
-
getActionDesc
Generates a description for an action based on whether it's a single or batch edit, the type of property, and the new value.- Parameters:
type- The type of the property being edited (e.g., "Int", "String").val- The new value being applied to the property.- Returns:
- A
Stringdescribing the action.
-
runAndAddAction
Executes an action that modifies the properties and adds it to the history for undo/redo functionality. This method handles both single and batch property edits.- Parameters:
value- The new value to be set for the properties.type- The type of the property being edited (e.g., "Int", "String").
-