Class UIText

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPropCnr, IUIComp, IUICompRelativeTarget, IUIContextMenuOwner, IUIFocusComp, IUIHint, IUILabelForTarget, IUIPlainTextComponent, IUITextComponent, IVSComponentListener, IVSComponentState, IVSFieldListener, Cloneable
Direct Known Subclasses:
EUIText, UITextArea

Text UI component.
Author:
Christopher Mindus
  • Constructor Details

    • UIText

      public UIText()
      Creates the component without a name. The name must be set in all cases using the setPropertyAtom call.
    • UIText

      public UIText(Atom propertyAtom)
      Creates the component with the specified name. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
    • UIText

      public UIText(Atom propertyAtom, GProp<?>[] newValue) throws PropException
      Creates the component with the specified name, initialized to contain the GProp items. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - The name of the component, unique within it's parent.
      newValue - The array of all properties the component should have.
      Throws:
      PropException - when at least one of the properties to initialize the component with is invalid.
  • Method Details

    • getDeviceType

      public final int getDeviceType()
      Gets the device type: -1=mobile, 0=both, 1=desktop.
      Specified by:
      getDeviceType in interface IUIComp
    • isMobileContextMenuSupported

      public boolean isMobileContextMenuSupported()
      Returns if the component can show the context menu in mobile mode.
      Specified by:
      isMobileContextMenuSupported in interface IUIContextMenuOwner
      Returns:
      Text component supports context menus for mobile.
    • getMaximalLength

      public int getMaximalLength()
      Gets the maximum length of the text field. The default value is zero (no limit).
      Returns:
      The maximum length or 0 by default.
    • setMaximalLength

      public boolean setMaximalLength(int len)
      Sets the maximum length of the text field.
      Parameters:
      len - The length to set.
      Returns:
      Successful or not.
    • setTextValue

      public boolean setTextValue(String text)
      Sets the plain text property without tags processing.

      The text length is checked against the defined "Maximal length".

      If the component is connected to a VirtualSpace Field, that text is set instead of the UI component's text.

      Parameters:
      text - The text to set in plain text (no tags and no HTML tags will be processed).
      Returns:
      true for change of text as is, false for no change, truncated text or not supported.
    • getVisualLength

      public GUnit getVisualLength()
      Gets the visual length (unit) of the entry field.
      Returns:
      The visual length or 15em by default.
    • setVisualLength

      public boolean setVisualLength(GUnit len) throws PropException
      Sets the visual length (unit) of the entry field.
      Parameters:
      len - The visual length to set.
      Returns:
      Successful or not.
      Throws:
      PropException
    • getApproximateSize

      public Size getApproximateSize()
      Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).
      Specified by:
      getApproximateSize in class UIComp
      Returns:
      The size of the component.
    • getHorizontallyExpand

      public boolean getHorizontallyExpand()
      Gets the horizontally expand option.
      Returns:
      The expand option.
    • setHorizontallyExpand

      public boolean setHorizontallyExpand(boolean on)
      Sets the horizontally expand option.
      Parameters:
      on - Set the expand option.
      Returns:
      true for value changed, false for no change.
    • getAlignTrailing

      public boolean getAlignTrailing()
      Gets the text align trailing option.
      Returns:
      The text align trailing option.
    • setAlignTrailing

      public boolean setAlignTrailing(boolean on)
      Sets the text align trailing option.
      Parameters:
      on - Set text align trailing option.
      Returns:
      true for value changed, false for no change.
    • getMinWidth

      public GUnit getMinWidth()
      Gets minimum size.
      Returns:
      The minimum size, default 1em.
    • setMinWidth

      public boolean setMinWidth(GUnit min) throws PropException
      Sets the entry field minimum width.
      Parameters:
      min - Set the minimum length.
      Returns:
      true for value changed, false for no change.
      Throws:
      PropException
    • getMaxWidth

      public GUnit getMaxWidth()
      Gets entry field maximum width.
      Returns:
      The minimum size, default 15em.
    • setMaxWidth

      public boolean setMaxWidth(GUnit max) throws PropException
      Sets the entry field maximum width.
      Parameters:
      max - Set the maximum length.
      Returns:
      true for value changed, false for no change.
      Throws:
      PropException
    • getCharUpdate

      public boolean getCharUpdate()
      Gets the character update option.
      Returns:
      The expand option.
    • setCharUpdate

      public boolean setCharUpdate(boolean on)
      Sets the character update option.
      Parameters:
      on - Set the character update option.
      Returns:
      true for value changed, false for no change.
    • getCharCase

      public int getCharCase()
      Gets the character case option.
      Returns:
      The character case option: 0=normal, 1=upper, 2=lower, 3=proper.
    • setCharCase

      public boolean setCharCase(int cc)
      Sets the character case option.
      Parameters:
      cc - The option to set: 0=normal, 1=upper, 2=lower, 3=proper.
      Returns:
      Successful or not.
    • getTrim

      public boolean getTrim()
      Gets the trim option.
      Returns:
      The trim option.
    • setTrim

      public boolean setTrim(boolean on)
      Sets the trim option.
      Parameters:
      on - Set the trim option.
      Returns:
      true for value changed, false for no change.
    • getEntryFieldType

      public EntryFieldType getEntryFieldType()
      Gets the entry field type defined.
      Returns:
      The entry field type.
    • setEntryFieldType

      public boolean setEntryFieldType(EntryFieldType type)
      Sets the entry field type.
      Parameters:
      type - The new type.
      Returns:
      true for value changed, false for no change.