Class PropertyData.StringType

java.lang.Object
net.mcreator.ui.minecraft.states.PropertyData<String>
net.mcreator.ui.minecraft.states.PropertyData.StringType
Enclosing class:
PropertyData<T>

public static class PropertyData.StringType extends PropertyData<String>
A subclass for string type properties.
  • Constructor Details

    • StringType

      public StringType(String name)
    • StringType

      public StringType(String name, String[] arrayData)
  • Method Details

    • getArrayData

      public String[] getArrayData()
    • getDefaultValue

      @Nonnull public String getDefaultValue()
      Description copied from class: PropertyData
      Provides the default value of type of this property. This is the "null" value of this type, which means it may be outside value limits defined for a particular property.
      Specified by:
      getDefaultValue in class PropertyData<String>
      Returns:
      A default value of this property's type.
    • toString

      public final String toString(Object value)
      Description copied from class: PropertyData
      Converts passed value of this property to its string representation.
      Specified by:
      toString in class PropertyData<String>
      Parameters:
      value - A value of this property's type.
      Returns:
      Possible value of this property as a string.
    • parseObj

      public final String parseObj(com.google.gson.JsonElement value)
      Description copied from class: PropertyData
      Parses string representation of passed value of this property.
      Specified by:
      parseObj in class PropertyData<String>
      Parameters:
      value - Possible value of this property as JsonElement.
      Returns:
      A value of this property's type.
    • getComponent

      public JComponent getComponent(MCreator mcreator, @Nullable Object value)
      Description copied from class: PropertyData
      Generates a UI component accepting values of type PropertyData and sets its value to the passed one.
      Specified by:
      getComponent in class PropertyData<String>
      Parameters:
      mcreator - The future parent window of the component returned.
      value - Possible value of this property.
      Returns:
      A UI component that accepts values of type PropertyData.
    • getValue

      public String getValue(JComponent component)
      Description copied from class: PropertyData
      Extracts possible value of this property from the provided UI component.
      Specified by:
      getValue in class PropertyData<String>
      Parameters:
      component - A UI component that accepts values of type PropertyData.
      Returns:
      A value of this property's type.