Class IBox
- All Implemented Interfaces:
Animatable<IBox>
,CanDrop<IBox>
,Clickable<IBox>
,Draggable<IBox>
,HandleMouseEvents<IBox>
,Scrollable<IBox>
,Touchable<IBox>
IBox component
The component displays a box with a header. The box can have other components inside it. The box and the header will be white, thus the components will be grouped. The ibox can be a simple box, or a collapsible box. If set to be collapsible, an icon will appear on the right side of the header, that when clicked on, opens/closes the box. If a box is closed, the box will have the size of the header height, thus freeing space on the interface.
Component(s) can be placed on the IBox header, thus allowing the placement of additional buttons, icons, that can have custom functionalities.
Supported events:
AnimationStart
AnimationEnd
,
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
Scrollable
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
- 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddComponent
(Component<?> component) Adds the specified component as a subcomponent, and redraws the component immediatelyaddTitleComponent
(Component<?> component) Adds a component to the IBox headerremoveComponent
(Component<?> component) Removes the specified subcomponent.removeTitleComponent
(Component<?> component) Removes the component from the headersetCollapseIcon
(Icon icon) Sets the A IBox collapse iconsetCollapsible
(boolean collapsible) Sets the collapsibility of the IBox.Sets the IBox header titleboolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, 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, 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.Animatable
addAnimationEndHandler, addAnimationStartHandler, getAnimation, removeAnimation, setAnimation
Methods inherited from interface com.jbstrap.ui.CanDrop
addDropEventHandler
Methods inherited from interface com.jbstrap.ui.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.HandleMouseEvents
addMouseDownHandler, addMouseEnterHandler, addMouseLeaveHandler, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler
Methods inherited from interface com.jbstrap.ui.Scrollable
addScrollHandler
Methods inherited from interface com.jbstrap.ui.Touchable
addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler
-
Constructor Details
-
IBox
public IBox()Creates an empty IBox component -
IBox
Creates an empty IBox component with the specified ID- Parameters:
id
- The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
-
IBox
public IBox(boolean showHeader) Creates an empty IBox component, with an optional header. By default, the header is visible- Parameters:
showHeader
- Determines if the header is shown. Iftrue
it is shown. Default totrue
.
-
IBox
Creates an empty IBox component, with an optional header. By default, the header is visible- Parameters:
id
- The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)showHeader
- Determines if the header is shown. Iftrue
it is shown. Default totrue
.
-
-
Method Details
-
setCollapsible
Sets the collapsibility of the IBox. By default, it is not collapsible.- Parameters:
collapsible
- Iftrue
the component will be collapsible. By default, the component is not collapsible.- Returns:
- The IBox component
-
setCollapseIcon
Sets the A IBox collapse icon- Parameters:
icon
- The icon that will be on the header, that when clicked on, the IBox will collapse. The default value is Icon.CHEVRON_UP For the other icons, see theIcon
enum.- Returns:
- The IBox component
-
setTitle
Sets the IBox header title- Parameters:
title
- The IBox header title- Returns:
- The IBox component
-
addTitleComponent
Adds a component to the IBox header- Parameters:
component
- The component to be added to the header- Returns:
- The IBox component
-
removeTitleComponent
Removes the component from the header- Parameters:
component
- The component to be removed- Returns:
- The IBox component
-
addComponent
Description copied from class:Component
Adds the specified component as a subcomponent, and redraws the component immediately- Overrides:
addComponent
in classComponent<IBox>
- Parameters:
component
- The component to be added- Returns:
- The component
-
removeComponent
Description copied from class:Component
Removes the specified subcomponent.- Overrides:
removeComponent
in classComponent<IBox>
- Parameters:
component
- The component instance- Returns:
- The component
-
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
.
-