Package com.iizix.prop.ui.mlist
Class MLSimple
java.lang.Object
com.iizix.prop.ui.mlist.MLItem
com.iizix.prop.ui.mlist.MLSimple
- All Implemented Interfaces:
- IContentData<MLItemProp>,- IMLArrowActionListener
The simple list item class.
A simple list item has a text on leading/trailing sides and a description.
The trailing side is optional as well as the description.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringProperty name: trailing align opposite "ao".- static final StringProperty name: display trailing arrow "arrow".- static final StringProperty name: trailing text "tt".- static final StringProperty name: trailing text "tw".- static final StringProperty name: trailing text virtual column reference "V_tt".- static Object[]The table column atoms or property names used.- static Value.Type[]Best value types for the columns.- Fields inherited from class com.iizix.prop.ui.mlist.MLItem- FIRST_COLUMN_INDEX, PN_ACTION, PN_ANIMATION, PN_DESCRIPTION, PN_ICON, PN_ICON_MARGINS, PN_LEADING_TEXT, PN_LEADING_WIDTH, PN_LEADING_WRAP, PN_V_DESCRIPTION, PN_V_LEADING_TEXT, PN_VS_FOCUS
- Constructor SummaryConstructorsConstructorDescriptionConstructor for a simple item that is to be added into a list.Constructor for a simple item without trailing text that is to be added into a list.Constructor for a simple item that is to be added into a list.
- Method SummaryModifier and TypeMethodDescription- boolean- addListener- (IMLArrowActionListener listener) Adds an action listener for the arrow.- protected intReturns the column index for the description.- protected intReturns the column index for the leading text.Gets the trailing text for the list item.- intGets option for trailing text wrap.- getType()Returns the type.- void- initialize- (MLItemProp item) Initializes the item property from the content data.- booleanReturns if the trailing arrow is displayed or not.- booleanReturns if the trailing text is aligned to the opposite side, i.e.- void- onArrowInvoked- (MLItem item) Called when the arrow action is invoked.- void- refreshFromVS- (int[] columns) Refreshes contents from VirtualSpace.- boolean- removeListener- (IMLArrowActionListener listener) Removes an action listener for the arrow.- boolean- setArrowDisplayed- (boolean on) Sets if the trailing arrow should be displayed or not.- boolean- setTrailingText- (KString text) Sets the trailing text for the list item.- boolean- setTrailingTextOppositeAligned- (boolean opposite) Sets if the trailing text is aligned to the opposite side, i.e.- boolean- setTrailingTextWrap- (int opt) Sets the option for trailing text wrap.- booleanSets the option for trailing text wrap to single line.- booleanSets the option for trailing text wrap to multiple line.- booleanSets the option for trailing text wrap to single line.- Methods inherited from class com.iizix.prop.ui.mlist.MLItem- addMappings, doBooleanSelectionOnly, getContextMenu, getGroup, getIcon, getIconMargins, getItemProp, getLeadingText, getLeadingTextWrap, getLeadingWidth, getSelectionPropName, getSelectionState, getVSRow, hasActionSupport, isEnabled, isReadOnly, isSelected, isVisible, setActionSupport, setContextMenu, setDescription, setEnabled, setIcon, setIconMargins, setIconPadding, setLeadingText, setLeadingTextEllipsis, setLeadingTextSingleLine, setLeadingTextWrap, setLeadingTextWrap, setLeadingWidth, setReadOnly, setSelected, setSelection, setSelectionInternal, setVisible
- Field Details- PN_TRAILING_TEXTProperty name: trailing text "tt".- See Also:
 
- PN_TRAILING_WRAPProperty name: trailing text "tw".- See Also:
 
- PN_V_TRAILING_TEXTProperty name: trailing text virtual column reference "V_tt".- See Also:
 
- PN_ALIGN_OPPOSITEProperty name: trailing align opposite "ao".- See Also:
 
- PN_ARROWProperty name: display trailing arrow "arrow".- See Also:
 
- TABLE_COLUMN_NAME_OR_ATOMSThe table column atoms or property names used.
- TABLE_COLUMN_VALUE_TYPESBest value types for the columns.
 
- Constructor Details- MLSimpleConstructor 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.
 
- MLSimpleConstructor 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.
 
- MLSimpleConstructor 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 Details- getTypeReturns the type.
- initializeInitializes the item property from the content data. Each list item must implement this method to provider initialization of its own and call- initialize(MLItemProp)- Specified by:
- initializein interface- IContentData<MLItemProp>
- Parameters:
- item- The item.
 
- getLeadingTextColumnprotected int getLeadingTextColumn()Returns the column index for the leading text. Types supporting description text must override this method.- Specified by:
- getLeadingTextColumnin class- MLItem
- Returns:
- The column index, or -1 for none.
 
- getDescriptionColumnprotected int getDescriptionColumn()Returns the column index for the description. Types supporting description text must override this method.- Specified by:
- getDescriptionColumnin class- MLItem
- Returns:
- The column index, or -1 for none.
 
- refreshFromVSpublic void refreshFromVS- (int[] columns) Refreshes contents from VirtualSpace.- Specified by:
- refreshFromVSin interface- IContentData<MLItemProp>
- Specified by:
- refreshFromVSin class- MLItem
- Parameters:
- columns- The connected table columns indicies, -1 for none.
 
- getTrailingTextGets the trailing text for the list item.- Returns:
- The text, or null if none is set.
 
- setTrailingTextSets the trailing text for the list item.- Parameters:
- text- The new text, or null for none.
- Returns:
- true for changed, false for no change.
 
- isTrailingTextOppositeAlignedpublic 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.
 
- setTrailingTextOppositeAlignedpublic 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.
 
- getTrailingTextWrappublic int getTrailingTextWrap()Gets option for trailing text wrap.- Returns:
- The trailing text wrap, multiple(0), single line(1), ellipsis(2).
 
- setTrailingTextWrappublic 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.
 
- setTrailingTextWrapMultiplepublic boolean setTrailingTextWrapMultiple()Sets the option for trailing text wrap to multiple line.- Returns:
- true for changed, false for no change.
 
- setTrailingTextWrapSinglepublic boolean setTrailingTextWrapSingle()Sets the option for trailing text wrap to single line.- Returns:
- true for changed, false for no change.
 
- setTrailingTextWrapEllipsispublic boolean setTrailingTextWrapEllipsis()Sets the option for trailing text wrap to single line.- Returns:
- true for changed, false for no change.
 
- isArrowDisplayedpublic boolean isArrowDisplayed()Returns if the trailing arrow is displayed or not.- Returns:
- true to display arrow, false not to display arrow.
 
- setArrowDisplayedpublic 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.
 
- addListenerAdds 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:
- NullPointerException- If the listener is- null.
 
- removeListenerRemoves an action listener for the arrow.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- onArrowInvokedCalled 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:
- onArrowInvokedin interface- IMLArrowActionListener
- Parameters:
- item- "this" item.