Class MLSimple

    • Field Detail

      • PN_TRAILING_TEXT

        public static final java.lang.String PN_TRAILING_TEXT
        Property name: trailing text "tt".
        See Also:
        Constant Field Values
      • PN_TRAILING_WRAP

        public static final java.lang.String PN_TRAILING_WRAP
        Property name: trailing text "tw".
        See Also:
        Constant Field Values
      • PN_V_TRAILING_TEXT

        public static final java.lang.String PN_V_TRAILING_TEXT
        Property name: trailing text virtual column reference "V_tt".
        See Also:
        Constant Field Values
      • PN_ALIGN_OPPOSITE

        public static final java.lang.String PN_ALIGN_OPPOSITE
        Property name: trailing align opposite "ao".
        See Also:
        Constant Field Values
      • PN_ARROW

        public static final java.lang.String PN_ARROW
        Property name: display trailing arrow "arrow".
        See Also:
        Constant Field Values
      • TABLE_COLUMN_NAME_OR_ATOMS

        public static java.lang.Object[] TABLE_COLUMN_NAME_OR_ATOMS
        The table column atoms or property names used.
      • TABLE_COLUMN_VALUE_TYPES

        public static Value.Type[] TABLE_COLUMN_VALUE_TYPES
        Best value types for the columns.
    • Constructor Detail

      • MLSimple

        public MLSimple​(java.lang.String text,
                        boolean isArrowDisplayed)
        Constructor for a simple item without trailing text that is to be added into a list.
        Parameters:
        text - The leading text, null for none.
        isArrowDisplayed - Flag for arrow display.
      • MLSimple

        public MLSimple​(java.lang.String text,
                        java.lang.String trailing,
                        boolean isArrowDisplayed)
        Constructor for a simple item that is to be added into a list.
        Parameters:
        text - The leading text, null for none.
        trailing - The trailing text, null for none.
        isArrowDisplayed - Flag for arrow display.
      • MLSimple

        public MLSimple​(KString text,
                        KString trailing,
                        boolean isArrowDisplayed)
        Constructor for a simple item that is to be added into a list.
        Parameters:
        text - The leading text, null for none.
        trailing - The trailing text, null for none.
        isArrowDisplayed - Flag for arrow display.
    • Method Detail

      • getType

        public MLItemType getType()
        Returns the type.
        Specified by:
        getType in class MLItem
        Returns:
        MLItemType.SIMPLE.
      • getLeadingTextColumn

        protected int getLeadingTextColumn()
        Returns the column index for the leading text. Types supporting description text must override this method.
        Specified by:
        getLeadingTextColumn in class MLItem
        Returns:
        The column index, or -1 for none.
      • getDescriptionColumn

        protected int getDescriptionColumn()
        Returns the column index for the description. Types supporting description text must override this method.
        Specified by:
        getDescriptionColumn in class MLItem
        Returns:
        The column index, or -1 for none.
      • refreshFromVS

        public void refreshFromVS​(int[] columns)
        Refreshes contents from VirtualSpace.
        Specified by:
        refreshFromVS in interface IContentData<MLItemProp>
        Specified by:
        refreshFromVS in class MLItem
        Parameters:
        columns - The connected table columns indicies, -1 for none.
      • getTrailingText

        public KString getTrailingText()
        Gets the trailing text for the list item.
        Returns:
        The text, or null if none is set.
      • setTrailingText

        public boolean setTrailingText​(KString text)
        Sets the trailing text for the list item.
        Parameters:
        text - The new text, or null for none.
        Returns:
        true for changed, false for no change.
      • isTrailingTextOppositeAligned

        public boolean isTrailingTextOppositeAligned()
        Returns if the trailing text is aligned to the opposite side, i.e. leading instead of trailing.
        Returns:
        true if trailing text is aligned to leading side, false for aligned to the trailing side.
      • setTrailingTextOppositeAligned

        public boolean setTrailingTextOppositeAligned​(boolean opposite)
        Sets if the trailing text is aligned to the opposite side, i.e. leading instead of trailing.
        Parameters:
        opposite - Alignment flag: true if trailing text is aligned to leading side, false for aligned to the trailing side.
        Returns:
        true for changed, false for no change.
      • getTrailingTextWrap

        public int getTrailingTextWrap()
        Gets option for trailing text wrap.
        Returns:
        The trailing text wrap, multiple(0), single line(1), ellipsis(2).
      • setTrailingTextWrap

        public boolean setTrailingTextWrap​(int opt)
        Sets the option for trailing text wrap.
        Parameters:
        opt - The wrap option; multiple(0), single line(1), ellipsis(2).
        Returns:
        true for changed, false for no change.
      • setTrailingTextWrapMultiple

        public boolean setTrailingTextWrapMultiple()
        Sets the option for trailing text wrap to multiple line.
        Returns:
        true for changed, false for no change.
      • setTrailingTextWrapSingle

        public boolean setTrailingTextWrapSingle()
        Sets the option for trailing text wrap to single line.
        Returns:
        true for changed, false for no change.
      • setTrailingTextWrapEllipsis

        public boolean setTrailingTextWrapEllipsis()
        Sets the option for trailing text wrap to single line.
        Returns:
        true for changed, false for no change.
      • isArrowDisplayed

        public boolean isArrowDisplayed()
        Returns if the trailing arrow is displayed or not.
        Returns:
        true to display arrow, false not to display arrow.
      • setArrowDisplayed

        public boolean setArrowDisplayed​(boolean on)
        Sets if the trailing arrow should be displayed or not.
        Parameters:
        on - The display flag: true to display arrow, false not to display arrow.
        Returns:
        true for changed, false for no change.
      • addListener

        public boolean addListener​(IMLArrowActionListener listener)
        Adds an action listener for the arrow. Calling this method multiple times with the same listener will have no effect (but to return false).
        Parameters:
        listener - The listener to add.
        Returns:
        true if the listener was added, false otherwise.
        Throws:
        java.lang.NullPointerException - If the listener is null.
      • removeListener

        public boolean removeListener​(IMLArrowActionListener listener)
        Removes an action listener for the arrow.
        Parameters:
        listener - The listener to remove.
        Returns:
        true if listener is successfully removed, false otherwise.
      • onArrowInvoked

        public void onArrowInvoked​(MLItem item)
        Called when the arrow action is invoked. By default, this method will invoke all potential arrow action listeners. A subclass might override this method instead of adding a listener. This subclass should then call the super.onArrowInvoked(item) method in case listeners are added by others.
        Specified by:
        onArrowInvoked in interface IMLArrowActionListener
        Parameters:
        item - "this" item.