Class VerticalSplitter
- All Implemented Interfaces:
Animatable<VerticalSplitter>
,CanDrop<VerticalSplitter>
,Draggable<VerticalSplitter>
,HandleMouseEvents<VerticalSplitter>
,Scrollable<VerticalSplitter>
Vertically adjustable splitter component
The component enables you to display two containers below each other on the interface where you can insert components arbitrarily. The default size for containers can be pre-set, but the user may resize them by moving the separating line up and down. The size of the containers always changes simultaneously , that is, if the size of the upper container decreases, the size of the lower one increases.
You may set a minimum and a maximum size for the container that cannot be overridden by the user.
Supported events:
AnimationStart
AnimationEnd
,
MouseDown
,
MouseDown
,
MouseLeave
,
MouseMove
,
MouseOver
,
MouseOut
,
MouseUp
,
Wheel
,
Scrollable
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
ConstructorDescriptionCreates a vertical splitter componentCreates a vertical splitter component with the specified ID -
Method Summary
Modifier and TypeMethodDescriptionaddBottomComponent
(Component<?> component) Adds a component to the lower container of the splitter componentaddBottomComponents
(Component<?>... components) Adds multiple components to the lower container of the splitter componentaddComponent
(Component<?> component) No further components may be added to the splitter component.addComponents
(Component<?>... components) No further components may be added to the splitter component.addTopComponent
(Component<?> component) Adds a component to the upper container of the splitter componentaddTopComponents
(Component<?>... components) Adds multiple components to the upper container of the splittervoid
The operations to be executed after the drawing of the componentGets the splitter component’s current height valueGets the maximum height of the splitter component’s upper containerGets the minimum height of the splitter component’s upper containerGets the default (start) position of the splitter component’s separator linegetWidth()
Gets the current width of the splitter componentvoid
init()
The component initialization method.redraw()
Redraws the component.removeBottomComponent
(Component<?> component) Removes a component from the lower container of the splitter componentremoveBottomComponents
(Component<?>... components) Removes multiple components from the lower container of the splitterremoveComponent
(Component<?> component) No subcomponent can be removed from the splitter component.removeComponents
(Component<?>... components) No subcomponent can be removed from the splitter component.removeTopComponent
(Component<?> component) Removes a component from the upper container of the splitter componentremoveTopComponents
(Component<?>... components) Removes multiple components from the upper container of the splittersetHeight
(int height) Sets the splitter component’s height valueSets the splitter component’s height valuesetMaxSize
(int maxSize) Sets the maximum height of the splitter component’s upper containersetMaxSize
(String maxSize) Sets the maximum height of the splitter component’s upper container If a value ofnull
is set, the maximum height of the container will not be limited.setMinSize
(int minSize) Sets the minimum height of the splitter component’s upper container in pixelssetMinSize
(String minSize) Sets the minimum height of the splitter component’s upper container If the valuenull
is set, the minimum height of the container will not be limited.setPosition
(int position) Sets the position of the line separating the splitter component’s containers, relative to the top of the component Default value: 50%, that is, the separating line is in the middle.setPosition
(SplitterPosition splitterPosition) Sets the position of the line separating the splitter component’s containers, relative to the top of the component Default value: 50%, that is, the separating line is in the middle.setPosition
(String position) Sets the position of the line separating the splitter component’s containers, relative to the top of the component Default value: 50%, that is, the separating line is in the middle.setWidth
(int width) Sets the splitter component’s width valueSets the splitter component’s width valueboolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, 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, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, onShow, openTag, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, 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.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
-
Constructor Details
-
VerticalSplitter
public VerticalSplitter()Creates a vertical splitter component
The containers of the component will be created with a height value of 50%, that is, the upper as well as the lower containers will be of the same size.
-
VerticalSplitter
Creates a vertical splitter component with the specified ID
The containers of the component will be created with a height value of 50%, that is, the upper as well as the lower containers will be of the same size.
- 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
-
init
Description copied from class:Component
The component initialization method.Empty method, only needs to be overwritten when making a custom component, that needs to call an initializing JavaScript on the client side. The method is called by the framework after the component is drawn, but before the afterDraw() method. The use of this method during application development is not allowed. This method is meant for inner use only.
- Overrides:
init
in classComponent<VerticalSplitter>
- Throws:
JavaScriptLoadError
- If there was a JavaScript error during the initialization.
-
addComponent
No further components may be added to the splitter component.
In order to place a component into the upper container of the component, use the method
addTopComponent
. In order to place a component into the lower container, use the methodaddBottomComponent
.- Overrides:
addComponent
in classComponent<VerticalSplitter>
- Parameters:
component
- The component to be added- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown every time the method is called.
-
addComponents
No further components may be added to the splitter component.
In order to place a component into the upper container of the component, use the method
addTopComponent
. In order to place a component into the lower container, use the methodaddBottomComponent
.- Overrides:
addComponents
in classComponent<VerticalSplitter>
- Parameters:
components
- The instances of the new, to be added components- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown every time the method is called.
-
removeComponent
No subcomponent can be removed from the splitter component.
In order to remove a component from the upper container, use the method
removeTopComponent
. If you want to remove a component from the lower container, use the methodremoveTopComponent
.- Overrides:
removeComponent
in classComponent<VerticalSplitter>
- Parameters:
component
- The component instance- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown every time the method is called.
-
removeComponents
No subcomponent can be removed from the splitter component.
In order to remove a component from the upper container, use the method
removeTopComponents
. In order to remove a component from the lower container, use the methodremoveTopComponents
.- Overrides:
removeComponents
in classComponent<VerticalSplitter>
- Parameters:
components
- The components that will be removed- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown every time the method is called.
-
addTopComponent
Adds a component to the upper container of the splitter component- Parameters:
component
- An instance of the component we want to add to the upper container of the splitter- Returns:
- The vertical splitter component
-
addTopComponents
Adds multiple components to the upper container of the splitter- Parameters:
components
- Instances of the components we want to add to the upper container. The components will be added according to the order here specified.- Returns:
- The vertical splitter component
-
removeTopComponent
Removes a component from the upper container of the splitter component- Parameters:
component
- An instance of the component to be removed- Returns:
- The vertical splitter component
-
removeTopComponents
Removes multiple components from the upper container of the splitter- Parameters:
components
- An enumeration of component instances to be removed- Returns:
- The vertical splitter component
-
addBottomComponent
Adds a component to the lower container of the splitter component- Parameters:
component
- An instance of the component we want to add to the lower container of the splitter- Returns:
- The vertical splitter component
-
addBottomComponents
Adds multiple components to the lower container of the splitter component- Parameters:
components
- Instances of the components we want to add to the lower container. The components will be added according to the order here specified.- Returns:
- The vertical splitter component
-
removeBottomComponent
Removes a component from the lower container of the splitter component- Parameters:
component
- An instance of the component to be removed- Returns:
- The vertical splitter component
-
removeBottomComponents
Removes multiple components from the lower container of the splitter- Parameters:
components
- An enumeration of component instances to be removed- Returns:
- The vertical splitter 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.
- Overrides:
afterDraw
in classComponent<VerticalSplitter>
-
redraw
Description copied from class:Component
Redraws the component.All changes on the components, (even after drawing) are applied automatically. So for this reason, the components don't have to be redrawn. However, sometimes it is necessary to redraw the entire component. If this method is used, the component and all of its subcomponents will be re-sent to the client-side and the components will be re-initialized, a process that can take a significant amount of time, not to mention burden the communication channels. The use of this method for these reasons is not recommended.
- Overrides:
redraw
in classComponent<VerticalSplitter>
- Returns:
- The component
-
getMinSize
Gets the minimum height of the splitter component’s upper container- Returns:
- The minimum width of the splitter component’s upper container as provided or
null
if there is no minimum height set, that is, the user may shrink the left container to any size.
-
setMinSize
Sets the minimum height of the splitter component’s upper container If the valuenull
is set, the minimum height of the container will not be limited.- Parameters:
minSize
- The minimum height of the upper container as defined by the CSS3 standard- Returns:
- The vertical splitter component
-
setMinSize
Sets the minimum height of the splitter component’s upper container in pixels- Parameters:
minSize
- The minimum height of the upper container as defined by the CSS3 standard- Returns:
- The vertical splitter component
-
getMaxSize
Gets the maximum height of the splitter component’s upper container- Returns:
- The maximum height of the splitter component’s upper container as provided or
null
if the maximum height is not defined, that is, it is not limited to what extent the user can resize the upper container.
-
setMaxSize
Sets the maximum height of the splitter component’s upper container If a value ofnull
is set, the maximum height of the container will not be limited.- Parameters:
maxSize
- The maximum height of the upper container as defined by the CSS3 standard- Returns:
- The vertical splitter component
-
setMaxSize
Sets the maximum height of the splitter component’s upper container- Parameters:
maxSize
- The maximum height of the upper container in pixels- Returns:
- The vertical splitter component
-
getPosition
Gets the default (start) position of the splitter component’s separator line- Returns:
- Default (start) position of the line separating the splitter component’s containers
-
setPosition
Sets the position of the line separating the splitter component’s containers, relative to the top of the component Default value: 50%, that is, the separating line is in the middle.- Parameters:
position
- The position of the line separating the containers. The position can be provided as defined in CSS3.- Returns:
- The vertical splitter component
-
setPosition
Sets the position of the line separating the splitter component’s containers, relative to the top of the component Default value: 50%, that is, the separating line is in the middle.- Parameters:
position
- The position of the line separating the containers in pixels- Returns:
- The vertical splitter component
-
setPosition
Sets the position of the line separating the splitter component’s containers, relative to the top of the component Default value: 50%, that is, the separating line is in the middle.- Parameters:
splitterPosition
- A named position corresponding to the position of the line separating the containers Available position names are listed in the enumSplitterPosition
.- Returns:
- The vertical splitter component
-
getHeight
Gets the splitter component’s current height value- Returns:
- The current height of the splitter component as entered * or
null
if there was no height given to the splitter component
-
setHeight
Sets the splitter component’s height value- Parameters:
height
- The height value of the splitter component as defined in CSS3- Returns:
- The vertical splitter component
-
setHeight
Sets the splitter component’s height value- Parameters:
height
- The height of the splitter component in pixels- Returns:
- The vertical splitter component
-
getWidth
Gets the current width of the splitter component- Returns:
- The current width of the splitter component as entered * or
null
if there was no height given to the splitter component
-
setWidth
Sets the splitter component’s width value- Parameters:
width
- The width value of the splitter component as defined in CSS3- Returns:
- The vertical splitter component
-
setWidth
Sets the splitter component’s width value- Parameters:
width
- The width value of the splitter component in pixels- Returns:
- The vertical splitter 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
.- Specified by:
writeHTML
in classComponent<VerticalSplitter>
- Returns:
- If the componentwas drawn,
true
, otherwisefalse
-