Class Table
- All Implemented Interfaces:
Animatable<Table>
,CanDrop<Table>
,Draggable<Table>
,HandleHotKey<Table>
,Scrollable<Table>
Simple HTML Table component
A simple HTML table can be created with this component. The table header can be implemented with the TableHeader
component.
The table rows can be implemented with the TableRow
component.
Supported events:
AnimationStart
AnimationEnd
,
Scrollable
Drop
,
DragStart
,
DragEnd
HotKey
- 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 TypeMethodDescriptionaddComponent
(Component<?> component) Adds the specified table header or table row component to the table.Gets every previously added subcomponentremoveComponent
(Component<?> component) Removes the specified subcomponent.replaceComponent
(Component<?> oldComponent, Component<?> newComponent) Replaces a previously added subcomponent with the specified new subcomponent.setEnabled
(boolean enabled) Enables or disables the table component on the interface.boolean
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, 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, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, 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.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.HandleHotKey
addHotKey, addHotKey, removeHotKey, removeHotKeys
Methods inherited from interface com.jbstrap.ui.Scrollable
addScrollHandler
-
Constructor Details
-
Table
public Table()Creates an empty table component -
Table
Creates an empty table 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.)
-
-
Method Details
-
addComponent
Adds the specified table header or table row component to the table.- Overrides:
addComponent
in classComponent<Table>
- Parameters:
component
- The table row or table header component- Returns:
- The component
- Throws:
IllegalArgumentExceptionIf
- the specified component is not aTableRow
orTableHeader
component, or does not extend from either of those two components.
-
removeComponent
Description copied from class:Component
Removes the specified subcomponent.- Overrides:
removeComponent
in classComponent<Table>
- 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
. -
setEnabled
Enables or disables the table component on the interface. If a component is enabled or disabled, every row, column and cell in the table component will also be enabled or disabled.- Overrides:
setEnabled
in classComponent<Table>
- Parameters:
enabled
-true
, the component is enabled, otherwise it's disabled- Returns:
- The component
-
getComponents
Description copied from class:Component
Gets every previously added subcomponent- Overrides:
getComponents
in classComponent<Table>
- Returns:
- A collection of every subcomponent that was added to the component. If there are none, the collection will be empty
-
replaceComponent
Description copied from class:Component
Replaces a previously added subcomponent with the specified new subcomponent. The new component will be in the place of the old one, meaning the order of the components won't change.- Overrides:
replaceComponent
in classComponent<Table>
- Parameters:
oldComponent
- The to be replaced component.newComponent
- The new component- Returns:
- The component
-