Class SimpleFilter
Simple filter component
The user is able to filter the data in a column by using the simple filter component. No advanced filter expressions can be entered as only one column is filtered.
The user is able to select one of the component's columns from the dropdown menu and a filter operator from another dropdown menu, containing the operators available for the specific column. In a further input field, the filter expression is entered. This input field is automatically replaced according to the selected column and selected operator type in order for the user to enter the filter value with a proper input field type.
The filter component has two further buttons to execute the search and to set the filter to default. Filtering can only be performed only if all the necessary information is available. As long as the user is editing the filter expression and the expression is incomplete, the filter start button remains inactive.
Texts on the filter component may be localized or customized by saving the following entries in a properties file:
- filterbar.valueEditor.placeholder - Placeholder text in the filter value input field
- filterbar.columnSelector.placeholder - Placeholder text displayed in the column selector dropdown menu as long as the user selects a column or deletes the selected column
- filterbar.columnSelector.tooltip - Text displayed when the user hovers with the mouse over the column select dropdown menu
- filterbar.operatorSelector.placeholder - Placeholder text displayed in the operator type selecion menu as long as the user selects a filter operator or deletes the selected operator.
- filterbar.operatorSelector.tooltip - Text displayed when the user hovers with the mouse over the filter operator selecion menu
- operator.[Operator name in lowercase] - Operator name visible to the user on the interface
- filterbar.filterButtonTitle - Button text for the filter start button
- filterbar.clearButtonTitle - Text of the button which resets the filter to default
MessageSourceAPI
.
Supported events:
AnimationStart
AnimationEnd
,
Drop
,
DragStart
,
DragEnd
HotKey
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jbstrap.ui.components.filter.BaseFilter
BaseFilter.ColumnParams
-
Field Summary
Fields inherited from class com.jbstrap.ui.components.filter.JBBaseFilter
ADVANCED, cancelButtonIcon, cancelButtonText, currentCriteria, defaultWorldOperator, filterButtonIcon, filterButtonText, filteredColumn, HIDDEN_OPERATORS, resetButtonIcon, resetButtonText, saveButtonIcon, saveButtonText, SIMPLE, TEXT
Fields inherited from class com.jbstrap.ui.components.filter.BaseFilter
columns, defaultEditor, ds, filtering, postInitScript, type
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
ConstructorDescriptionCreates the simple filter componentSimpleFilter
(String language) Creates the simple filter component according the language settingSimpleFilter
(String language, FilterBarFiltering<?> filtering) Creates the simple filter component according the language settingSimpleFilter
(String id, String language, FilterBarFiltering<?> filtering) Creates the simple filter component according the language setting -
Method Summary
Modifier and TypeMethodDescriptionsetCriteria
(Criteria criteria) Sets the filter component according to the filter expression given.setFilterButtonIcon
(Icon icon) setFilterButtonText
(String filterButtonText) setResetButtonIcon
(Icon icon) setResetButtonText
(String resetButtonText) Methods inherited from class com.jbstrap.ui.components.filter.JBBaseFilter
getColumnParamsAsJson, getCriteria, init, isShowEditor, onChangeEditor, onFilter, reset, setButtonsData, setEnabled, setShowEditor
Methods inherited from class com.jbstrap.ui.components.filter.BaseFilter
getComponents, getDataDescriptor, getFiltering, getType, onHide, runAfterDrawOnEditor, runOnHideOnEditor, runOnShowOnEdior, setDataDescriptor, setFiltering, writeHTML
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, 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, 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, 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
-
Constructor Details
-
SimpleFilter
public SimpleFilter()Creates the simple filter component -
SimpleFilter
Creates the simple filter component according the language setting- Parameters:
language
- Language code according to which the component is created. If not provided or the entered value isnull
, the filter component will be created according to the default language setting of the framework. The default language is specified by the JBStrap parameterDEFAULT_LANGUAGE
.
-
SimpleFilter
Creates the simple filter component according the language setting- Parameters:
language
- Language code according to which the component is created. If not provided or the entered value isnull
, the filter component will be created according to the default language setting of the framework. The default language is specified by the JBStrap parameterDEFAULT_LANGUAGE
.filtering
- Component instance to be filtered. The component given here must implement the interfaceFilterBarFiltering
.
-
SimpleFilter
Creates the simple filter component according the language setting- 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
- Language code according to which the component is created. If not provided or the entered value isnull
, the filter component will be created according to the default language setting of the framework. The default language is specified by the JBStrap parameterDEFAULT_LANGUAGE
.filtering
- Component instance to be filtered. The component given here must implement the interfaceFilterBarFiltering
.
-
-
Method Details
-
setCriteria
Sets the filter component according to the filter expression given. The method sets the component into such a state as if the filter expression had been written by the user. Ifnull
is provided, the filter component is set to default.- Specified by:
setCriteria
in classJBBaseFilter<SimpleFilter>
- Parameters:
criteria
- TheCriteria
instance according to which the component is set- Returns:
- Simple filter component
- Throws:
IllegalArgumentException
- Thrown if the simple filter component is passed an advanced filter expression as a parameter.
-
setFilterButtonText
-
getFilterButtonText
-
setFilterButtonIcon
-
getFilterButtonIcon
-
setResetButtonText
-
getResetButtonText
-
setResetButtonIcon
-
getResetButtonIcon
-