Class MultiButton
- All Implemented Interfaces:
Animation, Editable, ActionSource, StyleListener, IconHolder, SelectableIconHolder, TextHolder, Iterable<Component>
A powerful button like component that allows multiple rows/and an icon to be added every row/icon can have its own UIID. Internally the multi-button is a container with a lead component. Up to 4 rows are supported.
MultiButton twoLinesNoIcon = new MultiButton("MultiButton");
twoLinesNoIcon.setTextLine2("Line 2");
MultiButton oneLineIconEmblem = new MultiButton("Icon + Emblem");
oneLineIconEmblem.setIcon(icon);
oneLineIconEmblem.setEmblem(emblem);
MultiButton twoLinesIconEmblem = new MultiButton("Icon + Emblem");
twoLinesIconEmblem.setIcon(icon);
twoLinesIconEmblem.setEmblem(emblem);
twoLinesIconEmblem.setTextLine2("Line 2");
MultiButton twoLinesIconEmblemHorizontal = new MultiButton("Icon + Emblem");
twoLinesIconEmblemHorizontal.setIcon(icon);
twoLinesIconEmblemHorizontal.setEmblem(emblem);
twoLinesIconEmblemHorizontal.setTextLine2("Line 2 Horizontal");
twoLinesIconEmblemHorizontal.setHorizontalLayout(true);
MultiButton twoLinesIconCheckBox = new MultiButton("CheckBox");
twoLinesIconCheckBox.setIcon(icon);
twoLinesIconCheckBox.setCheckBox(true);
twoLinesIconCheckBox.setTextLine2("Line 2");
MultiButton fourLinesIcon = new MultiButton("With Icon");
fourLinesIcon.setIcon(icon);
fourLinesIcon.setTextLine2("Line 2");
fourLinesIcon.setTextLine3("Line 3");
fourLinesIcon.setTextLine4("Line 4");
hi.add(oneLineIconEmblem).
add(twoLinesNoIcon).
add(twoLinesIconEmblem).
add(twoLinesIconEmblemHorizontal).
add(twoLinesIconCheckBox).
add(fourLinesIcon);
-
Field Summary
Fields inherited from class Component
BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor allowing the designer to create an instance of this classMultiButton(String line1) Initializes a multibutton with the first line of text -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an action listenervoidAdds a listener to the pointer eventvoidAdds a listener to the pointer eventvoidAdds a listener to the pointer eventGets a component that can be used for the style of the badge.Gets the text to be used in a badge on this label.Returns the command for the emblemIndicates the icon that is displayed on the button when the button is in the disabled stateReturns the emblem imageReturns the name of the emblemReturns the emblem position based on border layout constraintsReturns the UIID of the EmblemintgetGap()Returns the gap in pixels between the icon/text to the Label boundariesgetGroup()Indicates the group for the radio buttongetIcon()Returns the icon imageAllows us to gain direct access to the icon component so we can set it directly without going via the other methods, this is especially useful for classes such as the ImageDownloadService which can then update the icon seamlessly.Returns the icon for the button based on its current stateReturns the name of the iconReturns the icon position based on border layout constraintsGets the component that should be used for styling material the material icon.Returns the UIID of the IconSet the mask name for the iconReturns the name of the rowReturns the name of the rowReturns the name of the rowReturns the name of the rowIndicates the icon that is displayed on the button when the button is in pressed stateString[]A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder codeClass[]Matches the property names method (see that method for further details).getPropertyValue(String name) Returns the current value of the property name, this method is used by the GUI builderIndicates the icon that is displayed on the button when the button is in rolled over stateIndicates the icon that is displayed on the button when the button is in pressed state and is selected.getText()Returns the line 1 text The text of the componentReturns the content of the rowReturns the content of the rowReturns the content of the rowReturns the content of the rowGets all text in multibutton in a single string delimited by "\n" character.intReturns The position of the text relative to the iconReturns the UIID of the rowReturns the UIID of the rowReturns the UIID of the rowReturns the UIID of the rowbooleanReturns true if this is a checkbox buttonbooleanIndicates whether the first two labels are be side by sidebooleanInverts the order of the first two entries so the second line appears first.booleanIndicates if the lines are grouped together on this buttonbooleanReturns true if this is a radio buttonbooleanReturns true if the checkbox/radio button is selectedbooleanIndicates if text should be localized when set to the component, by default all text is localized so this allows disabling automatic localization for a specific component.voidRemoves an action listenervoidRemoves the listener from the pointer eventvoidRemoves the listener from the pointer eventvoidRemoves the listener from the pointer eventvoidsetBadgeText(String badgeText) Sets the badge text to be used on this label.voidsetBadgeUIID(String badgeUIID) Sets the style that should be used for rendering badges.voidsetCheckBox(boolean b) Turns the multi-button into a checkbox multi-buttonvoidSets the command for the component, it doesn't affevoidsetDisabledIcon(Image arg0) Indicates the icon that is displayed on the button when the button is in the disabled statevoidSets the emblemvoidSets the name of the emblem (important for use in generic renderersvoidSets the emblem position based on border layout constraintsvoidSets the UIID of the emblemvoidsetFontIcon(Font font, char c, float size) This method is shorthand forcom.codename1.ui.Font, char, float)voidsetGap(int gap) Set the gap in pixels between the icon/text to the Label boundariesvoidsetGroup(ButtonGroup bg) Sets the button group for a radio button mode multibuttonvoidIndicates the group for the radio buttonvoidsetHorizontalLayout(boolean b) Indicates the first two labels should be side by sidevoidSets the iconvoidSets the name of the icon (important for use in generic renderersvoidSets the icon position based on border layout constraintsvoidSets the UIID of the iconvoidsetInvertFirstTwoEntries(boolean b) Inverts the order of the first two entries so the second line appears first.voidsetLinesTogetherMode(boolean l) Changes the layout so the lines of the button are grouped togethervoidsetMaskName(String maskName) The mask name for the iconvoidsetMaterialIcon(char c, float size) This method is shorthand forchar, float)voidSets the name of the row (important for use in generic renderers)voidSets the name of the row (important for use in generic renderersvoidSets the name of the row (important for use in generic renderersvoidSets the name of the row (important for use in generic renderersvoidsetPressedIcon(Image arg0) Indicates the icon that is displayed on the button when the button is in pressed statesetPropertyValue(String name, Object value) Sets a new value to the given property, returns an error message if failed and null if successful.voidsetRadioButton(boolean b) Turns the multi-button into a radio multi-buttonvoidsetRolloverIcon(Image arg0) Indicates the icon that is displayed on the button when the button is in rolled over statevoidIndicates the icon that is displayed on the button when the button is in pressed state and is selected.voidsetSelected(boolean b) Toggles the selected state for the radio button/check box modesvoidsetShouldLocalize(boolean shouldLocalize) Indicates if text should be localized when set to the component, by default all text is localized so this allows disabling automatic localization for a specific component.voidSets the line 1 text New text for the componentvoidSets the content of the rowvoidSets the content of the rowvoidSets the content of the rowvoidSets the content of the rowvoidsetTextLines(String text) Sets textLine1, textLine2, textLine3, and textLine4 in single method with single string using "\n" as a delimiter.voidsetTextPosition(int textPosition) Sets the position of the text relative to the icon if existsvoidSets the UIID of the rowvoidSets the UIID of the rowvoidSets the UIID of the rowvoidSets the UIID of the rowMethods inherited from class Container
add, add, add, add, add, add, addAll, addComponent, addComponent, addComponent, addComponent, animateHierarchy, animateHierarchyAndWait, animateHierarchyFade, animateHierarchyFadeAndWait, animateLayout, animateLayoutAndWait, animateLayoutFade, animateLayoutFadeAndWait, animateUnlayout, animateUnlayoutAndWait, applyRTL, calcPreferredSize, cancelRepaints, clearClientProperties, constrainHeightWhenScrollable, constrainWidthWhenScrollable, contains, createAnimateHierarchy, createAnimateHierarchyFade, createAnimateLayout, createAnimateLayoutFade, createAnimateLayoutFadeAndWait, createAnimateMotion, createAnimateUnlayout, createReplaceTransition, dragInitiated, drop, encloseIn, encloseIn, findDropTargetAt, findFirstFocusable, fireClicked, flushReplace, forceRevalidate, getBottomGap, getChildrenAsList, getClosestComponentTo, getComponentAt, getComponentAt, getComponentCount, getComponentIndex, getGridPosX, getGridPosY, getLayout, getLayoutHeight, getLayoutWidth, getLeadComponent, getLeadParent, getResponderAt, getSafeAreaRoot, getScrollIncrement, getSideGap, getUIManager, initLaf, invalidate, isEnabled, isSafeArea, isSafeAreaRoot, isScrollableX, isScrollableY, isSelectableInteraction, isSurface, iterator, iterator, keyPressed, keyReleased, layoutContainer, morph, morphAndWait, paint, paintComponentBackground, paintGlass, paramString, pointerPressed, refreshTheme, removeAll, removeComponent, replace, replace, replaceAndWait, replaceAndWait, replaceAndWait, revalidate, revalidateLater, revalidateWithAnimationSafety, scrollComponentToVisible, setCellRenderer, setEnabled, setLayout, setLeadComponent, setSafeArea, setSafeAreaRoot, setScrollable, setScrollableX, setScrollableY, setScrollIncrement, setShouldCalcPreferredSize, setShouldLayout, setUIManager, updateTabIndicesMethods inherited from class Component
addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addPointerDraggedListener, addPullToRefresh, addScrollListener, addStateChangeListener, animate, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, contains, containsOrOwns, createStyleAnimation, deinitialize, deinitializeCustomStyle, dragEnter, dragExit, dragFinished, draggingOver, drawDraggedImage, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAccessibilityText, getAllStyles, getAnimationManager, getBaseline, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragRegionStatus, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyTypeNames, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedRect, getSelectedStyle, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getUIID, getUnselectedStyle, getVisibleBounds, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initComponent, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isIgnorePointerEvents, isInClippingRegion, isInitialized, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, keyRepeated, laidOut, longKeyPress, longPointerPress, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerDragged, pointerHover, pointerHoverPressed, pointerHoverReleased, pointerPressed, pointerReleased, pointerReleased, putClientProperty, refreshTheme, refreshTheme, remove, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removePointerDraggedListener, removeScrollListener, removeStateChangeListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, scrollRectToVisible, scrollRectToVisible, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHandlesInput, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIID, setUIIDFinal, setUnselectedStyle, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContainsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
MultiButton
Initializes a multibutton with the first line of text
Parameters
line1: first line of text
-
MultiButton
public MultiButton()Default constructor allowing the designer to create an instance of this class
-
-
Method Details
-
isLinesTogetherMode
public boolean isLinesTogetherMode()Indicates if the lines are grouped together on this button -
setLinesTogetherMode
public void setLinesTogetherMode(boolean l) Changes the layout so the lines of the button are grouped together
Parameters
l: true to group the lines together
-
getIconComponent
Allows us to gain direct access to the icon component so we can set it directly without going via the other methods, this is especially useful for classes such as the ImageDownloadService which can then update the icon seamlessly.
Returns
the component used internally to represent the icon
-
addActionListener
Adds an action listener
Parameters
al: the action listener
- Specified by:
addActionListenerin interfaceActionSource
-
removeActionListener
Removes an action listener
Parameters
al: the action listener
- Specified by:
removeActionListenerin interfaceActionSource
-
addLongPressListener
Adds a listener to the pointer event
Parameters
l: callback to receive pointer events
Since
7.0
Parameters
l
- Overrides:
addLongPressListenerin classComponent
-
removeLongPressListener
Removes the listener from the pointer event
Parameters
l: callback to remove
Since
7.0
Parameters
l
- Overrides:
removeLongPressListenerin classComponent
-
addPointerPressedListener
Adds a listener to the pointer event
Parameters
l: callback to receive pointer events
Parameters
l
- Overrides:
addPointerPressedListenerin classComponent
-
removePointerPressedListener
Removes the listener from the pointer event
Parameters
l: callback to remove
Parameters
l
- Overrides:
removePointerPressedListenerin classComponent
-
addPointerReleasedListener
Adds a listener to the pointer event
Parameters
l: callback to receive pointer events
Parameters
l
- Overrides:
addPointerReleasedListenerin classComponent
-
removePointerReleasedListener
Removes the listener from the pointer event
Parameters
l: callback to remove
Parameters
l
- Overrides:
removePointerReleasedListenerin classComponent
-
getCommand
Returns the command for the emblem
Returns
the command instance
-
setCommand
Sets the command for the component, it doesn't affe
Parameters
c: the command
-
isCheckBox
public boolean isCheckBox()Returns true if this is a checkbox button
Returns
true for a checkbox button
-
setCheckBox
public void setCheckBox(boolean b) Turns the multi-button into a checkbox multi-button
Parameters
b: true for a checkbox multi-button
-
isRadioButton
public boolean isRadioButton()Returns true if this is a radio button
Returns
true for a radio button
-
setRadioButton
public void setRadioButton(boolean b) Turns the multi-button into a radio multi-button
Parameters
b: true for a radio multi-button
-
isSelected
public boolean isSelected()Returns true if the checkbox/radio button is selected
Returns
true if the checkbox/radio button is selected
-
setSelected
public void setSelected(boolean b) Toggles the selected state for the radio button/check box modes
Parameters
b: true for checked false for unchecked
-
isHorizontalLayout
public boolean isHorizontalLayout()Indicates whether the first two labels are be side by side
Returns
true if the first two labels are side by side
-
setHorizontalLayout
public void setHorizontalLayout(boolean b) Indicates the first two labels should be side by side
Parameters
b: true to place the first two labels side by side
-
isInvertFirstTwoEntries
public boolean isInvertFirstTwoEntries()Inverts the order of the first two entries so the second line appears first. This only works in horizontal mode!
Returns
true when the second row entry should be placed before the first entry
-
setInvertFirstTwoEntries
public void setInvertFirstTwoEntries(boolean b) Inverts the order of the first two entries so the second line appears first. This only works in horizontal mode!
Parameters
b: true to place the second row entry as the first entry
-
getTextLine1
Returns the content of the row
Returns
the text
-
setTextLine1
Sets the content of the row
Parameters
t: text to set
-
getNameLine1
Returns the name of the row
Returns
the name
-
setNameLine1
Sets the name of the row (important for use in generic renderers)
Parameters
t: name to set
-
getUIIDLine1
Returns the UIID of the row
Returns
the UIID
-
setUIIDLine1
Sets the UIID of the row
Parameters
t: UIID to set
-
getTextLine2
Returns the content of the row
Returns
the text
-
setTextLine2
Sets the content of the row
Parameters
t: text to set
-
getNameLine2
Returns the name of the row
Returns
the name
-
setNameLine2
Sets the name of the row (important for use in generic renderers
Parameters
t: name to set
-
getUIIDLine2
Returns the UIID of the row
Returns
the UIID
-
setUIIDLine2
Sets the UIID of the row
Parameters
t: UIID to set
-
getTextLine3
Returns the content of the row
Returns
the text
-
setTextLine3
Sets the content of the row
Parameters
t: text to set
-
getNameLine3
Returns the name of the row
Returns
the name
-
setNameLine3
Sets the name of the row (important for use in generic renderers
Parameters
t: name to set
-
getUIIDLine3
Returns the UIID of the row
Returns
the UIID
-
setUIIDLine3
Sets the UIID of the row
Parameters
t: UIID to set
-
getTextLine4
Returns the content of the row
Returns
the text
-
setTextLine4
Sets the content of the row
Parameters
t: text to set
-
getNameLine4
Returns the name of the row
Returns
the name
-
setNameLine4
Sets the name of the row (important for use in generic renderers
Parameters
t: name to set
-
getUIIDLine4
Returns the UIID of the row
Returns
the UIID
-
setUIIDLine4
Sets the UIID of the row
Parameters
t: UIID to set
-
getIcon
Returns the icon image
Returns
the image instance
- Specified by:
getIconin interfaceIconHolder
-
setIcon
Sets the icon
Parameters
i: the icon
- Specified by:
setIconin interfaceIconHolder
-
getEmblem
Returns the emblem image
Returns
the image instance
-
setEmblem
Sets the emblem
Parameters
i: the icon
-
getIconPosition
Returns the icon position based on border layout constraints
Returns
position either North/South/East/West
-
setIconPosition
Sets the icon position based on border layout constraints
Parameters
t: position either North/South/East/West
-
getEmblemPosition
Returns the emblem position based on border layout constraints
Returns
position either North/South/East/West
-
setEmblemPosition
Sets the emblem position based on border layout constraints
Parameters
t: position either North/South/East/West
-
getIconName
Returns the name of the icon
Returns
the name
-
setIconName
Sets the name of the icon (important for use in generic renderers
Parameters
t: name to set
-
getIconUIID
Returns the UIID of the Icon
Returns
the UIID
- Specified by:
getIconUIIDin interfaceIconHolder
-
setIconUIID
Sets the UIID of the icon
Parameters
t: UIID to set
- Specified by:
setIconUIIDin interfaceIconHolder
-
getEmblemName
Returns the name of the emblem
Returns
the name
-
setEmblemName
Sets the name of the emblem (important for use in generic renderers
Parameters
t: name to set
-
getEmblemUIID
Returns the UIID of the Emblem
Returns
the UIID
-
setEmblemUIID
Sets the UIID of the emblem
Parameters
t: UIID to set
-
getTextLines
Gets all text in multibutton in a single string delimited by "\n" character.
Returns
String with textLine1 to textLine4 delimited by "\n"
Since
8.0
-
setTextLines
Sets textLine1, textLine2, textLine3, and textLine4 in single method with single string using "\n" as a delimiter.
Parameters
text: The text to set.
Since
8.0
-
getText
Returns the line 1 text
The text of the component
Returns
the text
- Specified by:
getTextin interfaceTextHolder
-
setText
Sets the line 1 text
New text for the component
Parameters
text: the text
- Specified by:
setTextin interfaceTextHolder
-
getPropertyNames
A component may expose mutable property names for a UI designer to manipulate, this API is designed for usage internally by the GUI builder code
Returns
the property names allowing mutation
- Overrides:
getPropertyNamesin classComponent
-
getPropertyTypes
Matches the property names method (see that method for further details).
Returns
the types of the properties
- Overrides:
getPropertyTypesin classComponent
-
getPropertyValue
Returns the current value of the property name, this method is used by the GUI builder
Parameters
name: the name of the property
Returns
the value of said property
- Overrides:
getPropertyValuein classComponent
-
setPropertyValue
Sets a new value to the given property, returns an error message if failed and null if successful. Notice that some builtin properties such as "$designMode" might be sent to components to indicate application state.
Parameters
-
name: the name of the property -
value: new value for the property
Returns
error message or null
- Overrides:
setPropertyValuein classComponent
-
-
getGroup
Indicates the group for the radio button
Returns
the group
-
setGroup
Indicates the group for the radio button
Parameters
group: the group to set
-
setGroup
Sets the button group for a radio button mode multibutton
Parameters
bg: the button group
-
getMaskName
Set the mask name for the icon
Returns
the maskName
-
setMaskName
The mask name for the icon
Parameters
maskName: the maskName to set
-
isShouldLocalize
public boolean isShouldLocalize()Indicates if text should be localized when set to the component, by default all text is localized so this allows disabling automatic localization for a specific component.
Returns
the shouldLocalize value
-
setShouldLocalize
public void setShouldLocalize(boolean shouldLocalize) Indicates if text should be localized when set to the component, by default all text is localized so this allows disabling automatic localization for a specific component.
Parameters
shouldLocalize: the shouldLocalize to set
-
getGap
public int getGap()Returns the gap in pixels between the icon/text to the Label boundaries
Returns
the gap in pixels between the icon/text to the Label boundaries
Since
7.0
- Specified by:
getGapin interfaceIconHolder
-
setGap
public void setGap(int gap) Set the gap in pixels between the icon/text to the Label boundaries
Parameters
gap: the gap in pixels
Since
7.0
- Specified by:
setGapin interfaceIconHolder
-
getTextPosition
public int getTextPosition()Returns The position of the text relative to the icon
Returns
The position of the text relative to the icon, one of: LEFT, RIGHT, BOTTOM, TOP
See also
-
#LEFT
-
#RIGHT
-
#BOTTOM
-
#TOP
Since
7.0
- Specified by:
getTextPositionin interfaceIconHolder
-
-
setTextPosition
public void setTextPosition(int textPosition) Sets the position of the text relative to the icon if exists
Parameters
textPosition: alignment value (LEFT, RIGHT, BOTTOM or TOP)
See also
-
#LEFT
-
#RIGHT
-
#BOTTOM
-
#TOP
Since
7.0
- Specified by:
setTextPositionin interfaceIconHolder
-
getIconStyleComponent
Gets the component that should be used for styling material the material icon. If
#setIconUIID(java.lang.String)has been used to set a custom UIID for the icon, then this will return a component with that UIID. Otherwise this will just return this component itself.Returns
The component to use for styling the material icon.
Since
7.0
Since
7.0
- Specified by:
getIconStyleComponentin interfaceIconHolder
-
setMaterialIcon
public void setMaterialIcon(char c, float size) This method is shorthand for
char, float)Parameters
-
c: one of the constants fromcom.codename1.ui.FontImage -
size: the size of the icon in millimeters
Since
8.0
Since
8.0
- Specified by:
setMaterialIconin interfaceIconHolder
-
-
setFontIcon
This method is shorthand for
com.codename1.ui.Font, char, float)Parameters
-
c: one of the constants from the font -
size: the size of the icon in millimeters
Since
8.0
Since
8.0
- Specified by:
setFontIconin interfaceIconHolder
-
-
getRolloverIcon
Indicates the icon that is displayed on the button when the button is in rolled over state
Returns
icon used
See also
- Button#STATE_ROLLOVER
Since
7.0
- Specified by:
getRolloverIconin interfaceSelectableIconHolder
-
setRolloverIcon
Indicates the icon that is displayed on the button when the button is in rolled over state
Parameters
rolloverIcon: icon to use
See also
- Button#STATE_ROLLOVER
Since
7.0
- Specified by:
setRolloverIconin interfaceSelectableIconHolder
-
getPressedIcon
Indicates the icon that is displayed on the button when the button is in pressed state
Returns
icon used
See also
- Button#STATE_PRESSED
Since
7.0
- Specified by:
getPressedIconin interfaceSelectableIconHolder
-
setPressedIcon
Indicates the icon that is displayed on the button when the button is in pressed state
Parameters
pressedIcon: icon used
See also
- Button#STATE_PRESSED
Since
7.0
- Specified by:
setPressedIconin interfaceSelectableIconHolder
-
getDisabledIcon
Indicates the icon that is displayed on the button when the button is in the disabled state
Returns
icon used
Since
7.0
- Specified by:
getDisabledIconin interfaceSelectableIconHolder
-
setDisabledIcon
Indicates the icon that is displayed on the button when the button is in the disabled state
Parameters
disabledIcon: icon used
Since
7.0
- Specified by:
setDisabledIconin interfaceSelectableIconHolder
-
getRolloverPressedIcon
Indicates the icon that is displayed on the button when the button is in pressed state and is selected. This is ONLY applicable to toggle buttons
Returns
icon used
Since
7.0
- Specified by:
getRolloverPressedIconin interfaceSelectableIconHolder
-
setRolloverPressedIcon
Indicates the icon that is displayed on the button when the button is in pressed state and is selected. This is ONLY applicable to toggle buttons
Parameters
rolloverPressedIcon: icon used
Since
7.0
- Specified by:
setRolloverPressedIconin interfaceSelectableIconHolder
-
getIconFromState
Returns the icon for the button based on its current state
Returns
the button icon based on its current state
Since
7.0
- Specified by:
getIconFromStatein interfaceSelectableIconHolder
-
getBadgeText
Gets the text to be used in a badge on this label.
Returns
the badge text to be used on this label. May return if no text is set.
Since
8.0
See also
-
#setBadgeText(java.lang.String)
-
#setBadgeUIID(java.lang.String)
-
#getBadgeStyleComponent()
-
-
setBadgeText
Sets the badge text to be used on this label. Badges are rendered in the upper right corner of the label inside round border. The style of the badge can be configured using
#setBadgeUIID(java.lang.String), but the default style uses the "Badge" UIID, which, by default, uses white text on a red round border background.Parameters
badgeText: @param badgeText The text to include in the badge. null or empty strings will result in the badge not being rendered.
Since
8.0
See also
-
#getBadgeText()
-
#getBadgeStyleComponent()
-
#setBadgeUIID(java.lang.String)
-
setBadgeUIID
Sets the style that should be used for rendering badges. By default it will use the "Badge" UIID, which rendered 1.5mm white text on a red round border.
Parameters
badgeUIID: The UIID to use for the badge.
Since
8.0
See also
-
#setBadgeText(java.lang.String)
-
#getBadgeStyleComponent()
-
getBadgeStyleComponent
Gets a component that can be used for the style of the badge.
Returns
The component whose style can be used to style the badge. May return null if none set.
Since
8.0
See also
-
#setBadgeText(java.lang.String)
-
#setBadgeUIID(java.lang.String)
-
#getBadgeText()
-
-