Class HorizontalSplitter
- All Implemented Interfaces:
Animatable<HorizontalSplitter>
,CanDrop<HorizontalSplitter>
,Draggable<HorizontalSplitter>
,HandleMouseEvents<HorizontalSplitter>
,Scrollable<HorizontalSplitter>
Horizontally adjustable splitter component
The component enables you to visualize two containers next to each other on the interface where you can insert components arbitrarily. You may enter a default size for the container, however, it is also possible to resize the both containers by moving the separator to left or to the right. The size of both containers always changes simultaneously, that is, if the container to the right shrinks, the one to the left 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 horizontal splitter componentCreates a horizontal splitter component with the specified ID -
Method Summary
Modifier and TypeMethodDescriptionaddComponent
(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.addLeftComponent
(Component<?> component) Adds a component to the left component of the splitter componentaddLeftComponents
(Component<?>... components) Adds multiple components to the left container of the splitteraddRightComponent
(Component<?> component) Adds a component to the right container of the splitter componentaddRightComponents
(Component<?>... components) Adds multiple components to the right container of the splittervoid
The operations to be executed after the drawing of the componentGets the splitter component’s height valueGets the maximum width of the splitter component’s left containerGets the minimum width of the splitter component’s left 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.removeComponent
(Component<?> component) No subcomponent can be removed from the splitter component.removeComponents
(Component<?>... components) No subcomponent can be removed from the splitter component.removeLeftComponent
(Component<?> component) Removes a component from the left container of the splitter componentremoveLeftComponents
(Component<?>... components) Removes multiple components from the left container of the splitterremoveRightComponent
(Component<?> component) Removes a component from the right container of the splitter componentremoveRightComponents
(Component<?>... components) Removes multiple components from the right container of the splittersetHeight
(int height) Sets the splitter component’s height valueSets the splitter component’s height valuesetMaxSize
(int maxSize) Sets the maximum width of the splitter component’s left containersetMaxSize
(String maxSize) Sets the maximum width of the splitter component’s left container If the valuenull
is set, the maximum width of the container will not be limited.setMinSize
(int minSize) Sets the minimum width of the splitter component’s left container in pixelssetMinSize
(String minSize) Sets the minimum width of the splitter component’s left container If the valuenull
is set, the minimum width 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 left side of the component.setPosition
(SplitterPosition splitterPosition) Sets the position of the line separating the splitter component’s containers, relative to the left side of the component.setPosition
(String position) Sets the position of the line separating the splitter component’s containers, relative to the left side of the component.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
-
HorizontalSplitter
public HorizontalSplitter()Creates a horizontal splitter component
The containers of the component will be created with a width value of 50%, that is, the containers on the right and on the left will be of the same size.
-
HorizontalSplitter
Creates a horizontal splitter component with the specified ID
The containers of the component will be created with a width value of 50%, that is, the containers on the right and on the left 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<HorizontalSplitter>
- 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 container on the left, use the method
addLeftComponent
. In order to place a component into the container on the right, use the methodaddRightComponent
.- Overrides:
addComponent
in classComponent<HorizontalSplitter>
- Parameters:
component
- The component to be added- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown upon every method calling
-
addComponents
No further components may be added to the splitter component.
In order to place a component into the container on the left, use the method
addLeftComponent
. In order to place a component into the container on the right, use the methodaddRightComponent
.- Overrides:
addComponents
in classComponent<HorizontalSplitter>
- Parameters:
components
- The instances of the new, to be added components- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown upon every method calling
-
removeComponent
No subcomponent can be removed from the splitter component.
In order to remove a component from the container to the left, use the method
removeLeftComponent
. In order to remove a component from the container to the right, use the methodremoveRightComponent
.- Overrides:
removeComponent
in classComponent<HorizontalSplitter>
- 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 container to the left, use the method
removeLeftComponents
. In order to remove a component from the container to the right, use the methodremoveRightComponents
.- Overrides:
removeComponents
in classComponent<HorizontalSplitter>
- Parameters:
components
- The components that will be removed- Returns:
- The component
- Throws:
UnsupportedOperationException
- Thrown every time the method is called.
-
addLeftComponent
Adds a component to the left component of the splitter component- Parameters:
component
- An instance of the component we want to add to the left container of the splitter- Returns:
- The horizontal splitter component
-
addLeftComponents
Adds multiple components to the left container of the splitter- Parameters:
components
- Instances of the components we want to add to the left container The components will be added according to the order here specified.- Returns:
- The horizontal splitter component
-
removeLeftComponent
Removes a component from the left container of the splitter component- Parameters:
component
- An instance of the component to be removed- Returns:
- The horizontal splitter component
-
removeLeftComponents
Removes multiple components from the left container of the splitter- Parameters:
components
- An enumeration of component instances to be removed- Returns:
- The horizontal splitter component
-
addRightComponent
Adds a component to the right container of the splitter component- Parameters:
component
- An instance of the component we want to add to the right container of the splitter- Returns:
- The horizontal splitter component
-
addRightComponents
Adds multiple components to the right container of the splitter- Parameters:
components
- Instances of the components we want to add to the right container The components will be added according to the order here specified.- Returns:
- The horizontal splitter component
-
removeRightComponent
Removes a component from the right container of the splitter component- Parameters:
component
- An instance of the component to be removed- Returns:
- The horizontal splitter component
-
removeRightComponents
Removes multiple components from the right container of the splitter- Parameters:
components
- An enumeration of component instances to be removed- Returns:
- The horizontal 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<HorizontalSplitter>
-
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<HorizontalSplitter>
- Returns:
- The component
-
getMinSize
Gets the minimum width of the splitter component’s left container- Returns:
- The minimum width of the splitter component’s left container as provided or
null
if there is no minimum width set, that is, the user may shrink the left container to any size.
-
setMinSize
Sets the minimum width of the splitter component’s left container If the valuenull
is set, the minimum width of the container will not be limited.- Parameters:
minSize
- The minimum width of the left container as defined by the CSS3 standard- Returns:
- The horizontal splitter component
-
setMinSize
Sets the minimum width of the splitter component’s left container in pixels- Parameters:
minSize
- The left container’s minimum width in pixels- Returns:
- The horizontal splitter component
-
getMaxSize
Gets the maximum width of the splitter component’s left container- Returns:
- The maximum width of the splitter component as provided, otherwise
null
if no maximum width was entered, that is, it is not defined to what size the user is able to grow the left container.
-
setMaxSize
Sets the maximum width of the splitter component’s left container If the valuenull
is set, the maximum width of the container will not be limited.- Parameters:
maxSize
- The maximum width of the left container as defined by the CSS3 standard- Returns:
- The horizontal splitter component
-
setMaxSize
Sets the maximum width of the splitter component’s left container- Parameters:
maxSize
- The maximum width of the left container in pixels- Returns:
- The horizontal 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 left side of the component. Default value. 50%, that is, the separating line is in the middle of the component.- Parameters:
position
- The position of the line separating the containers. The position can be provided as defined in CSS3.- Returns:
- The horizontal splitter component
-
setPosition
Sets the position of the line separating the splitter component’s containers, relative to the left side of the component. Default value. 50%, that is, the separating line is in the middle of the component.- Parameters:
position
- The position of the line separating the containers.- Returns:
- The horizontal splitter component
-
setPosition
Sets the position of the line separating the splitter component’s containers, relative to the left side of the component. Default value 50%, that is, the separating line is in the middle of the component.- Parameters:
splitterPosition
- A parameter corresponding to the position of the line separating the containers. Available position names are listed in the enumSplitterPosition
.- Returns:
- The horizontal splitter component
-
getHeight
Gets the splitter component’s height value- Returns:
- The current height of the splitter component as entered or
null
if there was no height given
-
setHeight
Sets the splitter component’s height value- Parameters:
height
- The height value of the splitter component as defined in CSS3- Returns:
- The horizontal splitter component
-
setHeight
Sets the splitter component’s height value- Parameters:
height
- The height of the splitter component in pixels- Returns:
- The horizontal 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
-
setWidth
Sets the splitter component’s width value- Parameters:
width
- The width value of the splitter component as defined in CSS3- Returns:
- The horizontal splitter component
-
setWidth
Sets the splitter component’s width value- Parameters:
width
- The width value of the splitter component in pixels- Returns:
- The horizontal 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<HorizontalSplitter>
- Returns:
- If the componentwas drawn,
true
, otherwisefalse
-