Class Tab
- All Implemented Interfaces:
Serializable,Cloneable
- Author:
- Javier Paniza, Ana Andrés, Trifon Trifonov, Chungyen Tsai
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringPrefix used for naming (in session) to the tab objects used for collections.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperties(Collection properties) voidaddProperties(List<String> propertiesName, String[] conditionValues, String[] conditionValuesTo, String[] conditionComparators) Add properties without using old configuration.voidaddProperty(int index, String propertyName) voidaddProperty(String propertyName) voidaddSumProperty(String property) Add total property.voidvoidvoidDeprecated.Since v4.7, use deselectAll() insteadvoidClear the effect of all calls tosetStyle(int, String)clone()booleancontainsProperty(String qualifiedName) voidvoidvoiddeselect(int row) voidvoidvoidfilter()voidfilterByContentInAnyProperty(String content) Filter using like in any column.voidfriendExecuteJspDeselect(String deselect) intA table model with load all data at once.Map[]An array with the keys (inMapformat) of the all rows.If this tab represents a collection the collection view of that collection.intgetColumnWidth(int columnIndex) String[]String[]String[]intFilter used currently by this tab.intintintgetMetaProperty(int i) getMetaProperty(String qualifiedName) intgetPage()intgetPreferencesNodeName(String prefix) javax.servlet.http.HttpServletRequestint[]Deprecated.use getSelectedKeysMap[]getStyle(int row) The CSS style associated to the specified row.A table model with on-demand data reading.getTitle()static StringgetTitleI18n(Locale locale, String modelName, String tabName) getTotal(int column) getTotal(int row, int column) getTotalLabel(int row, int column) getTotalPropertyName(int row, int column) intvoidgoPage(int page) 1 is the first pagevoidbooleanbooleanhasTotal(int column) booleanhasTotal(int row, int column) voidhideRows()booleanbooleanbooleanbooleanbooleanisFixedTotal(int column) booleanbooleanbooleanbooleanbooleanbooleanisOrderAscending(String name) booleanisOrderAscending2(String name) booleanbooleanisOrderDescending(String name) booleanisOrderDescending2(String name) booleanisPropertyEditable(String propertyName) Checks if a property is in the editable properties list.booleanbooleanbooleanbooleanisSelected(int row) booleanbooleanisTotalCapable(int column) booleanbooleanisTotalEditable(int row, int column) voidmoveProperty(int from, int to) voidvoidpageBack()voidvoidvoidvoidremoveProperty(int index) voidremoveProperty(String propertyName) voidremoveSumProperty(String property) Remove total property.voidreset()voidvoidvoidsetAllSelected(int[] values) Deprecated.use setAllSelectedKeysvoidsetAllSelectedKeys(Map[] values) voidsetBaseCondition(String condition) voidsetBaseConditionForReference(String baseConditionForReference) voidvoidsetCollectionView(View collectionView) If this tab represents a collection the collection view of that collection.voidsetColumnsToAddUntilSecondLevel(boolean columnsToAddUntilSecondLevel) voidsetColumnWidth(int columnIndex, int width) voidsetConditionComparators(Collection<String> comparators) voidvoidsetConditionValue(String property, Object value) voidsetConditionValues(Collection<String> values) voidsetConfigurationId(int configurationId) voidsetConfigurationName(String newName) voidsetCustomizeAllowed(boolean customizeAllowed) voidsetDefaultOrder(String defaultOrder) Set the default order for thisTabin runtime.voidsetDefaultPropertiesNames(String properties) The default properties are the initial ones and those to show when the user reset his customizations.voidvoidvoidSets the filter for this tab in runtime.voidsetFilterVisible(boolean filterVisible) voidsetIgnorePageRowCount(boolean ignorePageRowCount) voidvoidsetMessages(Messages messages) voidsetMetaRowStyles(Collection styles) voidsetModelName(String newModelName) voidsetModuleManager(ModuleManager moduleManager) voidsetNotResetNextTime(boolean b) voidsetOptimizeChunkSize(boolean optimizeChunkSize) voidsetPageRowCount(int pageRowCount) voidsetPropertiesNames(String propertiesNames) Set the properties to be displayed by thisTabin runtime.voidsetReferencesCollection(String model, String collectionName) This is an alternative to setModelName, and is used when this tab represent a collection of references.static voidsetRefiner(Object newRefiner) voidsetRequest(javax.servlet.http.HttpServletRequest request) voidsetResizeColumns(boolean resizeColumns) voidsetRowsHidden(boolean rowsHidden) If you like show or hide rows is better calling toshowRows()andhideRows().voidsetSelected(int[] values) Change the selectedKeys only within the current page range.voidsetSelected(String[] values) Same thatsetSelected(int [] values)but from String [].voidSet the CSS style associated to the specified row.voidsetTableModel(IXTableModel tableModel) voidsetTabName(String newTabName) voidsetTabObject(String tabObject) voidSet the specific title as is.voidvoidsetTitleArguments(Object[] valores) voidsetTitleArguments(Object v1, Object v2) voidsetTitleArguments(Object v1, Object v2, Object v3) voidsetTitleArguments(Object v1, Object v2, Object v3, Object v4) voidsetTitleId(String titleId) Set the title from an i18n id.voidsetTitleVisible(boolean b) voidshowRows()toString()
-
Field Details
-
COLLECTION_PREFIX
Prefix used for naming (in session) to the tab objects used for collections.- See Also:
-
TAB_RESETED_PREFIX
- See Also:
-
MAX_CONFIGURATIONS_COUNT
public static final int MAX_CONFIGURATIONS_COUNT- See Also:
-
GROUP_COUNT_PROPERTY
- See Also:
-
STARTS_COMPARATOR
- See Also:
-
CONTAINS_COMPARATOR
- See Also:
-
ENDS_COMPARATOR
- See Also:
-
NOT_CONTAINS_COMPARATOR
- See Also:
-
YEAR_COMPARATOR
- See Also:
-
MONTH_COMPARATOR
- See Also:
-
YEAR_MONTH_COMPARATOR
- See Also:
-
RANGE_COMPARATOR
- See Also:
-
EQ_COMPARATOR
- See Also:
-
NE_COMPARATOR
- See Also:
-
GE_COMPARATOR
- See Also:
-
LE_COMPARATOR
- See Also:
-
GT_COMPARATOR
- See Also:
-
LT_COMPARATOR
- See Also:
-
IN_COMPARATOR
- See Also:
-
NOT_IN_COMPARATOR
- See Also:
-
EMPTY_COMPARATOR
- See Also:
-
NOT_EMPTY_COMPARATOR
- See Also:
-
-
Constructor Details
-
Tab
public Tab() -
Tab
public Tab(boolean cancelSavingPreferences) Creates a tab that will not save the preferences values.- Parameters:
cancelSavingPreferences- If the parameter is true, no preferences are stored.
-
-
Method Details
-
setRefiner
-
getMetaProperties
-
isColumnsToAddUntilSecondLevel
public boolean isColumnsToAddUntilSecondLevel()- Since:
- 5.2
-
setColumnsToAddUntilSecondLevel
public void setColumnsToAddUntilSecondLevel(boolean columnsToAddUntilSecondLevel) - Since:
- 5.2
-
getColumnsToAdd
- Throws:
XavaException
-
getMetaPropertiesNotCalculated
- Throws:
XavaException
-
getBaseCondition
- Throws:
XavaException
-
setBaseCondition
- Throws:
XavaException
-
setReferencesCollection
This is an alternative to setModelName, and is used when this tab represent a collection of references.- Throws:
XavaException
-
setBaseConditionValuesForReference
- Throws:
XavaException
-
getMetaTab
- Throws:
XavaException
-
setDefaultPropertiesNames
The default properties are the initial ones and those to show when the user reset his customizations.- Since:
- 4.1
-
getPropertiesNamesAsString
- Returns:
- Comma separate list.
-
getColumnWidth
public int getColumnWidth(int columnIndex) -
setColumnWidth
public void setColumnWidth(int columnIndex, int width) -
getMetaProperty
-
getMetaProperty
- Since:
- 4.3
-
containsProperty
- Since:
- 5.9
-
setMetaRowStyles
- Throws:
XavaException
-
getTableModel
A table model with on-demand data reading.Suitable for UI.
-
getAllDataTableModel
A table model with load all data at once.Suitable for report generation (for example).
- Throws:
Exception
-
setTableModel
-
reset
public void reset() -
getSelected
public int[] getSelected()Deprecated.use getSelectedKeysindex of selected rows in the range of load rows Deprecated since 4.7 -
hasSelected
public boolean hasSelected() -
setAllSelectedKeys
-
setAllSelected
public void setAllSelected(int[] values) Deprecated.use setAllSelectedKeysChange all selected.Deprecated since 4.7
-
deselect
public void deselect(int row) -
friendExecuteJspDeselect
- Parameters:
deselect- as 'ox_OpenXavaTest_Color__xava_tab:4,3,1'
-
deselect
-
setSelected
public void setSelected(int[] values) Change the selectedKeys only within the current page range.Postcondition this.selectedKey == values is not fulfilled
-
setSelected
Same thatsetSelected(int [] values)but from String []. -
isSelected
public boolean isSelected(int row) -
getInitialIndex
public int getInitialIndex() -
getFinalIndex
public int getFinalIndex() -
isLastPage
public boolean isLastPage() -
pageForward
public void pageForward() -
isNotResetNextTime
public boolean isNotResetNextTime() -
setNotResetNextTime
public void setNotResetNextTime(boolean b) -
getLastPage
public int getLastPage() -
pageBack
public void pageBack() -
goPage
public void goPage(int page) 1 is the first page- Parameters:
page-
-
getPage
public int getPage() -
getTotalSize
public int getTotalSize() -
clearCondition
public void clearCondition()- Since:
- 4.7.1
-
setConditionValues
- Throws:
XavaException- Since:
- 4.6
-
setConditionComparators
- Throws:
XavaException- Since:
- 4.6
-
getConditionValues
-
getConditionValuesTo
-
getConditionComparators
-
groupBy
-
getGroupBy
-
getMetaPropertiesGroupBy
-
orderBy
-
getOrderBy
-
isOrderAscending
-
isOrderDescending
-
isOrderAscending2
-
isOrderDescending2
-
getModelName
-
setModelName
-
reloadMetaModel
public void reloadMetaModel()- Since:
- 5.6
-
getTabName
-
setTabName
-
setRequest
public void setRequest(javax.servlet.http.HttpServletRequest request) -
setModuleManager
- Since:
- 7.7
-
filter
public void filter()- Since:
- 5.9
-
filterByContentInAnyProperty
Filter using like in any column.It does not work for Tab used for collections.
- Since:
- 7.4.5
-
setConditionParameters
public void setConditionParameters()- Since:
- 5.9
-
setTabObject
-
getPreferencesNodeName
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest() -
isTitleVisible
public boolean isTitleVisible() -
setTitleVisible
public void setTitleVisible(boolean b) -
setTitleArgument
-
setTitleArguments
-
setTitleArguments
-
setTitleArguments
-
setTitleArguments
-
createConfiguration
public void createConfiguration()- Since:
- 6.5
-
saveConfiguration
public void saveConfiguration() -
getConfigurationsCount
public int getConfigurationsCount()- Since:
- 6.5
-
getConfigurations
-
setConfigurationId
public void setConfigurationId(int configurationId) -
setConfigurationName
-
removeConfiguration
- Throws:
Exception- Since:
- 5.7
-
getTitle
- Throws:
XavaException
-
getConfigurationName
- Throws:
XavaException
-
isAllConfiguration
public boolean isAllConfiguration()- Since:
- 6.5
-
setTitle
Set the specific title as is.This title is used in list mode if the title is visible and as title for reports.
If you want to use an i18n title usesetTitleId(String titleId)instead.
- Since:
- 4.6
-
getTitleI18n
public static String getTitleI18n(Locale locale, String modelName, String tabName) throws XavaException - Throws:
XavaException
-
getBaseConditionForReference
-
setBaseConditionForReference
-
addProperty
- Throws:
XavaException
-
addProperty
- Throws:
XavaException
-
addProperties
public void addProperties(List<String> propertiesName, String[] conditionValues, String[] conditionValuesTo, String[] conditionComparators) throws XavaException Add properties without using old configuration.- Throws:
XavaException- Since:
- 7.1
-
addProperties
- Throws:
XavaException
-
setLabel
- Parameters:
propertyName-label-- Since:
- 4.8
-
removeProperty
- Throws:
XavaException
-
removeProperty
- Throws:
XavaException
-
moveProperty
public void moveProperty(int from, int to) - Since:
- 5.2
-
restoreDefaultProperties
- Throws:
XavaException
-
clearProperties
- Throws:
XavaException
-
isCustomizeAllowed
public boolean isCustomizeAllowed()- Since:
- 4m5
-
setCustomizeAllowed
public void setCustomizeAllowed(boolean customizeAllowed) - Since:
- 4m5
-
isResizeColumns
public boolean isResizeColumns()- Since:
- 4m5
-
setResizeColumns
public void setResizeColumns(boolean resizeColumns) - Since:
- 4m5
-
getTitleId
-
setTitleId
Set the title from an i18n id.This title is used in list mode if the title is visible and as title for reports.
-
getStyle
The CSS style associated to the specified row.- Returns:
- A string with the CSS style suitable to use in a 'class' attribute in HTML.
-
setStyle
Set the CSS style associated to the specified row.- Parameters:
row- Row number affected by this style.style- A string with the CSS style suitable to use in a 'class' attribute in HTML.
-
clearStyle
public void clearStyle()Clear the effect of all calls tosetStyle(int, String) -
getSelectedKeys
-
getAllKeys
An array with the keys (inMapformat) of the all rows.- Returns:
- Never null
-
hideRows
public void hideRows() -
showRows
public void showRows() -
isRowsHidden
public boolean isRowsHidden() -
setRowsHidden
public void setRowsHidden(boolean rowsHidden) If you like show or hide rows is better calling toshowRows()andhideRows(). -
getPageRowCount
public int getPageRowCount() -
setPageRowCount
public void setPageRowCount(int pageRowCount) -
getFilter
Filter used currently by this tab.By default the filter is the defined one in the <tab/> of the component or using the filter attribute of @Tab annotation.
But, it's possible to assign in runtime other filter using thesetFilter(IFilter)method.- Returns:
- Can be null.
- Throws:
XavaException
-
setFilter
Sets the filter for this tab in runtime.This override the filter defined using <tab> or @Tab.
-
setPropertiesNames
Set the properties to be displayed by thisTabin runtime.This override the properties defined using <tab> or @Tab.
- Throws:
XavaException
-
setDefaultOrder
Set the default order for thisTabin runtime.This override the default order defined using <tab> or @Tab.
- Throws:
XavaException
-
getCollectionView
If this tab represents a collection the collection view of that collection.If this tab does not represents a collection collectionView will be null.
-
setCollectionView
If this tab represents a collection the collection view of that collection.If this tab does not represents a collection collectionView will be null.
-
isFilterVisible
public boolean isFilterVisible() -
setFilterVisible
public void setFilterVisible(boolean filterVisible) -
toString
-
deselectAll
public void deselectAll() -
clearSelected
public void clearSelected()Deprecated.Since v4.7, use deselectAll() instead -
setConditionValue
- Since:
- 4m6
-
hasTotal
public boolean hasTotal(int column) - Since:
- 4.1
-
hasTotal
public boolean hasTotal(int row, int column) - Since:
- 4.3
-
isTotalEditable
public boolean isTotalEditable(int row, int column) - Since:
- 5.9
-
addSumProperty
Add total property.It was created in v4.1 with the name addTotalProperty()
- Since:
- 4.3
-
removeSumProperty
Remove total property.It was created in v4.1 with the name removeTotalProperty()
- Since:
- 4.1
-
getSumPropertiesNames
- Since:
- 4.3
-
getTotalPropertiesNames
- Since:
- 4.1
-
isTotalCapable
public boolean isTotalCapable(int column) - Since:
- 4.1
-
isTotalCapable
- Since:
- 4.8
-
isOrderCapable
- Since:
- 6.4
-
isFromCollection
- Since:
- 6.4
-
isFixedTotal
public boolean isFixedTotal(int column) - Since:
- 4.3
-
getTotal
- Since:
- 4.1
-
getTotal
- Since:
- 4.3
-
getTotalLabel
- Since:
- 4.3
-
getTotalPropertyName
- Since:
- 5.9
-
getTotal
- Since:
- 4.1
-
getAdditionalTotalsCount
public int getAdditionalTotalsCount()- Since:
- 4.3
-
setIgnorePageRowCount
public void setIgnorePageRowCount(boolean ignorePageRowCount) -
isIgnorePageRowCount
public boolean isIgnorePageRowCount() -
cutOutRow
- Throws:
XavaException
-
getErrors
-
setErrors
-
getEditor
-
setEditor
-
clone
-
isSaveConfigurationAllowed
public boolean isSaveConfigurationAllowed()- Since:
- 6.5
-
isOptimizeChunkSize
public boolean isOptimizeChunkSize() -
setOptimizeChunkSize
public void setOptimizeChunkSize(boolean optimizeChunkSize) -
getMessages
-
setMessages
-
isPropertyEditable
Checks if a property is in the editable properties list. Delegates to the MetaTab implementation.- Parameters:
propertyName- The name of the property to check- Returns:
- true if the property is editable, false otherwise
- Since:
- 7.6
-