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 Type
    Method
    Description
    default String
    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.
    default Property<T,?>
    Returns the single property managed by this panel.
    default void
    runAndAddAction(T value, String type)
    Executes an action that modifies the properties and adds it to the history for undo/redo functionality.
    void
    Updates the UI fields of the panel to reflect the current values of the properties.
    default boolean
    Checks if this panel is managing a single property or multiple properties.
    default ArrayList<Property<T,?>>
    typeConvert(ArrayList<Property<?,?>> properties)
    Converts a list of generic properties to a list of properties of the specific type T.
  • Method Details

    • getProperties

      ArrayList<Property<T,?>> getProperties()
      Returns a list of properties that this panel is responsible for displaying and editing.
      Returns:
      An ArrayList of Property objects.
    • setFields

      void setFields()
      Updates the UI fields of the panel to reflect the current values of the properties.
    • typeConvert

      default ArrayList<Property<T,?>> typeConvert(ArrayList<Property<?,?>> properties)
      Converts a list of generic properties to a list of properties of the specific type T. This method assumes that all properties in the input list are indeed of type T.
      Parameters:
      properties - The list of generic properties to convert.
      Returns:
      An ArrayList of Property objects of type T.
    • singleProperty

      default boolean singleProperty()
      Checks if this panel is managing a single property or multiple properties.
      Returns:
      true if the panel manages only one property, false otherwise.
    • getSingleProperty

      default Property<T,?> getSingleProperty()
      Returns the single property managed by this panel.
      Returns:
      The single Property object.
    • getActionDesc

      default String getActionDesc(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.
      Parameters:
      type - The type of the property being edited (e.g., "Int", "String").
      val - The new value being applied to the property.
      Returns:
      A String describing the action.
    • runAndAddAction

      default void runAndAddAction(T value, String type)
      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").