Package com.jbstrap.ui.components.button
Class DropDownButton.DropDownMenuItem
java.lang.Object
com.jbstrap.core.messagebus.MessageBus
com.jbstrap.ui.Component<DropDownButton.DropDownMenuItem>
com.jbstrap.ui.components.button.DropDownButton.DropDownMenuItem
- All Implemented Interfaces:
Clickable<DropDownButton.DropDownMenuItem>
,HandleHotKey<DropDownButton.DropDownMenuItem>
- Enclosing class:
- DropDownButton
public class DropDownButton.DropDownMenuItem
extends Component<DropDownButton.DropDownMenuItem>
implements Clickable<DropDownButton.DropDownMenuItem>, HandleHotKey<DropDownButton.DropDownMenuItem>
Dropdown menu item.
- Since:
- 4.0
- Author:
- JBStrap
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Method Summary
Modifier and TypeMethodDescriptiongetIcon()
Gets the menu item icon.getText()
Gets the menu item text.boolean
isActive()
Checks whether the menu item is active.setActive
(boolean active) Sets the menu item icon.Sets the menu item icon.Sets the menu item text.boolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, afterDraw, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getLanguageCode, getName, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, init, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, onShow, openTag, redraw, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEnabled, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setMargin, setName, setOverflow, setPadding, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setVisible, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.HandleHotKey
addHotKey, addHotKey, removeHotKey, removeHotKeys
-
Method Details
-
setText
Sets the menu item text.- Parameters:
text
- Menu item text Ifnull
is specified, no text appears on the menu item.- Returns:
- Menu item component
-
getText
Gets the menu item text.- Returns:
- Menu item text or
null
, if no text is associated with the menu item
-
setIcon
Sets the menu item icon.- Parameters:
icon
- Menu item icon Ifnull
is specified, no icon is displayed on the menu item. Available icons are listed in the enumIcon
.- Returns:
- Menu item component
-
getIcon
Gets the menu item icon.- Returns:
- Menu item icon or
null
, if no icon is associated with the menu item
-
setActive
Sets the menu item icon.- Parameters:
active
- Iftrue
is specified, the menu item is displayed as active Iffalse
, it is displayed as not selected.- Returns:
- Menu item component
-
isActive
public boolean isActive()Checks whether the menu item is active.- Returns:
- If
true
, the menu item is active, otherwise it is not selected
-
writeHTML
Description copied from class:Component
Creates the component's HTML equivalentThis method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (
StringWriter
class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return withfalse
. Otherwise, it must return withtrue
.- Specified by:
writeHTML
in classComponent<DropDownButton.DropDownMenuItem>
- Returns:
- If the componentwas drawn,
true
, otherwisefalse
-