java.lang.Object
ro.sync.ecss.extensions.commons.table.properties.TableProperty

@API(type=INTERNAL, src=PUBLIC) public class TableProperty extends Object
Class representing a table property. It contains the name of the property, possible values, icons for the values, current set value of the property, the group that contains it, the type of GUI elements that will be used to present the property in the "Table properties" dialog.
  • Constructor Details

    • TableProperty

      public TableProperty(String propertyName, String propertyRenderString, List<String> propertyValues, String currentValue)
      Constructor.
      Parameters:
      propertyName - The qName of the current attribute.
      propertyRenderString - The string that will be presented in the SATablePropertiesCustomizerDialog. It can be different from the attribute name or it can be even the same.
      propertyValues - The list with the attribute's possible values.
      currentValue - The current of the attribute.
    • TableProperty

      public TableProperty(String propertyName, String propertyRenderString, List<String> propertyValues, String currentValue, boolean isAttribute)
      Constructor.
      Parameters:
      propertyName - The qName of the current attribute.
      propertyRenderString - The string that will be presented in the SATablePropertiesCustomizerDialog. It can be different from the attribute name or it can be even the same.
      propertyValues - The list with the attribute's possible values.
      currentValue - The current of the attribute.
      isAttribute - true if the current property represents an attribute.
    • TableProperty

      public TableProperty(String propertyName, String propertyRenderString, List<String> propertyValues, String currentValue, boolean isAttribute, boolean isActive)
      Constructor.
      Parameters:
      propertyName - The qName of the current attribute.
      propertyRenderString - The string that will be presented in the SATablePropertiesCustomizerDialog. It can be different from the attribute name or it can be even the same.
      propertyValues - The list with the attribute's possible values.
      currentValue - The current of the attribute.
      isAttribute - true if the current property represents an attribute.
      isActive - true if the combobox corresponding to the current property is enabled, false otherwise.
    • TableProperty

      public TableProperty(String propertyName, String propertyRenderString, List<String> propertyValues, String currentValue, String parentGroup, GuiElements guiType, Map<String,String> icons, boolean isAttribute, boolean isActive)
      Constructor.
      Parameters:
      propertyName - The qName of the current attribute.
      propertyRenderString - The string that will be presented in the SATablePropertiesCustomizerDialog. It can be different from the attribute name or it can be even the same.
      propertyValues - The list with the attribute's possible values.
      currentValue - The current of the attribute.
      parentGroup - The group name that will include the current property.
      guiType - The type of GUI element that will be used to represent the values for the current property. If is one of GuiElements.COMBOBOX, GuiElements.RADIO_BUTTONS. The default is GuiElements.COMBOBOX. If this parameter is set to null, the element that will be used is GuiElements.COMBOBOX.
      icons - The list of icons. An icon for every value. If empty icon corresponds to a value, the icon will be null
      isAttribute - true if the current property represents an attribute.
      isActive - true if the combobox corresponding to the current property is enabled, false otherwise.
  • Method Details

    • getAttributeName

      public String getAttributeName()
      Obtain the property name.
      Returns:
      Returns the property name.
    • getAttributeRenderString

      public String getAttributeRenderString()
      Obtain the render string fort the property.
      Returns:
      the render string fort the property
    • getValues

      public List<String> getValues()
      Obtain the property possible values.
      Returns:
      Returns the values.
    • getCurrentValue

      public String getCurrentValue()
      Obtain the current value for the attributes.
      Returns:
      Returns the current value of the attribute.
    • setCurrentValue

      public void setCurrentValue(String currentValue)
      Set a new current value for the property.
      Parameters:
      currentValue - The new value to set.
    • getParentGroup

      public String getParentGroup()
      Obtain the group that includes the current property.
      Returns:
      Returns the group name or null if no group contains this property.
    • setParentGroup

      public void setParentGroup(String parentGroup)
      Sets the group that includes the current property.
      Parameters:
      parentGroup - The group that includes the current property.
    • isAttribute

      public boolean isAttribute()
      true if the current property represents an attribute.
      Returns:
      Returns true if the property is an attribute.
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • getOldValue

      public String getOldValue()
      Obtain the old set value.
      Returns:
      Returns the old value.
    • setOldValue

      public void setOldValue(String oldValue)
      Set the old value for the property. It should be correlated with setting a new value.
      Parameters:
      oldValue - The old value to set.
    • isActive

      public boolean isActive()
      Check if the property can be edited through the properties dialog.
      Returns:
      true if the combobox corresponding to the current property is enabled, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also:
    • setValues

      public void setValues(List<String> values)
      Sets the values for the current property.
      Parameters:
      values - Values for the current property.
    • setGuiType

      public void setGuiType(GuiElements guiType)
      Set the type of GUI elements which will be used to present the values for the property.
      Parameters:
      guiType - The new type GUI elements which will be used to present the values for the property.
    • getGuiType

      public GuiElements getGuiType()
      Obtain the type of GUI elements which will be used to present the values for the property.
      Returns:
      Returns the type of GUI elements which will be used to present the values for the property.
    • getIcons

      public Map<String,String> getIcons()
      Obtain the icons for the property values. If the list contains null objects, then an empty icon should be used.
      Returns:
      Returns the icons for all the possible values. Every values is mapped to an icon path.
    • setIcons

      public void setIcons(Map<String,String> icons)
      Set the icons for the property possible values.
      Parameters:
      icons - The icons to set.