Class Component<T extends Component<?>>

Type Parameters:
T - The component type
Direct Known Subclasses:
ActivityStream, ActivityStreamItem, Badge, BaseFilter, Blockquote, Breadcrumb, Breadcrumb.BreadcrumdList, Button, Calendar, Card, CardAccordion, CardBody, CardDeck, CardFooter, CardGroup, CardHeader, ChartCanvas, CodeViewer, Column, Container, ContextMenu, Counter, Div, DropDownButton, DropDownButton.DropDownMenuItem, FileMiniature, Form, FormBlock, FormColumn, FormItem, Header, HorizontalSplitter, HTMLFlow, IBox, Image, Link, ListBox, ListGrid, ListItem, LoadButton, MenuBar, MenuBarBrand, ModalWindow, ModalWindow.ModalFooter, ModalWindow.ModalHeader, NavBar, NavBarFooterButton, NavBarFooterButtonPopup, Paragraph, ProcessIndicator, ProgressBar, Row, SelectorWindow, SeriesTitle, Small, Span, Sparkline, StaticText, Tab, TabHeader, Table, TableCell, TableHeader, TableRow, TabPage, Timeline, TimelineItem, Toolbar, Treeview, VerticalSplitter, VideoBox, Wizard, Wizard.WizardFooter, WizardStep, xData, yData, zData

public abstract class Component<T extends Component<?>> extends MessageBus

The component base class

Every component must extend from this class. This class ensures the basic operations of every component, for example, the drawing process, authorization handling, etc.

Since:
4.0
Author:
JBStrap
  • Field Details

  • Constructor Details

    • Component

      public Component(String language)
      Creates a new component with the specified language.
      Parameters:
      language - The client language code. If specified as null, the component will use the default language. The default language is set in the DEFAULT_LANGUAGE_CODE JBStrap parameter
      Throws:
      IllegalStateException - If the component is set to be both Private and Public.
    • Component

      public Component(String id, String language)
      Creates a new component with the specified language.
      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.)
      language - The client language code. If specified as null, the component will use the default language. The default language is set in the DEFAULT_LANGUAGE_CODE JBStrap parameter
      Throws:
      IllegalStateException - If the component is set to be both Private and Public.
  • Method Details

    • getTypeName

      protected final String getTypeName()
      Gets the component name
      Returns:
      Component type name
    • addAllowedRole

      public T addAllowedRole(String roleCode)
      Adds the specified role to have access to the component. If the specified role is among the denied roles, it will not be overwritten, and the role won't have access to the component
      Parameters:
      roleCode - The code of the role to be granted access
      Returns:
      The component
    • removeAllowedRole

      public T removeAllowedRole(String roleCode)
      Removes access from the previously added role. If the role was given access through an annotation, it won't be removed.
      Parameters:
      roleCode - The code of the role to be removed
      Returns:
      The component
    • addDeniedRole

      public T addDeniedRole(String roleCode)
      Denies access to the component to the specified role. If this role is among those that have access, and that access was granted through the program, it's access will be revoked, and it will be to the denied roles. If the role was assigned through an annotation, it won't be added to the denied roles, and it will still have access to the component.
      Parameters:
      roleCode - The code of the role to be denied.
      Returns:
      The component
    • removeDeniedRole

      public T removeDeniedRole(String roleCode)
      Removes the specified role from the denied roles. If the role was added to the component through an annotation, or was assigned through an annotation, it won't be removed.
      Parameters:
      roleCode - The code of the role to be removed
      Returns:
      The component
    • getAccessMode

      public AccessMode getAccessMode()
      Gets the component's access mode.
      Returns:
      The component's access mode. The modes can be found in the AccessMode enum. If the access mode wasn't defined, it will return with null.
    • getAllowedRoles

      public List<String> getAllowedRoles()
      Gets a list of the allowed roles (Roles that have access)
      Returns:
      A list containing the role codes that are allowed, or null, if the component doesn't have any roles assigned.
    • getDeniedRoles

      public List<String> getDeniedRoles()
      Gets a list of the denied roles (Roles that do not have access)
      Returns:
      A list containing the role codes that are denied, or null, if the component doesn't have any roles assigned.
    • getAccess

      protected com.jbstrap.ui.Access getAccess()
      Returns:
      The combined access or null, if the component hierarchy is not done yet.
    • combinateAccess

      protected T combinateAccess(com.jbstrap.ui.Access parentAccess)
      Parameters:
      parentAccess - The parent component's combined access
      Returns:
      The component
      Throws:
      IllegalStateException - If the parent component was already specified, but it's combined access is null
    • isAccess

      public boolean isAccess(Role role)
      Determines if the specified role has access to the component.
      Parameters:
      role - The role code or null, if there isn't a logged in user, or if the user has no roles assigned to it.
      Returns:
      true, if the user has access, otherwise false
    • setLanguage

      protected T setLanguage(String language)
      Sets the component language.
      Parameters:
      language - The language code
      Returns:
      The component
    • setAttribute

      public final T setAttribute(String name, Object value)
      Sets an HTML attribute on the component. If the attribute was already assigned, the attribute will be overwritten. If the attribute value is specified as null, the attribute will be removed.
      Parameters:
      name - The attribute name
      value - The attribute value
      Returns:
      The component
    • getAttributes

      public Map<String,Object> getAttributes()
      Gets the HTML attributes of the component
      Returns:
      A map containing the HTML attributes of the component. If the component has no HTML attributes, the map will be empty
    • _setAttribute

      protected T _setAttribute(String name, Object value)
      Parameters:
      name - The attribute name
      value - The attribute value
      Returns:
      The component
    • getAttribute

      public final Object getAttribute(String name)
      Gets an HTML Attribute value from the component. If not found, returns with null.
      Parameters:
      name - The name of the attribute
      Returns:
      The attribute value or null, if not found
    • setName

      public T setName(String name)
      Sets the name of the component (name HTML attribute)
      Parameters:
      name - The component name
      Returns:
      The component
    • getName

      public String getName()
      Gets the component name.
      Returns:
      The component name or null, if no name was set
    • removeAttribute

      public final T removeAttribute(String name)
      Removes the specified HTML attribute from the component
      Parameters:
      name - The attribute name
      Returns:
      The component
    • addStyleClass

      public T addStyleClass(String styleClass)
      Adds the specified CSS class to the component
      Parameters:
      styleClass - The name of the CSS style class
      Returns:
      The component
    • replaceStyleClass

      public T replaceStyleClass(String oldStyleClass, String newStyleClass)
      Replaces a previously placed CSS style class. If the original class is not found, the new one still gets added to the component.
      Parameters:
      oldStyleClass - The name old style class that will be replaced (removed)
      newStyleClass - The name new style class
      Returns:
      The component
    • getStyleClasses

      public List<String> getStyleClasses()
      Gets a list of every style class that was assigned to the component.
      Returns:
      A list of the style classes. If none were assigned to the component, the list will be empty.
    • toggleStyleClass

      public T toggleStyleClass(String styleClass)
      Removes or adds a style class to/from the component. If the specified class is already on the component, it gets removed, if it does not, it gets added to the component.
      Parameters:
      styleClass - The name of the style class
      Returns:
      The component
    • containsStyleClass

      public boolean containsStyleClass(String styleClass)
      Determines if the specified style class has been assigned to the component.
      Parameters:
      styleClass - The name of the style class
      Returns:
      true if it is assigned, otherwise false
    • addStyleClasses

      public T addStyleClasses(String... styleClasses)
      Adds the specified style classes to the component
      Parameters:
      styleClasses - The name of the style classes
      Returns:
      The component
    • removeStyleClass

      public T removeStyleClass(String styleClass)
      Removes the specified style class from the component
      Parameters:
      styleClass - The name of the style class
      Returns:
      The component
    • removeStyleClasses

      public T removeStyleClasses(String... styleClasses)
      Removes the specified style classes from the component
      Parameters:
      styleClasses - The name of the style classes
      Returns:
      The component
    • removeAllStyleClasses

      public T removeAllStyleClasses()
      Removes every specified style class from the component
      Returns:
      The component
    • getId

      public String getId()
      Gets the component's ID
      Returns:
      The component ID
    • removeComponent

      public T removeComponent(Component<?> component)
      Removes the specified subcomponent.
      Parameters:
      component - The component instance
      Returns:
      The component
    • replaceComponent

      public T replaceComponent(Component<?> oldComponent, Component<?> newComponent)
      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.
      Parameters:
      oldComponent - The to be replaced component.
      newComponent - The new component
      Returns:
      The component
    • removeComponents

      public T removeComponents(Component<?>... components)
      Removes the specified components.
      Parameters:
      components - The components that will be removed
      Returns:
      The component
    • removeAllComponents

      public T removeAllComponents()
      Removes every subcomponent from the component
      Returns:
      The component
    • removeComponent

      public T removeComponent(Predicate<Component<?>> filter)
      Removes the specified component(s), according to the specified predicate.
      Parameters:
      filter - The filter for the removal
      Returns:
      The component
    • addComponent

      public T addComponent(Component<?> component)
      Adds the specified component as a subcomponent, and redraws the component immediately
      Parameters:
      component - The component to be added
      Returns:
      The component
    • addComponent

      protected T addComponent(Component<?> component, boolean draw)
      Adds the specified component as a subcomponent
      Parameters:
      component - The component to be added
      draw - Determines if the component will be redrawn immediately. If true, it will be redrawn, if false, it won't be. This means the component will be drawn after other components are added to it, or it has to be drawn manually, with the redraw method, so the newly added components will appear.
      Returns:
      The component
    • insertComponentAfter

      public T insertComponentAfter(Component<?> component)
      Inserts the specified component after the component
      Parameters:
      component - The component to be added
      Returns:
      The component
    • insertComponentBefore

      public T insertComponentBefore(Component<?> component)
      Inserts the specified component before the component
      Parameters:
      component - The component to be added
      Returns:
      The component
    • runAfterDraw

      protected void runAfterDraw()
    • runOnShow

      protected void runOnShow()
    • runOnHide

      protected void runOnHide()
      Runs every on hide method of the component and subcomponents
    • addComponents

      public T addComponents(Component<?>... components)
      Adds multiple components to the component
      Parameters:
      components - The instances of the new, to be added components
      Returns:
      The component
    • getComponents

      public List<Component<?>> getComponents()
      Gets every previously added subcomponent
      Returns:
      A collection of every subcomponent that was added to the component. If there are none, the collection will be empty
    • flattendComponentTree

      protected Stream<Component<?>> flattendComponentTree()
    • getComponentById

      public Component<?> getComponentById(String id)
      Gets the specified component. It can be specified by its ID. If it has subcomponents, the method will look among the subcomponets too.
      Parameters:
      id - The component id
      Returns:
      If found, returns with the component instance. If not, returns with null
    • getParent

      public final Object getParent()
      Gets the component's parent component
      Returns:
      The parent component instance
    • setParent

      public final T setParent(Object parent)
      Parameters:
      parent - The parent component, or UI instance
      Returns:
      The component
    • getUI

      public final UI getUI()
      Gets the UI, where the component is currently. If the component isn't drawn yet, the UI won't be found, and the method will return with null.
      Returns:
      The UI instance, where the component is currently on. If the component isn't currently drawn, it will return with null.
    • getComponentsByClass

      public final <E> List<E> getComponentsByClass(Class<E> clazz)
      Gets the components, that are specified by class. If they have subcomponents, the method will look among the subcomponets too.
      Type Parameters:
      E - The component type
      Parameters:
      clazz - The class that will be used as a reference for the operation
      Returns:
      A list containing the component instances. If none was found, the list will be empty.
      Throws:
      NullPointerException - If the specified class is null
    • getComponents

      public final List<Component<?>> getComponents(Predicate<Component<?>> filter)
      Gets a list of components, according to the specified predicate. If they have subcomponents, the method will look among the subcomponets too. This means that the list may contain components, that are not the component's direct subcomponent, but are subcomponents of a direct subcomponent.
      Parameters:
      filter - The predicate filter
      Returns:
      A list containing the components that meets the specified conditions. If there are none, the list will be empty
    • setEnabled

      public T setEnabled(boolean enabled)
      Sets the component to be enabled. Defaults to true
      Parameters:
      enabled - true, the component is enabled, otherwise it's disabled
      Returns:
      The component
    • isEnabled

      public boolean isEnabled()
      Determines if the component is enabled.
      Returns:
      true if it's enabled, otherwise false
    • openTag

      protected final String openTag(String tag)

      Opens the specified HTML tag during the drawing of the component. The opened tag will contain the previously added component attributes, style classes and the unique id.

      This method doesn't need to be used during application development. This method is used when developing a custom component.

      Parameters:
      tag - The HTML tag that will be opened (ie: div, table, etc.)
      Returns:
      The full HTML string, that opens the specified tag
    • closeTag

      protected final String closeTag(String tag)

      Closes the specified HTML tag

      This method doesn't need to be used during application development. This method is used when developing a custom component.

      Parameters:
      tag - The HTML tag to be closed
      Returns:
      The full HTML string, that closes the specified tag
    • drawSubComponents

      public T drawSubComponents(StringWriter writer)

      Draws the component's subcomponents

      This method doesn't need to be used during application development. This method is used when developing a custom component.

      Parameters:
      writer - The HTML string writer StringWriter instance. This is where the subcomponent's HTML string is written.
      Returns:
      The component
    • addHandler

      protected final T addHandler(EventType eventType, Object handler)
      Parameters:
      eventType - The event type. For a list of types, see the EventType enum.
      handler - The event handler implementation.
      Returns:
      The component
      Throws:
      NullPointerException - If the specified event type is null
    • getHandlers

      public final List<BrowserEventHandler> getHandlers(EventType eventType)
      Gets the handlers of the specified event type
      Parameters:
      eventType - The event type. For a list of types, see the EventType enum.
      Returns:
      A list containing the handlers, or null if no applicable handlers were found.
    • removeHandler

      public final T removeHandler(EventType eventType, Object handler)
      Removes the specified handler from the component.
      Parameters:
      eventType - The event type, that will have the handler removed from. For a list of types, see the EventType enum.
      handler - The event handler implementation
      Returns:
      The component
    • getToolTip

      public String getToolTip()
      Gets the text of the component's tooltip
      Returns:
      The tooltip text, if it was previously set. If not, it will return with null
    • setToolTip

      public T setToolTip(String toolTip)
      Sets the text of the component's tooltip
      Parameters:
      toolTip - The tooltip text
      Returns:
      The component
    • getToolTipPosition

      public ToolTipPosition getToolTipPosition()
      Gets the tooltip position
      Returns:
      The tooltip position
    • setToolTipPosition

      public T setToolTipPosition(ToolTipPosition toolTipPosition)
      Sets the tooltip position. It can be placed around the component. The placement can also be automatic. If automatic, the tooltip will appear where it will have the most free space, and where it will be able to be fully visible. By default, the tooltip position is set to be automatic.
      Parameters:
      toolTipPosition - The tooltip position. If specified as null the position will be automatic. For a list of the applicable positions, see the ToolTipPosition enum.
      Returns:
      The component
    • setVisible

      public T setVisible(boolean visible)
      Sets the visibility of the component. If not visible, the component won't appear on the interface, but it will be drawn in the HTML DOM. The visibility can be set anytime through code. By default, the component is visible
      Parameters:
      visible - If true, the component is visible, if false, it is hidden
      Returns:
      The component
    • isVisible

      public boolean isVisible()
      Determines the component visibility
      Returns:
      true if visible, otherwise false
    • setData

      public final T setData(Object data)
      Sets custom data on the component

      Every component can have custom data. The data specified here, can be any object instance. This means that a complex data structure can be stored within the component. This data isn't used, handled, or modified by the framework, and the data is available during the component's life cycle. The data is only accessible on the server side.

      The component can only have one of this custom data added to it. If data was already assigned, it will be overwritten by the newly assigned data.

      Parameters:
      data - The custom data to be set
      Returns:
      The component
    • getData

      public final Object getData()
      Gets the previously set custom data
      Returns:
      The previously set custom data or null if none was set.
    • redraw

      public T redraw()
      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.

      Returns:
      The component
    • getParent

      public <E> E getParent(Class<E> clazz)
      Gets the first parent component of the component, according to the specified class. The defined parent class may not be the direct parent of the current component,
      Type Parameters:
      E - The component type
      Parameters:
      clazz - The class that will be used as a reference for the operation
      Returns:
      The parent class instance or null if none are found
    • afterDraw

      public void afterDraw()
      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.

    • onShow

      public void onShow()
      The operations to be executed after the component is displayed on the client

      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 component is displayed. This method is nearly identical to the afterDraw() method, they differ in when they are executed. This method runs after the component is displayed on the client. Meaning that it is executed even if the component isn't redrawn, but only set to be visible after being hidden.

    • onHide

      public void onHide()
      The operations to be executed after the component is hidden on the client

      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 component is hidden.

    • getRegisteredEvents

      public final List<EventType> getRegisteredEvents()
      Returns:
      A list of every event type that is registered to the component. If there are none, the list will be empty.
    • setStyle

      public final T setStyle(String attributeName, Object value)
      Sets an Inline style on the component
      Parameters:
      attributeName - The name of the inline style element (CSS key). If one was set previously, it will be overwritten.
      value - The style element value (CSS value)
      Returns:
      The component
    • addStyle

      public final T addStyle(StyleElement... styles)
      Adds a style element to the component.
      Parameters:
      styles - Style element
      Returns:
      Component
    • removeStyle

      public final T removeStyle(StyleElement... styles)
      Removes a style element from the component.
      Parameters:
      styles - Style element
      Returns:
      Component
    • containsStyle

      public boolean containsStyle(StyleElement style)
      Checks if the specified style element is included in the component.
      Parameters:
      style - Style element
      Returns:
      If true, the specified style element is included in the component, otherwise false
    • removeStyle

      public final T removeStyle(String attributeName)
      Removes the specified style element from the inline style
      Parameters:
      attributeName - The name of the inline style element (CSS key).
      Returns:
      The component
    • getStyle

      public String getStyle(String attributeName)
      Gets the specified inline style element
      Parameters:
      attributeName - The name of the inline style element(CSS key).
      Returns:
      The style element value or null if not found
    • _hide

      protected T _hide()
      Returns:
      The component
    • getClient

      public final Client getClient()
      Gets the client, that currently has the component displayed.
      Returns:
      The instance of the client that has the component displayed. If the component isn't displayed, it will return with null
    • runJavaScript

      public final T runJavaScript(String javaScript)
      Runs the specified JavaScript on the client, that has the component currently displayed. If the component isn't displayed, the specified JavaScript will not be executed.

      The specified JavaScript won't run instantly. These instructions are first collected by the framework, and then when the current thread is finished, they will be sent to the client in a package, and then they will be executed. The execution order is the same as they were added, this is guaranteed by the framework.

      Warning: If a package contains an illegal instruction, the execution of the package will stop after the first error. This error will be recorded to the browser's console, and the server log.

      Parameters:
      javaScript - The JavaScript to be executed
      Returns:
      The component
    • runJavaScript

      public final T runJavaScript(String... javaScripts)
      Runs the specified JavaScript on the client, that has the component currently displayed. If the component isn't displayed, the specified JavaScript will not be executed.

      The specified JavaScript won't run instantly. These instructions are first collected by the framework, and then when the current thread is finished, they will be sent to the client in a package, and then they will be executed. The execution order is the same as they were added, this is guaranteed by the framework.

      Warning: If a package contains an illegal instruction, the execution of the package will stop after the first error. This error will be recorded to the browser's console, and the server log.

      Parameters:
      javaScripts - The JavaScripts to be executed
      Returns:
      The component
    • runJavaScript

      public final T runJavaScript(List<String> javaScripts)
      Runs the specified JavaScripts on the client, that has the component currently displayed. If the component isn't displayed, the specified JavaScript will not be executed.

      The specified JavaScript won't run instantly. These instructions are first collected by the framework, and then when the current thread is finished, they will be sent to the client in a package, and then they will be executed. The execution order is the same as they were added, this is guaranteed by the framework.

      Warning: If a package contains an illegal instruction, the execution of the package will stop after the first error. This error will be recorded to the browser's console, and the server log.

      Parameters:
      javaScripts - The list containing the JavaScripts to be executed
      Returns:
      The component
    • showNotification

      public final T showNotification(NotificationType notificationType, String title)
      Shows the specified notification on the client that has the component currently displayed. If no component is displayed, the notification won't be shown either.
      Parameters:
      notificationType - The notification type. See the NotificationType enum for applicable values.
      title - The notification title (header text)
      Returns:
      The component
    • showNotification

      public final T showNotification(NotificationType notificationType, String title, String message)
      Shows the specified notification on the client that has the component currently displayed. If no component is displayed, the notification won't be shown either.
      Parameters:
      notificationType - The notification type. See the NotificationType enum for applicable values.
      title - The notification title (header text)
      message - The notification message
      Returns:
      The component
    • error

      public final T error(String title, String message)
      Shows the specified error message on the client that has the component currently displayed. If no component is displayed, the message won't be shown either.
      Parameters:
      title - The error title (header text)
      message - The error message
      Returns:
      The component
    • getLanguageCode

      public String getLanguageCode()
      Gets the component's language code. If no language code was set, it will return with the default one. The default language code can be set in the DEFAULT_LANGUAGE_CODE JBStrap parameter.
      Returns:
      The language code
    • say

      public T say(String title, String message)
      Parameters:
      title - The message title (header text)
      message - The warning message
      Returns:
      The component
    • showProcessIndicator

      protected final T showProcessIndicator(boolean show)
      Sets the Process Indicator to be shown or hidden on the client. If the component isn't displayed, the method won't be executed.
      Parameters:
      show - If true the indicator is shown, if false, it is hidden.
      Returns:
      The component
    • setPadding

      public T setPadding(Padding... paddings)
      Sets the component padding.
      Parameters:
      paddings - A list of paddings to be added Available padding types are listed in the enum Padding.
      Returns:
      Component
    • setMargin

      public T setMargin(Margin... margins)
      Component margin settings. The specified margin has the same type for all screens.
      Parameters:
      margins - A list of component margins Available margins are listed in the Margin class.
      Returns:
      Component
    • setBorder

      public T setBorder(Border... border)
      Sets the component�s border.
      Parameters:
      border - A list of component border settings Available border settings are listed in the enum Border.
      Returns:
      Component
    • onHotKeyEventHandler

      protected void onHotKeyEventHandler(HotKeyEvent event)
      Parameters:
      event - The event object
    • setHeightAuto

      public T setHeightAuto()
      Automatically sets the component's height.
      Returns:
      Component
    • setHeight25

      public T setHeight25()
      Sets the component height to 25%.
      Returns:
      Component
    • setHeight50

      public T setHeight50()
      Sets the component height to 50%.
      Returns:
      Component
    • setHeight75

      public T setHeight75()
      Sets the component height to 75%.
      Returns:
      Component
    • setHeight100

      public T setHeight100()
      Sets the component height to 100%.
      Returns:
      Component
    • setWidthAuto

      public T setWidthAuto()
      Automatically sets the component's width.
      Returns:
      Component
    • setWidth25

      public T setWidth25()
      Sets the component width to 25%.
      Returns:
      Component
    • setWidth50

      public T setWidth50()
      Sets the component width to 50%.
      Returns:
      Component
    • setWidth75

      public T setWidth75()
      Sets the component width to 75%.
      Returns:
      Component
    • setWidth100

      public T setWidth100()
      Sets the component width to 100%.
      Returns:
      Component
    • init

      public void init() throws JavaScriptLoadError
      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.

      Throws:
      JavaScriptLoadError - If there was a JavaScript error during the initialization.
    • isDrawn

      public boolean isDrawn()
      Determines if the component is drawn on the client.
      Returns:
      true, if it is drawn, otherwise false
    • draw

      public final String draw(StringWriter writer)
      Parameters:
      writer - The writer class, that has every Component HTML code. If specified as null, a new StringWriter class is created
      Returns:
      The HTML content collecting writer class.
    • writeHTML

      public abstract boolean writeHTML(StringWriter writer)
      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.

      Returns:
      If the componentwas drawn, true, otherwise false
    • setTextColor

      public T setTextColor(Color color)
      Sets the text color for the component.
      Parameters:
      color - Text color Available colors are listed in the enum Color.
      Returns:
      Component
    • getTextColor

      public Color getTextColor()
      Gets the component�s text color.
      Returns:
      The specified text color or null if not specified
    • setBackgroundColor

      public T setBackgroundColor(Color color)
      Sets the component�s background color.
      Parameters:
      color - The background color to be set Available colors are listed in the enum Color.
      Returns:
      Component
    • getBackgroundColor

      public Color getBackgroundColor()
      Gets the component�s background color.
      Returns:
      Background color or null if not specified
    • setFloating

      public T setFloating(FloatingType... floating)
      Component float settings.
      Parameters:
      floating - Float settings for the component Available settings are listed in the FloatingType class.
      Returns:
      Component
    • clearfix

      public T clearfix(boolean clearfix)
      Removes all float settings. This setting must take effect on the parent component.
      Parameters:
      clearfix - If true is specified, float settings are removed, otherwise not
      Returns:
      Component
    • setSelectionType

      public T setSelectionType(SelectionType type)
      Sets the content selection types (of how users can select content elements).
      Parameters:
      type - Selection type Available selection types are listed in the enum SelectionType.
      Returns:
      Component
    • setScrollable

      public T setScrollable(Boolean scrollable)
      Sets if scrolling is enabled in the component. The default setting is the same as the browser�s.
      Parameters:
      scrollable - If true is specified, scrolling is enabled If false is specified, scrolling is turned off. If null is specified, the default browser settings apply (the text overlaps the area).
      Returns:
      Component
    • setOverflow

      public T setOverflow(Boolean overflow)
      Sets if scrolling is enabled in the component. The default setting is the same as the browser�s.
      Parameters:
      overflow - If true is specified, scrolling is enabled. If false is specified, scrolling is turned off. If null is specified, the default browser settings apply (the text overlaps the area).
      Returns:
      Component
    • setDisplayType

      public T setDisplayType(DisplayType... displayType)
      Set how the component is displayed
      Parameters:
      displayType - A list of display modes you want to use. For a list of available settings, see the DisplayType enum
      Returns:
      Component
    • setFlex

      public T setFlex(Flex... flex)
      Flexible component display setting for all screen sizes. These settings apply only for flexible display settings.
      Parameters:
      flex - Flexible display settings
      Returns:
      Component
    • setShadow

      public T setShadow(Shadow shadow)
      Sets the component shadow.
      Parameters:
      shadow - Component shadow setting Available shadow settings are listed in the enum Shadow.
      Returns:
      Component
    • setTextAlign

      public T setTextAlign(TextAlign textAlign)
    • getTextAlign

      public TextAlign getTextAlign()
    • setBorderColor

      public T setBorderColor(Color color)
      Sets the border color for the component.
      Parameters:
      color - Border color Available colors are listed in the enum Color.
      Returns:
      Component
    • getBorderColor

      public Color getBorderColor()
      Gets the component�s border color.
      Returns:
      The specified border color or null if not specified
    • setEventBubbling

      public T setEventBubbling(boolean bubbling)
    • isEventBubbling

      public boolean isEventBubbling()