Class TabPage
- All Implemented Interfaces:
Animatable<TabPage>
,CanDrop<TabPage>
,Clickable<TabPage>
,Draggable<TabPage>
,HandleHotKey<TabPage>
,HandleMouseEvents<TabPage>
,Scrollable<TabPage>
,Touchable<TabPage>
Tab page component
This component cannot be used on its own. Every tab page component must be placed on a Tab component. A Tab Page component represents a page with a clickable Tab header. Accordingly, a Tab component represents a group of tab pages, that are displayed together in the same area. The tab page component contains the other components, that you wish to display when the tab page is selected.
The tab page component can have any other components assigned to it, that will only be displayed, if their tab page is active(the user clicks on that tab page's header). A tab header can have an icon and a title, but no additional components can be placed here.
Supported events:
AnimationStart
AnimationEnd
,
Click
,
DoubleClick
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
Scrollable
TouchCancel
,
TouchEnd
,
TouchMove
,
TouchStart
,
Drop
,
DragStart
,
DragEnd
HotKey
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
ConstructorDescriptionCreates a tab page component with the specified tab page header iconCreates a tab page component with the specified tab page header title and icon.Creates a tab page component with the specified tab page header title, icon and tab page contents.Creates a tab page component with the specified tab page header titleCreates a tab page component with the specified tab page header title and tab page contents.Creates a tab page component with the specified tab page header iconCreates a tab page component with the specified tab page header title and icon.Creates a tab page component with the specified tab page header title, icon and tab page contents.Creates a tab page component with the specified tab page header titleCreates a tab page component with the specified tab page header title and tab page contents. -
Method Summary
Modifier and TypeMethodDescriptionaddHotKey
(int hotKey) Adds the specified hot key to the component.addHotKey
(int hotKey, HotKeyEventHandler handler) Adds the specified hot key to the component.void
The operations to be executed after the drawing of the componentGets the tab page background colorprotected Link
getIcon()
Gets the tab page header icongetIndex()
Gets the index of the tab page.getTitle()
Gets the tab page header titleprotected void
hide()
boolean
Defines whether the tab page can be closed.setBackgroundColor
(Color color) Sets the tab page background colorsetCloseable
(boolean closeable) Sets if the tab page can be closed.setCloseHandler
(TabPageCloseHandler handler) Adds a tab page closing event handler to the tab page.setEnabled
(boolean enabled) Sets the component to be enabled.Sets the tab page header iconSets the tab page header titleprotected void
show()
protected void
showpage
(boolean show) 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, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, 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, 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.Clickable
addClickHandler, addDoubleClickHandler
Methods inherited from interface com.jbstrap.ui.Draggable
addDragEndEventHandler, addDragStartEventHandler, setDraggable
Methods inherited from interface com.jbstrap.ui.HandleHotKey
removeHotKey, removeHotKeys
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
-
TabPage
Creates a tab page component with the specified tab page header title- Parameters:
title
- The tab page header title
-
TabPage
Creates a tab page component with the specified tab page header title- 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.)title
- The tab page header title
-
TabPage
Creates a tab page component with the specified tab page header icon- Parameters:
icon
- The tab page header title. For applicable values, see theIcon
enum.
-
TabPage
Creates a tab page component with the specified tab page header icon- 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.)icon
- The tab page header title. For applicable values, see theIcon
enum.
-
TabPage
Creates a tab page component with the specified tab page header title and icon.- Parameters:
icon
- The tab page header title. For applicable values, see theIcon
enum.title
- The tab page header title
-
TabPage
Creates a tab page component with the specified tab page header title and icon.- 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.)icon
- The tab page header title. For applicable values, see theIcon
enum.title
- The tab page header title
-
TabPage
Creates a tab page component with the specified tab page header title and tab page contents.- Parameters:
title
- The tab page header titlecontents
- The instances of the components that will be placed in the tab page. They will be added in the order they are listed here.
-
TabPage
Creates a tab page component with the specified tab page header title and tab page contents.- 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.)title
- The tab page header titlecontents
- The instances of the components that will be placed in the tab page. They will be added in the order they are listed here.
-
TabPage
Creates a tab page component with the specified tab page header title, icon and tab page contents.- Parameters:
icon
- The tab page header title. For applicable values, see theIcon
enum.title
- The tab page header titlecontents
- The instances of the components that will be placed in the tab page. They will be added in the order they are listed here.
-
TabPage
Creates a tab page component with the specified tab page header title, icon and tab page contents.- 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.)icon
- The tab page header title. For applicable values, see theIcon
enum.title
- The tab page header titlecontents
- The instances of the components that will be placed in the tab page. They will be added in the order they are listed here.
-
-
Method Details
-
getTitle
Gets the tab page header title- Returns:
- The tab page header title or
null
, if it has no title
-
setTitle
Sets the tab page header title- Parameters:
title
- The tab page header title- Returns:
- The tab page component
-
setIcon
Sets the tab page header icon- Parameters:
icon
- The tab page header title. For applicable values, see theIcon
enum.- Returns:
- The tab page component
-
getIcon
Gets the tab page header icon- Returns:
- The tab page header icon or
null
, if it has no icon
-
setBackgroundColor
Sets the tab page background color- Overrides:
setBackgroundColor
in classComponent<TabPage>
- Parameters:
color
- The tab page background color. For applicable values, see theColor
enum- Returns:
- The tab page component
-
getBackgroundColor
Gets the tab page background color- Overrides:
getBackgroundColor
in classComponent<TabPage>
- Returns:
- The background color, in the same format it was specified in.
-
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
. -
getHeaderLink
- Returns:
- The link component that represents the tab header
-
getIndex
Gets the index of the tab page. The index is the number that specifies the placement of the tab page within the tab component. These start from 0, meaning that the first tab page has 0 as it's index, the second has 1 as its index, the third has 2 as its index, etc.- Returns:
- The tab page index or
null
, if the tab component has no tab pages when the query is started.
-
addHotKey
Description copied from interface:HandleHotKey
Adds the specified hot key to the component. If the user presses the hot key, the component's Click event handler will be fired. If the hot key was assigned to an input field, the field will gain focus.- Specified by:
addHotKey
in interfaceHandleHotKey<TabPage>
- Parameters:
hotKey
- The button combination, that will be assigned to the component. This button combination can be specified, by using theKey
class' constants. If the hot key is a combination of two buttons, then the values must be added. For example, the CTRL+S combination is specified asKEY.CTRL + KEY.KEY_S
- Returns:
- The component
-
addHotKey
Description copied from interface:HandleHotKey
Adds the specified hot key to the component. If the user presses the hot key, the specified event handler will be fired- Specified by:
addHotKey
in interfaceHandleHotKey<TabPage>
- Parameters:
hotKey
- The button combination, that will be assigned to the component. This button combination can be specified, by using theKey
class' constants. If the hot key is a combination of two buttons, then the values must be added. For example, the CTRL+S combination is specified asKEY.CTRL + KEY.KEY_S
handler
- TheHotKeyEventHandler
implementation- Returns:
- The component
- See Also:
-
show
protected void show() -
hide
protected void hide() -
setCloseable
Sets if the tab page can be closed. By default, a tab page cannot be closed.- Parameters:
closeable
- Iftrue
is specified, the tab page can be closed, otherwise it cannot be closed- Returns:
- Tab page component
-
isCloseable
public boolean isCloseable()Defines whether the tab page can be closed.- Returns:
- If
true
, the tab page can be closed, otherwise not.
-
setCloseHandler
Adds a tab page closing event handler to the tab page.- Parameters:
handler
- Tab page closing event handler implementation- Returns:
- Tab page component
-
afterDraw
public void afterDraw()Description copied from class:Component
The operations to be executed after the drawing of the componentBy default, this is an empty method. It has to be overwritten on a component or page if additional operations have to be executed after the drawing process. One such operation is data retrieval, which shouldn't run in constructors so that the user could see results of an operation or navigation process.
-
setEnabled
Description copied from class:Component
Sets the component to be enabled. Defaults totrue
- Overrides:
setEnabled
in classComponent<TabPage>
- Parameters:
enabled
-true
, the component is enabled, otherwise it's disabled- Returns:
- The component
-
showpage
protected void showpage(boolean show)
-