Class DefaultValueSelector
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 Summary
Modifier and TypeFieldDescriptionprotected FilterType
The value selector filter type.protected ListGrid
The value selectorListGrid
instanceprotected ModalWindow
The parent modal window instanceFields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
ConstructorDescriptionDefaultValueSelector
(SelectorItem parent, String language) DefaultValueSelector
(SelectorItem parent, String language, FilterType filterType) -
Method Summary
Modifier and TypeMethodDescriptionvoid
The window close eventvoid
The window rendering must be implemented here.void
The window opening eventboolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.components.form.items.selectoritem.SelectorWindow
getParentSelectorItem, selectElement
Methods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, afterDraw, 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, init, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, onShow, openTag, redraw, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, 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
-
Field Details
-
win
The parent modal window instance -
grid
The value selectorListGrid
instance -
filterType
The value selector filter type. Default isFilterType.SIMPLE_FILTER
-
-
Constructor Details
-
DefaultValueSelector
- 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, ornull
, the framework will use the default language. The default language can be set with theJBStrapParamType.DEFAULT_LANGUAGE
JBStrap parameter.
-
DefaultValueSelector
- 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, ornull
, the framework will use the default language. The default language can be set with theJBStrapParamType.DEFAULT_LANGUAGE
JBStrap parameter.filterType
- The filter type that will be used atop the table. If not specified, ornull
, then the defaultFilterType.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 classSelectorWindow
-
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 classSelectorWindow
-
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 classSelectorWindow
-
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<SelectorWindow>
- Returns:
- If the componentwas drawn,
true
, otherwisefalse
-