Class VerticalSplitter

java.lang.Object
com.jbstrap.core.messagebus.MessageBus
com.jbstrap.ui.Component<VerticalSplitter>
com.jbstrap.ui.components.layout.splitter.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
  • 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

      public VerticalSplitter(String id)

      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

      public void init() throws JavaScriptLoadError
      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 class Component<VerticalSplitter>
      Throws:
      JavaScriptLoadError - If there was a JavaScript error during the initialization.
    • addComponent

      public VerticalSplitter addComponent(Component<?> component)

      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 method addBottomComponent.

      Overrides:
      addComponent in class Component<VerticalSplitter>
      Parameters:
      component - The component to be added
      Returns:
      The component
      Throws:
      UnsupportedOperationException - Thrown every time the method is called.
    • addComponents

      public VerticalSplitter addComponents(Component<?>... components)

      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 method addBottomComponent.

      Overrides:
      addComponents in class Component<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

      public VerticalSplitter removeComponent(Component<?> component)

      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 method removeTopComponent.

      Overrides:
      removeComponent in class Component<VerticalSplitter>
      Parameters:
      component - The component instance
      Returns:
      The component
      Throws:
      UnsupportedOperationException - Thrown every time the method is called.
    • removeComponents

      public VerticalSplitter removeComponents(Component<?>... components)

      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 method removeTopComponents.

      Overrides:
      removeComponents in class Component<VerticalSplitter>
      Parameters:
      components - The components that will be removed
      Returns:
      The component
      Throws:
      UnsupportedOperationException - Thrown every time the method is called.
    • addTopComponent

      public VerticalSplitter addTopComponent(Component<?> component)
      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

      public VerticalSplitter addTopComponents(Component<?>... components)
      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

      public VerticalSplitter removeTopComponent(Component<?> component)
      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

      public VerticalSplitter removeTopComponents(Component<?>... components)
      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

      public VerticalSplitter addBottomComponent(Component<?> component)
      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

      public VerticalSplitter addBottomComponents(Component<?>... components)
      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

      public VerticalSplitter removeBottomComponent(Component<?> component)
      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

      public VerticalSplitter removeBottomComponents(Component<?>... components)
      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 component

      By 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 class Component<VerticalSplitter>
    • redraw

      public 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 class Component<VerticalSplitter>
      Returns:
      The component
    • getMinSize

      public String 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

      public VerticalSplitter setMinSize(String minSize)
      Sets the minimum height of the splitter component’s upper container If the value null 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

      public VerticalSplitter setMinSize(int minSize)
      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

      public String 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

      public VerticalSplitter setMaxSize(String maxSize)
      Sets the maximum height of the splitter component’s upper container If a value of null 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

      public VerticalSplitter setMaxSize(int maxSize)
      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

      public String 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

      public VerticalSplitter 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.
      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

      public VerticalSplitter 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.
      Parameters:
      position - The position of the line separating the containers in pixels
      Returns:
      The vertical splitter component
    • setPosition

      public VerticalSplitter 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.
      Parameters:
      splitterPosition - A named position corresponding to the position of the line separating the containers Available position names are listed in the enum SplitterPosition.
      Returns:
      The vertical splitter component
    • getHeight

      public String 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

      public VerticalSplitter setHeight(String height)
      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

      public VerticalSplitter setHeight(int height)
      Sets the splitter component’s height value
      Parameters:
      height - The height of the splitter component in pixels
      Returns:
      The vertical splitter component
    • getWidth

      public String 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

      public VerticalSplitter setWidth(String width)
      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

      public VerticalSplitter setWidth(int width)
      Sets the splitter component’s width value
      Parameters:
      width - The width value of the splitter component in pixels
      Returns:
      The vertical splitter component
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This 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 with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<VerticalSplitter>
      Returns:
      If the componentwas drawn, true, otherwise false