Class UIOutput

All Implemented Interfaces:
EventListener, IFocusComp, IMessageBox, IComponent, ICustomDataProvider, IGProp<GProp<?>[]>, IPatternOwner, IPropCnr, IUIComp, IUIContextMenuOwner, IUIFocusComp, IUIHint, IUIHTMLTextComponent, IUITextComponent, IVSComponentListener, IVSComponentState, IVSFieldListener, IVSRelativeReferenceFocusScope, Cloneable
Direct Known Subclasses:
EUIOutput

Output (label) UI component.
Author:
Christopher Mindus
  • Field Details

  • Constructor Details

    • UIOutput

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

      public UIOutput(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.
    • UIOutput

      public UIOutput(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:
      Label component supports context menus for mobile.
    • setLabelReference

      public boolean setLabelReference(IUILabelForTarget comp)
      Sets the component as label reference (in this case output text), i.e. when clicked upon, either for is set to the component, or if it is e.g. a checkbox, radio button or switch, that component will change its state. The method name says setLabelReference(IUILabelForTarget) but is in fact used for the output text.
      Parameters:
      comp - The UI component, null to clear it.
      Returns:
      true for change, false for no change.
    • setLabelType

      public boolean setLabelType(int type)
      Sets the label type, i.e. how the line should be processed: wrap over multiple lines, single line (default), single line and ellipsis when it overflows horizontally, or fill label horizontally and vertically.
      Parameters:
      type - -1=single line (default), 0=multiple, 1=single (default), 2=ellipsis, 3=fill.
      Returns:
      true for change, false for no change.
      Throws:
      IllegalArgumentException - if different.
    • setFocusable

      public boolean setFocusable(boolean on)
      Sets the focusable state.
      Parameters:
      on - Flag indicating component will be able to receive focus if enabled and visible when true, false to let component never receive focus. If focus is set to the component in question, focus change will not occur if the flag is set false.
      Returns:
      true for changed, false for no change.
    • isFocusable

      public boolean isFocusable()
      Returns the focusable state.
      Returns:
      Flag indicating component will be able to receive focus if enabled and visible when true, false to let component never receive focus. If focus is set to the component in question, focus change will not occur if the flag is set false (the default value).
    • shouldVerify

      public boolean shouldVerify(VSRelativeReference<?> ref)
      Checks if a particular VS reference should be verified or not.
      Specified by:
      shouldVerify in interface IVSRelativeReferenceFocusScope
      Parameters:
      ref - The reference to verify.
      Returns:
      Always false.
    • getPatternProp

      public PatternProp getPatternProp()
      Gets the pattern property.
      Specified by:
      getPatternProp in interface IPatternOwner
      Returns:
      The pattern property, or null for none.
    • getValueType

      public Value.Type getValueType()
      Returns the value type for the pattern property.
      Specified by:
      getValueType in interface IPatternOwner
      Returns:
      Value.Type.KString.
    • canRequestFocus

      public String canRequestFocus()
      Returns if this component can receive focus. Focus capable components may override to return null for success, or other error message.
      Specified by:
      canRequestFocus in interface IPropCnr
      Overrides:
      canRequestFocus in class UIComp
      Returns:
      "Label not focusable" always.
    • couldRequestFocusIfVirtualized

      public String couldRequestFocusIfVirtualized(boolean ignoreStates)
      Returns if this component could receive focus if it would be virtualized. Focus capable components may override to return null for success, or other error message.
      Specified by:
      couldRequestFocusIfVirtualized in interface IPropCnr
      Parameters:
      ignoreStates - Flag indicating that states should be ignored, such as visible or enabled. If false, hidden or disabled components return an error message.
      Returns:
      "Label not focusable" always.
    • 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: 16x16 TODO!.