public class CustomizableFilter extends UIContainer<IContainer> implements ITableControl
CustomizableFilter
filters a databook with user defined conditions.
A full text filter is default, but the user can add specific conditions.Modifier and Type | Field and Description |
---|---|
static UIImage |
DEFAULT_IMAGE_ADD
The image for add new condition.
|
static UIImage |
DEFAULT_IMAGE_APPLY
The image for aply filter.
|
static UIImage |
DEFAULT_IMAGE_REMOVE
The image for remove condition.
|
static UICheckBoxCellEditor |
YESNO_CHECKBOX_NOLABEL
Yes no checkbox with no label.
|
allComponents
bTranslate, lLastTranslationModified, parent
uiResource
Constructor and Description |
---|
CustomizableFilter()
Constructs a new
CustomizableFilter . |
Modifier and Type | Method and Description |
---|---|
void |
add(IComponent pComponent,
Object pConstraints,
int pIndex) |
void |
addFilterEditor()
Adds a new filter editor.
|
void |
addFilterEditor(com.sibvisions.apps.components.FilterEditor pFilterEditor)
Adds a new filter editor.
|
void |
addNotify() |
void |
applyFilter()
Applies the current filter.
|
void |
cancelEditing() |
protected void |
configureButton(UIButton pButton,
IImage pImage,
String pAction)
Configures the add and remove buttons.
|
protected String |
createComponentName() |
void |
doClearValues()
Reset completely.
|
void |
doEnableDisableAll()
Reset completely.
|
void |
doFilterChanged(DataRowEvent pEvent)
Handles configuration changes.
|
void |
doLoadFilter(UIActionEvent pEvent)
Action for loading one of the top 5 filters per action command.
|
void |
doRefreshLayout()
Refreshes layout and layouts the editors.
|
void |
doResetFilter()
Reset completely.
|
void |
doSaveFilter()
Opens a popup to enter a filter name and saving the current filter.
|
void |
doShowAllFilter()
Opens a popup to show all filters and load one.
|
void |
doStoreFilters()
Stores all filters after all changes were made.
|
int |
getColumnWidth()
The column editor width.
|
String[] |
getCustomFilterColumnNames()
Gets the column names for custom search.
|
IDataBook |
getDataBook() |
static int |
getDefaultColumnWidth()
The default column editor width.
|
static int |
getDefaultOperatorWidth()
The default operator editor width.
|
static int |
getDefaultValueWidth()
The default operator editor width.
|
List<XmlNode> |
getFilterConfigs()
Gets all filter configs.
|
com.sibvisions.apps.components.FilterEditor[] |
getFilterEditors()
Gets all filter editors.
|
com.sibvisions.apps.components.FilterEditor |
getFullTextFilter()
Gets the full text filter.
|
String[] |
getFullTextFilterColumnNames()
Gets the column names for fulltext search.
|
protected int |
getOperatorIntent(com.sibvisions.apps.components.FilterEditor pFilterEditor)
Gets the indent for the editors.
|
protected int |
getOperatorType(com.sibvisions.apps.components.FilterEditor pFilterEditor,
com.sibvisions.apps.components.FilterEditor pLastFilterEditor)
Gets the operator type.
|
int |
getOperatorWidth()
The operator editor width.
|
com.sibvisions.apps.components.FilterEditor |
getSecondFilterEditor(com.sibvisions.apps.components.FilterEditor pFilterEditor)
Gets the second filter editor, if it is shown.
|
int |
getValueWidth()
The operator editor width.
|
boolean |
isAutoSearch()
True, if the filter editors search automatically after a value is entered.
|
static boolean |
isDefaultAutoSearch()
True, if filter editors search default automatically after a value is entered.
|
static boolean |
isDefaultEnableSubAnd()
Configures, if there is a sub and under or.
|
static boolean |
isDefaultShowAndOr()
Configures, if and or is shown by default.
|
static boolean |
isDefaultShowEnableSearch()
Configures, if enable search is shown by default.
|
static boolean |
isDefaultShowFilterMenu()
Configures, if advanced filter menu is shown by default.
|
static boolean |
isDefaultShowFullTextFilter()
Configures, if full text filter is shown by default.
|
boolean |
isEnableSubAnd()
Configures, if there is a sub and under or.
|
boolean |
isShowAndOr()
Configures, if and or is shown.
|
boolean |
isShowApplyFilter()
Gets whether the apply filter button is visible.
|
boolean |
isShowEnableSearch()
Configures, if enable search is shown.
|
boolean |
isShowFilterMenu()
Configures, if advanced filter menu is shown.
|
boolean |
isShowFullTextFilter()
Configures, if full text filter is shown.
|
void |
loadFilter(String pFilterName)
Loads the filter configuration with the given filter name.
|
void |
loadFilters()
Loads all filters from DB.
|
void |
notifyRepaint() |
void |
refreshLayout()
Refreshes layout and layouts the editors.
|
void |
remove(int pIndex) |
void |
removeAllFilterEditors()
Removes all filter editors.
|
void |
removeFilterEditor(com.sibvisions.apps.components.FilterEditor pFilterEditor)
Removes the given filter editor.
|
void |
removeFilterEditor(UIActionEvent pEvent)
Removes the filter editor triggered by the remove button.
|
void |
removeNotify() |
void |
saveEditing() |
void |
saveFilter(String pFilterName)
Saves the current filter configuration under the given filter name.
|
void |
setAutoSearch(boolean pAutoSearch)
Sets whether filter editors search automatically after a value is entered.
|
void |
setColumnWidth(int pColumnWidth)
The column editor width.
|
void |
setCustomFilterColumnNames(String... pColumnNames)
Sets the column names for custom search.
|
void |
setDataBook(IDataBook pDataBook) |
static void |
setDefaultAutoSearch(boolean pDefaultAutoSearch)
Sets whether filter editors search default automatically after a value is entered.
|
static void |
setDefaultColumnWidth(int pColumnWidth)
The default column editor width.
|
static void |
setDefaultEnableSubAnd(boolean pDefaultEnableSubAnd)
Configures, if there is a sub and under or.
|
static void |
setDefaultOperatorWidth(int pOperatorWidth)
The default operator editor width.
|
static void |
setDefaultShowAndOr(boolean pDefaultShowAndOr)
Configures, if and or is shown by default.
|
static void |
setDefaultShowEnableSearch(boolean pDefaultShowEnableSearch)
Configures, if enable search is shown by default.
|
static void |
setDefaultShowFilterMenu(boolean pDefaultShowFilterMenu)
Configures, if advanced filter menu is shown by default.
|
static void |
setDefaultShowFullTextFilter(boolean pDefaultShowFullTextFilter)
Configures, if full text filter is shown by default.
|
static void |
setDefaultValueWidth(int pValueWidth)
The default value editor width.
|
void |
setEnableSubAnd(boolean pEnableSubAnd)
Configures, if there is a sub and under or.
|
void |
setFilterConfigs(List<XmlNode> pFilterConfigs)
Sets all filter configs.
|
void |
setFullTextFilterColumnNames(String... pColumnNames)
Sets the column names for fulltext search.
|
void |
setOperatorWidth(int pOperatorWidth)
The operator editor width.
|
void |
setShowAndOr(boolean pShowAndOr)
Configures, if and or is shown.
|
void |
setShowApplyFilter(boolean pShow)
Sets show apply filter button visibility.
|
void |
setShowEnableSearch(boolean pShowEnableSearch)
Configures, if enable search is shown.
|
void |
setShowFilterMenu(boolean pShowFilterMenu)
Configures, if advanced filter menu is shown.
|
void |
setShowFullTextFilter(boolean pShowFullTextFilter)
Configures, if full text filter is shown.
|
void |
setValueWidth(int pValueWidth)
The value editor width.
|
void |
startEditing() |
void |
storeFilters()
Stores all filters to DB.
|
void |
toggleOperator(UIActionEvent pEvent)
Removes the filter editor triggered by the remove button.
|
add, add, add, addInternal, beforeAddNotify, checkAdd, componentChanged, contains, getComponent, getComponentCount, getComponents, getInsets, getLayout, getUIResourceContainer, indexOf, remove, removeAll, removeInternal, setLayout, setUIResourceContainer, setZOrder, updateTranslation
capture, createComponentNamePrefix, createSimplifiedClassName, debug, doEventKey, doTriggerPopMenu, equals, error, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKey, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getDefaultName, getEventSource, getExistingNames, getFactory, getFont, getForeground, getLocation, getLocationOffset, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPopupMenu, getPreferredSize, getResource, getRootName, getSize, getStyle, getTabIndex, getToolTipText, getTranslation, getUIComponent, hashCode, incrementNameIfExists, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setDefaultName, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPopupMenu, setPreferredSize, setPreferredSize, setRootName, setSize, setSize, setStyle, setTabIndex, setToolTipText, setTranslation, setTranslationEnabled, setUIComponent, setVisible, translate
eventResourceChanged, eventResourceChanged, fireResourceChanged, getObject, getObjectNames, getUIResource, hasResourceHandler, putObject, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getTranslation, isTranslationEnabled, setTranslation, setTranslationEnabled
translate
capture, eventComponentMoved, eventComponentResized, eventFocusGained, eventFocusLost, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getStyle, getTabIndex, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setStyle, setTabIndex, setToolTipText, setVisible
getResource
public static final UIImage DEFAULT_IMAGE_ADD
public static final UIImage DEFAULT_IMAGE_REMOVE
public static final UIImage DEFAULT_IMAGE_APPLY
public static final UICheckBoxCellEditor YESNO_CHECKBOX_NOLABEL
public CustomizableFilter()
CustomizableFilter
.public IDataBook getDataBook()
getDataBook
in interface ITableControl
public void setDataBook(IDataBook pDataBook)
setDataBook
in interface ITableControl
public void notifyRepaint()
notifyRepaint
in interface IControl
public void saveEditing() throws ModelException
saveEditing
in interface IControl
ModelException
public void cancelEditing()
cancelEditing
in interface IControl
public void startEditing()
startEditing
in interface ITableControl
public void add(IComponent pComponent, Object pConstraints, int pIndex)
add
in interface IContainer
add
in class UIContainer<IContainer>
public void remove(int pIndex)
remove
in interface IContainer
remove
in class UIContainer<IContainer>
protected String createComponentName()
createComponentName
in class UIComponent<IContainer>
public void removeNotify()
removeNotify
in class UIContainer<IContainer>
public void addNotify()
addNotify
in class UIContainer<IContainer>
public static int getDefaultColumnWidth()
public static void setDefaultColumnWidth(int pColumnWidth)
pColumnWidth
- the default column editor width.public static int getDefaultOperatorWidth()
public static void setDefaultOperatorWidth(int pOperatorWidth)
pOperatorWidth
- the default operator editor width.public static int getDefaultValueWidth()
public static void setDefaultValueWidth(int pValueWidth)
pValueWidth
- the default value editor width.public int getColumnWidth()
public void setColumnWidth(int pColumnWidth)
pColumnWidth
- the column editor width.public int getOperatorWidth()
public void setOperatorWidth(int pOperatorWidth)
pOperatorWidth
- the operator editor width.public int getValueWidth()
public void setValueWidth(int pValueWidth)
pValueWidth
- the value editor width.public static boolean isDefaultShowFullTextFilter()
public static void setDefaultShowFullTextFilter(boolean pDefaultShowFullTextFilter)
pDefaultShowFullTextFilter
- true, if full text filter is shown by default.public static boolean isDefaultShowAndOr()
public static void setDefaultShowAndOr(boolean pDefaultShowAndOr)
pDefaultShowAndOr
- true, if and or is shown by default.public static boolean isDefaultEnableSubAnd()
public static void setDefaultEnableSubAnd(boolean pDefaultEnableSubAnd)
pDefaultEnableSubAnd
- true, if there is a sub and under or.public static boolean isDefaultShowEnableSearch()
public static void setDefaultShowEnableSearch(boolean pDefaultShowEnableSearch)
pDefaultShowEnableSearch
- true, if enable search is shown by default.public static boolean isDefaultShowFilterMenu()
public static void setDefaultShowFilterMenu(boolean pDefaultShowFilterMenu)
pDefaultShowFilterMenu
- true, if advanced filter menu is shown by default.public boolean isShowFullTextFilter()
public void setShowFullTextFilter(boolean pShowFullTextFilter) throws ModelException
pShowFullTextFilter
- true, if full text filter is shown.ModelException
- if refreshing layout fails.public boolean isShowAndOr()
public void setShowAndOr(boolean pShowAndOr) throws ModelException
pShowAndOr
- true, if and or is shown.ModelException
- if refreshing layout fails.public boolean isEnableSubAnd()
public void setEnableSubAnd(boolean pEnableSubAnd)
pEnableSubAnd
- true, if there is a sub and under or.public void setShowApplyFilter(boolean pShow)
pShow
- true
to show the button, false
to hidepublic boolean isShowApplyFilter()
true
if visible, false
if hiddenpublic boolean isShowEnableSearch()
public void setShowEnableSearch(boolean pShowEnableSearch) throws ModelException
pShowEnableSearch
- true, if enable search is shown.ModelException
- if refreshing layout fails.public boolean isShowFilterMenu()
public void setShowFilterMenu(boolean pShowFilterMenu) throws ModelException
pShowFilterMenu
- true, if advanced filter menu is shown.ModelException
- if refreshing layout fails.public void addFilterEditor() throws ModelException
ModelException
- if it fails.public void applyFilter() throws ModelException
ModelException
- if applying filter failspublic void doRefreshLayout() throws ModelException
ModelException
- if it fails.public void refreshLayout() throws ModelException
ModelException
- if it fails.public void addFilterEditor(com.sibvisions.apps.components.FilterEditor pFilterEditor) throws ModelException
pFilterEditor
- the filter editor.ModelException
- if it fails.public void doResetFilter() throws ModelException
ModelException
- if it fails.public void doEnableDisableAll() throws ModelException
ModelException
- if it fails.public void doClearValues() throws ModelException
ModelException
- if it fails.public void removeAllFilterEditors() throws ModelException
ModelException
- if it fails.public void removeFilterEditor(UIActionEvent pEvent) throws ModelException
pEvent
- the action event.ModelException
- if it fails.public void toggleOperator(UIActionEvent pEvent) throws ModelException
pEvent
- the action event.ModelException
- if it fails.public void removeFilterEditor(com.sibvisions.apps.components.FilterEditor pFilterEditor) throws ModelException
pFilterEditor
- the filter editor.ModelException
- if it fails.public String[] getFullTextFilterColumnNames()
null
if all columns will be usedpublic void setFullTextFilterColumnNames(String... pColumnNames)
pColumnNames
- the column namespublic String[] getCustomFilterColumnNames()
null
if all columns will be usedpublic void setCustomFilterColumnNames(String... pColumnNames)
pColumnNames
- the column namespublic com.sibvisions.apps.components.FilterEditor getFullTextFilter()
public com.sibvisions.apps.components.FilterEditor[] getFilterEditors()
public com.sibvisions.apps.components.FilterEditor getSecondFilterEditor(com.sibvisions.apps.components.FilterEditor pFilterEditor)
pFilterEditor
- the main filter editor.protected void configureButton(UIButton pButton, IImage pImage, String pAction)
pButton
- the button to configure.pImage
- the image.pAction
- the action.protected int getOperatorIntent(com.sibvisions.apps.components.FilterEditor pFilterEditor)
pFilterEditor
- the filter editor.protected int getOperatorType(com.sibvisions.apps.components.FilterEditor pFilterEditor, com.sibvisions.apps.components.FilterEditor pLastFilterEditor)
pFilterEditor
- the filter editor.pLastFilterEditor
- the last filter editor.public void doFilterChanged(DataRowEvent pEvent) throws ModelException
pEvent
- the data row event.ModelException
- if it fails.public void doShowAllFilter() throws Throwable
Throwable
- if it fails.public void doSaveFilter() throws Throwable
Throwable
- if it fails.public void doLoadFilter(UIActionEvent pEvent) throws Throwable
pEvent
- the action event with the action command.Throwable
- if it fails.public void loadFilter(String pFilterName) throws Throwable
pFilterName
- the filter name.Throwable
- if it fails.public void saveFilter(String pFilterName) throws Throwable
pFilterName
- the filter name.Throwable
- if it fails.public List<XmlNode> getFilterConfigs() throws ModelException
ModelException
- if reading filter config failspublic void setFilterConfigs(List<XmlNode> pFilterConfigs) throws ModelException
pFilterConfigs
- the list of filter configurations.ModelException
- if it fails.public void loadFilters() throws Throwable
Throwable
- if it fails.public void doStoreFilters()
public void storeFilters() throws Throwable
Throwable
- if it fails.public boolean isAutoSearch()
true
, if the filter editors search automatically after a value is entered.public void setAutoSearch(boolean pAutoSearch)
pAutoSearch
- true
, if the filter editors search automatically after a value is entered.public static boolean isDefaultAutoSearch()
true
, if filter editors search default automatically after a value is entered.public static void setDefaultAutoSearch(boolean pDefaultAutoSearch)
pDefaultAutoSearch
- true
, if filter editors search default automatically after a value is entered.Copyright © 2020 SIB Visions GmbH. All Rights Reserved.