class UILabel
A view class that represents a label control.
class UILabel extends UIComponent
Description
A label component is rendered on-screen as a stand-alone piece of text.
Constructor
- constructor(text?)Creates a new label view object with the specified text.
Type Members
- type UILabel.StyleType staticThe type definition for styles applicable to UILabel.style.
Instance Members
- textThe label text to be displayed.
- iconThe label icon to be displayed.
- iconSizeIcon size (in pixels or string with unit).
- iconMarginSpace between the icon and label text (in pixels or string with unit).
- iconColorIcon color.
- wrapTrue if text should wrap if the text is too long to fit on one line.
- selectableTrue if text should be user-selectable using input gestures, mouse, or keyboard.
- headingLevelText heading level.
- titleTrue if the title label style should be applied to this label.
- smallTrue if the small label style should be applied to this label.
- htmlFormatTrue if text should be rendered as HTML instead of plain text.
- allowFocusTrue if this label may receive input focus.
- allowKeyboardFocusTrue if this label may receive input focus using the keyboard (e.g. Tab key).
- widthTarget width of the label, in pixels or CSS length with unit.
- boldTrue if this label should be displayed using bold text.
- italicTrue if this label should be displayed using bold text.
- colorThe text color to be applied to this label.
- dimThe opacity to be applied to this label, or
true
to use 50% opacity. - styleThe style to be applied to this label.
Inherited Members
- applyViewPreset(preset)Applies the provided preset properties to this object.
- hiddenTrue if the component should be hidden from view.
- positionOptions related to the position of this component.
- accessibleRoleWAI-ARIA role for this component, if applicable.
- accessibleLabelWAI-ARIA label text for this component (not tooltip), if applicable.
- requestFocus()Requests input focus on this component.
- requestFocusNext()Requests input focus for the next sibling component.
- requestFocusPrevious()Requests input focus for the previous sibling component.
- render(callback)Triggers asynchronous rendering for this component, and all contained components, if any.
- findViewContent(type)Implementation of View.findViewContent(), returns an empty array unless overridden.
- lastRenderOutputLast rendered output, if any; set by the UI component renderer.
- emit(event)Emits an event, immediately calling all event handlers.
- emitChange(name?, data?)Emits a change event, an instance of ManagedChangeEvent.
- listen(handler)Adds a handler for all events emitted by this object.
- isUnlinked()Returns true if the object has been unlinked.
- unlink()Unlinks this managed object.
- beforeUnlink() protectedA method that’s called immediately before unlinking an object, can be overridden.
- attach(target, observer?) protectedAttaches the provided managed object to this object.
- autoAttach(propertyName, observer?) protectedObserves a property, so that any object assigned to it is attached immediately.