Class NavBarFooterButton
- All Implemented Interfaces:
Clickable<NavBarFooterButton>
NavBar
component’s footer.
You can specify an icon for the component that is to be displayed in the button. You can add any functionality to the button due to its click handler implementation. Also, you can add a popup menu to the button that is displayed to the user when the button is clicked. You can place additional buttons in the popup menu, or items with an image or icon, the click event of which can also be programmed separately. You can thus assign an application logic to each item in the menu system.
Button components are visible markers and you are free to set their color and text. These markers are used to display all sorts of information, e.g. inbox messages or the number of event.
The component is not a standalone component, it is only displayed in the NavBar
.
NavBar
component using the addFooterButton
method.- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddClickHandler
(ClickEventHandler handler) Adds a single click event handler to the component.Adds a double click event handler to the component.Assigns a popup menu to a button.getIcon()
Gets the icon for the button.protected String
Gets the text on the button marker.Sets the button icon.Shows a marker on the button (marker type specified).setMarkerText
(String markerText) Shows a default grey marker on the button.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
-
Constructor Details
-
NavBarFooterButton
Creates a NavBarFooter button component.- Parameters:
icon
- Set the icon that appears on the button. Ifnull
is set, no icon will appear on the button, making the button invisible to the user. For a list of available icons, see theIcon
enum.
-
-
Method Details
-
setIcon
Sets the button icon.- Parameters:
icon
- Button icon Ifnull
is specified, no icon is displayed on the button, making it invisible to users. Available icons are listed in the enumIcon
.- Returns:
- Navbar footer button component
-
getIcon
Gets the icon for the button.- Returns:
- The icon displayed on the button or
null
if no icon is displayed on the button
-
setMarkerText
Shows a default grey marker on the button.- Parameters:
markerText
- Marker text Ifnull
is set, no marker is displayed.- Returns:
- Navbar footer component
-
setMarker
Shows a marker on the button (marker type specified).- Parameters:
markerText
- Marker text Ifnull
is set, no marker is displayed.type
- Marker type (color) Ifnull
is set, the marker type is not modified. A list of types to be used is contained in theBadgeType
enum.- Returns:
- Navbar footer component
-
getMarkerText
Gets the text on the button marker.- Returns:
- Marker text or
null
if there is no marker text or there is no marker assigned to the button
-
addDoubleClickHandler
Adds a double click event handler to the component. This handler runs when the user clicks twice on the component.- Specified by:
addDoubleClickHandler
in interfaceClickable<NavBarFooterButton>
- Parameters:
handler
- ADoubleClickEventHandler
implementation- Returns:
- The component
- See Also:
-
addClickHandler
Adds a single click event handler to the component. This handler runs when the user clicks once on the component.- Specified by:
addClickHandler
in interfaceClickable<NavBarFooterButton>
- Parameters:
handler
- TheClickEventHandler
implementation- Returns:
- The component
- See Also:
-
createPupup
Assigns a popup menu to a button.- Returns:
- An instance of the popup menu created for the button
- See Also:
-
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<NavBarFooterButton>
- Returns:
- If the componentwas drawn,
true
, otherwisefalse
-