Class MLItem
- All Implemented Interfaces:
- IContentData<MLItemProp>
- Direct Known Subclasses:
- MLCheckBox,- MLComboBox,- MLDateTime,- MLRadioButton,- MLSimple,- MLSlider,- MLSpinner,- MLSwitch,- MLText
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- protected static final intFirst column index for subclasses.- static final StringProperty name: action support "action".- static final StringProperty name: animation value.- static final StringProperty name: description text "$descr".- static final StringProperty name: icon "$icon".- static final StringProperty name: icon margins.- static final StringProperty name: leading text "$text".- static final StringProperty name: leading width "cx".- static final StringProperty name: leading wrap "lw".- static final StringProperty name: VSField description text "V_$descr".- static final StringProperty name: VSField leading text "V_$text".- static final StringProperty name: VS focus reference.
- Method SummaryModifier and TypeMethodDescription- void- addMappings- (VSMappings mappings, String uiRef, MLItemProp item) Adds the mappings of a VirtualSpace to the panel components.- protected booleanReturns if the selection property is a boolean value and a BoolProp is used to set the selection state that can be on/off or 1/0 only (2 = third state is not allowed).Gets the context menu assigned to the list item.- protected abstract intReturns the column index for the description.- getGroup()Gets the group associated with this item.- getIcon()Gets the image assigned as the icon for the list item.- GUnit[]Gets the margins for the icon.Returns the item property assigned for this instance.Gets the leading text for the list item.- protected abstract intReturns the column index for the leading text.- intGets option for leading text wrap.Gets the width of leading text.- protected StringReturns the IntProp property name used to set the selection to.- intGets the selection state.- abstract MLItemType- getType()Gets the type of the list item.- getVSRow()Gets the associated VSRow for this item.- booleanReturns if the list item has action support or not.- booleanGets the enabled state.- booleanGets the read-only state.- booleanGets the selection state of the item.- booleanGets the visibility state.- abstract void- refreshFromVS- (int[] columns) Refreshes contents from VirtualSpace.- boolean- setActionSupport- (boolean newState) Sets the action support state, i.e.- boolean- setContextMenu- (UIContextMenu contextMenu) Sets the context menu to use for the item.- boolean- setDescription- (KString descr) Sets the text for the list item.- boolean- setEnabled- (boolean newState) Gets the enabled state.- boolean- setIcon- (IImageTarget image) Sets the image assigned as the icon for the list item.- boolean- setIconMargins- (GUnit[] margins) Sets the icon margins.- boolean- setIconPadding- (GUnit margin) Sets the icon margin.- boolean- setLeadingText- (KString text) Sets the leading text for the list item.- booleanSets the option for leading text to single line with ellipsis when text overflows.- booleanSets the option for leading text to single line, truncated.- booleanSets the option for leading text to wrap over multiple line.- boolean- setLeadingTextWrap- (int opt) Sets the option for leading text wrap.- boolean- setLeadingWidth- (GUnit width) Gets the width of leading text.- boolean- setReadOnly- (boolean newState) Gets the read-only state.- boolean- setSelected- (int state) Sets the selection state: 0=unselected, 1=selected, 2=third state.- setSelection- (boolean on) Sets the selection state of an item.- setSelectionInternal- (boolean on) Internal method to sets the selection state of an item.- boolean- setVisible- (boolean newState) Gets the visibility state.- Methods inherited from class java.lang.Object- clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait- Methods inherited from interface com.iizix.prop.content.IContentData- initialize
- Field Details- PN_ICONProperty name: icon "$icon".- See Also:
 
- PN_LEADING_TEXTProperty name: leading text "$text".- See Also:
 
- PN_V_LEADING_TEXTProperty name: VSField leading text "V_$text".- See Also:
 
- PN_LEADING_WIDTHProperty name: leading width "cx".- See Also:
 
- PN_LEADING_WRAPProperty name: leading wrap "lw".- See Also:
 
- PN_DESCRIPTIONProperty name: description text "$descr".- See Also:
 
- PN_V_DESCRIPTIONProperty name: VSField description text "V_$descr".- See Also:
 
- PN_ACTIONProperty name: action support "action".- See Also:
 
- PN_ANIMATIONProperty name: animation value.- See Also:
 
- PN_VS_FOCUSProperty name: VS focus reference.- See Also:
 
- PN_ICON_MARGINSProperty name: icon margins.- See Also:
 
- FIRST_COLUMN_INDEXprotected static final int FIRST_COLUMN_INDEXFirst column index for subclasses.- See Also:
 
 
- Method Details- getItemPropReturns the item property assigned for this instance.- If the property is disposed, it is unassigned. - Specified by:
- getItemPropin interface- IContentData<MLItemProp>
- Returns:
- The property instance.
 
- getGroupGets the group associated with this item.- Returns:
- The group if a property item is associated and not disposed of, null otherwise.
 
- getTypeGets the type of the list item.- Returns:
- The type.
 
- getLeadingTextColumnprotected abstract int getLeadingTextColumn()Returns the column index for the leading text. Types supporting description text must override this method.- Returns:
- The column index, or -1 for none.
 
- getDescriptionColumnprotected abstract int getDescriptionColumn()Returns the column index for the description. Types supporting description text must override this method.- Returns:
- The column index, or -1 for none.
 
- refreshFromVSpublic abstract void refreshFromVS- (int[] columns) Refreshes contents from VirtualSpace.- Specified by:
- refreshFromVSin interface- IContentData<MLItemProp>
- Parameters:
- columns- The connected table columns indicies, -1 for none.
 
- getVSRowGets the associated VSRow for this item.- Specified by:
- getVSRowin interface- IContentData<MLItemProp>
- Returns:
- The row, or null if not associated with VirtualSpace.
 
- isVisiblepublic boolean isVisible()Gets the visibility state.- This is the items individual state and does not take parent states into account. - Returns:
- true for visible, false for hidden.
 
- isEnabledpublic boolean isEnabled()Gets the enabled state.- This is the items individual state and does not take parent states into account. - Returns:
- true for enabled, false for disabled.
 
- isReadOnlypublic boolean isReadOnly()Gets the read-only state.- This is the items individual state and does not take parent states into account. - Returns:
- true for read-only, false otherwise.
 
- isSelectedpublic boolean isSelected()Gets the selection state of the item.- Specified by:
- isSelectedin interface- IContentData<MLItemProp>
- Returns:
- The selected state.
 
- hasActionSupportpublic boolean hasActionSupport()Returns if the list item has action support or not.- Returns:
- true for action support (default) or not.
 
- getSelectionStatepublic int getSelectionState()Gets the selection state.- Returns:
- 0=unselected, 1=selected, 2=third state (when applicable).
 
- setVisiblepublic boolean setVisible- (boolean newState) Gets the visibility state.- This is the items individual state and does not take parent states into account. - Parameters:
- newState- The new state: true for visible, false for hidden.
- Returns:
- true for changed state, false for no change.
 
- setEnabledpublic boolean setEnabled- (boolean newState) Gets the enabled state.- This is the items individual state and does not take parent states into account. - Parameters:
- newState- The new state: true for enabled, false for disabled.
- Returns:
- true for changed state, false for no change.
 
- setReadOnlypublic boolean setReadOnly- (boolean newState) Gets the read-only state.- This is the items individual state and does not take parent states into account. - Parameters:
- newState- The new state: true for read-only, false otherwise.
- Returns:
- true for changed state, false for no change.
 
- setActionSupportpublic boolean setActionSupport- (boolean newState) Sets the action support state, i.e. if the user can touch-click the item and cause an action even when no arrows are present.- Parameters:
- newState- The new action enabled state.
- Returns:
- true for changed state, false for no change.
 
- setSelectionSets the selection state of an item.- Specified by:
- setSelectionin interface- IContentData<MLItemProp>
- Parameters:
- on- The new selection state.
- Returns:
- null for success, otherwise an error message why the selection failed.
 
- setSelectedpublic boolean setSelected- (int state) Sets the selection state: 0=unselected, 1=selected, 2=third state.- Parameters:
- state- The state.
- Returns:
- true for state changed, false for no change.
- Throws:
- IllegalArgumentException- If the component doesn't support third state and state==2.
 
- setSelectionInternalInternal method to sets the selection state of an item. This method is not intended to be called as it is used by the framework and will not cause a callback or event notification of selection changes.- Specified by:
- setSelectionInternalin interface- IContentData<MLItemProp>
- Parameters:
- on- The new selection state.
- Returns:
- null for success, empty string for no change, otherwise an error message why the selection failed.
 
- getSelectionPropNameReturns the IntProp property name used to set the selection to.- Returns:
- The selection property name, or null if not supported (default). Override this method to return the appropriate name when supported.
 
- doBooleanSelectionOnlyprotected boolean doBooleanSelectionOnly()Returns if the selection property is a boolean value and a BoolProp is used to set the selection state that can be on/off or 1/0 only (2 = third state is not allowed).- Returns:
- true To use BoolProp for selection and throw error for third state (2) selection value, false for checkboxes that use an IntProp for selection and supports third state.
 
- getLeadingTextGets the leading text for the list item.- Returns:
- The text, or null if none is set.
 
- setLeadingTextSets the leading text for the list item.- Parameters:
- text- The new text, or null for none.
- Returns:
- true for changed, false for no change.
 
- setDescriptionSets the text for the list item.- Parameters:
- descr- The new description string, or null for none.
- Returns:
- true for changed, false for no change.
 
- getLeadingWidthGets the width of leading text.- Returns:
- The width, or null for none.
 
- setLeadingWidthGets the width of leading text. The width must be Strict CSS and may not be a percent value or a formula.- Parameters:
- width- The width, or null for to clear it.
- Returns:
- true for changed, false for no change.
- Throws:
- IllegalArgumentException- If the width is a formula or percent value.
 
- getLeadingTextWrappublic int getLeadingTextWrap()Gets option for leading text wrap.- Returns:
- The leading text wrap, multiple(0), single line(1), ellipsis(2).
 
- setLeadingTextWrappublic boolean setLeadingTextWrap- (int opt) Sets the option for leading text wrap.- Parameters:
- opt- The wrap option:
 0 = wrap over multiple lines,
 1 = truncated to single line, or
 2 = ellipsis when single line overflows.
- Returns:
- true for changed, false for no change.
- Throws:
- IllegalArgumentException- If opt is not 0-2.
 
- setLeadingTextWrappublic boolean setLeadingTextWrap()Sets the option for leading text to wrap over multiple line.- Returns:
- true for changed, false for no change.
 
- setLeadingTextSingleLinepublic boolean setLeadingTextSingleLine()Sets the option for leading text to single line, truncated.- Returns:
- true for changed, false for no change.
 
- setLeadingTextEllipsispublic boolean setLeadingTextEllipsis()Sets the option for leading text to single line with ellipsis when text overflows.- Returns:
- true for changed, false for no change.
 
- getIconGets the image assigned as the icon for the list item.- Returns:
- The image instance, or null for none.
 
- setIconSets the image assigned as the icon for the list item.- Parameters:
- image- The image instance, or null for none.
- Returns:
- true for changed, false for no changes.
- Throws:
- IllegalArgumentException- If the image target is not valid.
 
- setIconPaddingSets the icon margin. All margins top/right/bottom/left are affected and set or cleared.- Parameters:
- margin- The margin, null to remove it.
- Returns:
- true for changed, false for no change.
 
- setIconMarginsSets the icon margins.- Parameters:
- margins- The margins, null to remove them.- The indicies in the array are: - [0] top
- [1] right
- [2] bottom
- [3] left
 - Any entry may be null where this means it is not defined. All entries set to null is the same as passing null as parameter. 
- Returns:
- true for changed, false for no change.
- Throws:
- IllegalArgumentException- If the array is not of length 4.
 
- getIconMarginsGets the margins for the icon.- Returns:
- The margins, null for none, otherwise an array of 4 values where a null value means it is not set.The indicies in the array are: - [0] top
- [1] right
- [2] bottom
- [3] left
 
 
- getContextMenuGets the context menu assigned to the list item.- Returns:
- The context menu, or null for none.
 
- setContextMenuSets the context menu to use for the item.- Parameters:
- contextMenu- The context menu, or null to remove it.
- Returns:
- true for changed, false for no change.
 
- addMappingsAdds the mappings of a VirtualSpace to the panel components.- The default is to find the relative references to VS and add those references. Override to provide other functionality. - Specified by:
- addMappingsin interface- IContentData<MLItemProp>
- Parameters:
- mappings- The mappings instance to fill in.
- uiRef- The reference.
- item- The item property.