Class CustomizeManager
java.lang.Object
org.eclipse.nebula.widgets.xviewer.customize.CustomizeManager
public class CustomizeManager
extends java.lang.Object
This manages the default table column definitions versus the user modified column data, sorter and filters.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CURRENT_LABEL
boolean
loading
static java.lang.String
TABLE_DEFAULT_LABEL
-
Constructor Summary
Constructors Constructor Description CustomizeManager(XViewer xViewer, IXViewerFactory xViewerFactory)
-
Method Summary
Modifier and Type Method Description void
addColumns()
void
appendToStatusLabel(java.lang.StringBuilder sb)
void
clearAllColumnFilters()
void
clearFilters()
void
clearSorter()
void
customizeColumnName(XViewerColumn xCol, java.lang.String newName)
Set to newName or clear if newName == ""void
deleteCustomization(CustomizeData custData)
CustomizeData
generateCustDataFromTable()
ColumnDateFilter
getColumnDateFilter(java.lang.String columnId)
ColumnFilterData
getColumnFilterData()
java.lang.String
getColumnFilterText(java.lang.String colId)
Pair<XViewerColumn,java.lang.Integer>
getColumnNumFromXViewerColumn(java.lang.String columnId)
int
getColumnNumFromXViewerColumn(XViewerColumn xCol)
CustomizeData
getCurrentCustomizeData()
java.util.List<XViewerColumn>
getCurrentHiddenTableColumns()
XViewerColumn
getCurrentTableColumn(java.lang.String id)
java.util.List<XViewerColumn>
getCurrentTableColumns()
java.util.Map<XViewerColumn,java.lang.Integer>
getCurrentTableColumnsIndex()
Return index of XColumn to original column index on creation of table.java.util.List<XViewerColumn>
getCurrentTableColumnsInOrder()
java.util.List<XViewerColumn>
getCurrentVisibleTableColumns()
int
getDefaultWidth(java.lang.String id)
java.lang.String
getFilterText()
java.util.List<CustomizeData>
getSavedCustDatas()
void
getSortingStr(java.lang.StringBuilder sb)
java.util.List<XViewerColumn>
getSortXCols()
static int
getSwtAlign(XViewerAlign align)
CustomizeData
getTableDefaultCustData()
void
handleTableCustomization()
boolean
isCustomizationUserDefault(CustomizeData custData)
boolean
isFilterTextRegularExpression()
boolean
isLoading()
boolean
isSorting()
void
loadCustomization()
Clears out current columns, sorting and filtering and loads table customizationvoid
loadCustomization(CustomizeData newCustData)
Clears out current columns, sorting and filtering and loads table customizationvoid
resetDefaultSorter()
CustomizeData
resolveLoadedCustomizeData(CustomizeData loadedCustData)
Since saved customize data is stored as xml, all the columns need to be resolved to the columns available from the factoryvoid
saveCustomization(CustomizeData custData)
void
setColumnDateFilter(java.lang.String columnId, DateRangeType dateRangeType, java.util.Date date1, java.util.Date date2)
void
setColumnFilterText(java.lang.String colId, java.lang.String text)
void
setFilterText(java.lang.String text, boolean regex)
void
setUserDefaultCustData(CustomizeData newCustData, boolean set)
-
Field Details
-
CURRENT_LABEL
public static final java.lang.String CURRENT_LABEL -
TABLE_DEFAULT_LABEL
public static final java.lang.String TABLE_DEFAULT_LABEL -
loading
public boolean loading
-
-
Constructor Details
-
CustomizeManager
- Throws:
XViewerException
-
-
Method Details
-
resolveLoadedCustomizeData
Since saved customize data is stored as xml, all the columns need to be resolved to the columns available from the factory -
setFilterText
public void setFilterText(java.lang.String text, boolean regex) -
getFilterText
public java.lang.String getFilterText() -
setColumnFilterText
public void setColumnFilterText(java.lang.String colId, java.lang.String text) -
clearFilters
public void clearFilters() -
clearAllColumnFilters
public void clearAllColumnFilters() -
getColumnFilterText
public java.lang.String getColumnFilterText(java.lang.String colId) -
getColumnFilterData
-
loadCustomization
public void loadCustomization()Clears out current columns, sorting and filtering and loads table customization -
resetDefaultSorter
public void resetDefaultSorter() -
clearSorter
public void clearSorter() -
handleTableCustomization
public void handleTableCustomization() -
appendToStatusLabel
public void appendToStatusLabel(java.lang.StringBuilder sb) -
generateCustDataFromTable
- Returns:
- the currentCustData; makes a copy of columns so they don't collide with each other
-
getCurrentTableColumns
-
getCurrentTableColumn
-
getCurrentTableColumnsInOrder
-
getCurrentVisibleTableColumns
-
getCurrentHiddenTableColumns
-
getCurrentTableColumnsIndex
Return index of XColumn to original column index on creation of table. Since table allows drag re-ordering of columns, this index will provide the map back to the original column index. Used for label providers getColumnText(object, index) -
getColumnNumFromXViewerColumn
-
getColumnNumFromXViewerColumn
public Pair<XViewerColumn,java.lang.Integer> getColumnNumFromXViewerColumn(java.lang.String columnId) -
getTableDefaultCustData
-
getSortingStr
public void getSortingStr(java.lang.StringBuilder sb) -
getDefaultWidth
public int getDefaultWidth(java.lang.String id) -
isCustomizationUserDefault
- Throws:
XViewerException
-
getSortXCols
-
isLoading
public boolean isLoading() -
getSavedCustDatas
- Throws:
java.lang.Exception
-
saveCustomization
- Throws:
java.lang.Exception
-
customizeColumnName
Set to newName or clear if newName == "" -
setUserDefaultCustData
public void setUserDefaultCustData(CustomizeData newCustData, boolean set) throws java.lang.Exception- Throws:
java.lang.Exception
-
deleteCustomization
- Throws:
java.lang.Exception
-
isSorting
public boolean isSorting() -
loadCustomization
Clears out current columns, sorting and filtering and loads table customization -
addColumns
public void addColumns() -
getSwtAlign
-
isFilterTextRegularExpression
public boolean isFilterTextRegularExpression() -
setColumnDateFilter
public void setColumnDateFilter(java.lang.String columnId, DateRangeType dateRangeType, java.util.Date date1, java.util.Date date2) -
getColumnDateFilter
-
getCurrentCustomizeData
-