Class DefaultValueSelector


public class DefaultValueSelector extends SelectorWindow

The selector item's default selector window. This window can't be used on its own, it is only used by the selector item.

A table will be displayed in the window for the user, that contains the selectable values. The table also contains a filter, that the user can use to filter the values. By default the filter is a SimpleFilter component.

The user can select a value by either clicking or double-clicking on it, and presses the OK button.

The text on the window can be customized, and it can be localized by using the MessageSourceAPI by overwriting the following keys:

  • selectorItem.valueSelector.title - The window's header title. Default:"Select item..."
  • selectorItem.valueSelector.selectBtnIcon - The OK button icon. Default: "CHECK"
  • selectorItem.valueSelector.selectBtnText - The OK button text. Default: "OK"
  • selectorItem.valueSelector.closeBtnIcon - The close button icon. Default: "WINDOW_CLOSE"
  • selectorItem.valueSelector.closeBtnText - The close button text. Default:"Close"
  • selectorItem.valueSelector.noSelecedItemTitle - The header text of the warning message, that is used when the user has not picked a value from the window, but pressed the OK button. Default: "No item selected"
  • selectorItem.valueSelector.noSelecedItemMessage - The message text of the warning message, that is used when the user has not picked a value from the window, but pressed the OK button. Default: "Please select one item from the grid, then try again!"

Since:
4.0
Author:
JBStrap
See Also:
  • Field Details

  • Constructor Details

    • DefaultValueSelector

      public DefaultValueSelector(SelectorItem parent, String language)
      Parameters:
      parent - The selector item instance, that will have this selector window assigned to.
      language - The language code, that the form item will use. If not specified, or null, the framework will use the default language. The default language can be set with the JBStrapParamType.DEFAULT_LANGUAGE JBStrap parameter.
    • DefaultValueSelector

      public DefaultValueSelector(SelectorItem parent, String language, FilterType filterType)
      Parameters:
      parent - The selector item instance, that will have this selector window assigned to.
      language - The language code, that the form item will use. If not specified, or null, the framework will use the default language. The default language can be set with the JBStrapParamType.DEFAULT_LANGUAGE JBStrap parameter.
      filterType - The filter type that will be used atop the table. If not specified, or null, then the default FilterType.SIMPLE_FILTER component will be used.
  • Method Details

    • rendering

      public void rendering()
      Description copied from class: SelectorWindow

      The window rendering must be implemented here. The components must be built here, and they have to be assigned to each other. These will make up the window.

      This is called once by the selector item, when the window is being rendered.

      Specified by:
      rendering in class SelectorWindow
    • showSelector

      public void showSelector()
      Description copied from class: SelectorWindow

      The window opening event

      The selector item calls this method, when the user wants to open the selector window. The window opening, data query and every other related operations must be implemented here.

      Specified by:
      showSelector in class SelectorWindow
    • closeSelector

      public void closeSelector()
      Description copied from class: SelectorWindow

      The window close event

      The selector item calls this method, when the user wants to close the selector window. Relevant operations, such as removing/hiding components must be implemented here.

      Specified by:
      closeSelector in class SelectorWindow
    • 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<SelectorWindow>
      Returns:
      If the componentwas drawn, true, otherwise false