Class ColumnChooserDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.nebula.widgets.nattable.columnChooser.gui.AbstractColumnChooserDialog
org.eclipse.nebula.widgets.nattable.columnChooser.gui.ColumnChooserDialog
- All Implemented Interfaces:
org.eclipse.jface.window.IShellProvider
Dialog that contains two
Trees to support hide/show and reordering of
columns.-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler -
Field Summary
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSISFields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred -
Constructor Summary
ConstructorsConstructorDescriptionColumnChooserDialog(org.eclipse.swt.widgets.Shell parentShell, String availableLabel, String selectedLabel) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ISelectionTreeListener listener) Add aISelectionTreeListenerthat is triggered for modifications in the selected tree.voidExpands all leaves.protected final voidfireItemsMoved(SelectionLayer.MoveDirectionEnum direction, List<ColumnGroupEntry> selectedColumnGroupEntries, List<ColumnEntry> selectedColumnEntries, List<List<Integer>> fromPositions, List<Integer> toPositions) protected final voidfireItemsRemoved(List<ColumnEntry> removedItems) protected final voidfireItemsSelected(List<ColumnEntry> addedItems) getIndexesOfSelectedLeaves(org.eclipse.swt.widgets.Tree tree) Return the indexes of the selected leaves in the tree.protected org.eclipse.swt.widgets.Treeprotected voidMove selected items in the selected tree down (right).protected voidMove selected items in the selected tree up (left).voidpopulateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupModel columnGroupModel) Populates the available item tree with the given column entries for the givenColumnGroupModel.voidpopulateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupModel columnGroupModel, boolean sort) Populates the available item tree with the given column entries for the givenColumnGroupModel.voidpopulateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupHeaderLayer columnGroupHeaderLayer) Populates the available item tree with the given column entries for the new performanceColumnGroupHeaderLayer.voidpopulateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupHeaderLayer columnGroupHeaderLayer, boolean sort) Populates the available item tree with the given column entries for the new performanceColumnGroupHeaderLayer.voidpopulateDialogArea(org.eclipse.swt.widgets.Composite parent) voidpopulateSelectedTree(List<ColumnEntry> columnEntries, ColumnGroupModel columnGroupModel) Populates the selected item tree with the given column entries for the givenColumnGroupModel.voidpopulateSelectedTree(List<ColumnEntry> columnEntries, ColumnGroupHeaderLayer columnGroupHeaderLayer) Populates the selected item tree with the given column entries for the new performanceColumnGroupHeaderLayer.voidRemoves all items from the available and the selected tree.voidremoveListener(ISelectionTreeListener listener) Remove aISelectionTreeListenerthat is triggered for modifications in the selected tree.voidsetPreventHidingAllColumns(boolean preventHidingAllColumns) With this option, the dialog can be configure to either allow removing all columns from the set of visible columns or prevent such a state by disabling the "remove from selection" button if the selection contains all remaining visible columns.protected voidsetSelection(org.eclipse.swt.widgets.Tree tree, List<Integer> indexes) Marks the leaves in the tree as selectedvoidsetSelectionIncludingNested(List<Integer> indexes) Methods inherited from class org.eclipse.nebula.widgets.nattable.columnChooser.gui.AbstractColumnChooserDialog
createButtonsForButtonBar, createDialogArea, createLabels, getDialogBoundsSettings, getInitialSize, setDialogSettingsMethods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenTextMethods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, configureShell, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
-
Constructor Details
-
ColumnChooserDialog
public ColumnChooserDialog(org.eclipse.swt.widgets.Shell parentShell, String availableLabel, String selectedLabel) - Parameters:
parentShell- the parent shell, ornullto create a top-level shellavailableLabel- The label to be shown for the available tree.selectedLabel- The label to be shown for the selected tree.
-
-
Method Details
-
populateDialogArea
public void populateDialogArea(org.eclipse.swt.widgets.Composite parent) - Specified by:
populateDialogAreain classAbstractColumnChooserDialog
-
addListener
Add aISelectionTreeListenerthat is triggered for modifications in the selected tree.- Parameters:
listener- the listener to add.- Since:
- 2.0
-
removeListener
Remove aISelectionTreeListenerthat is triggered for modifications in the selected tree.- Parameters:
listener- the listener to remove.- Since:
- 2.0
-
fireItemsSelected
-
fireItemsRemoved
-
fireItemsMoved
protected final void fireItemsMoved(SelectionLayer.MoveDirectionEnum direction, List<ColumnGroupEntry> selectedColumnGroupEntries, List<ColumnEntry> selectedColumnEntries, List<List<Integer>> fromPositions, List<Integer> toPositions) -
populateAvailableTree
public void populateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupModel columnGroupModel) Populates the available item tree with the given column entries for the givenColumnGroupModel.- Parameters:
columnEntries- The column entries to add as available items.columnGroupModel- TheColumnGroupModelneeded to inspect the column groups, can benullif no column grouping is supported in the underlying table composition.
-
populateAvailableTree
public void populateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupModel columnGroupModel, boolean sort) Populates the available item tree with the given column entries for the givenColumnGroupModel.- Parameters:
columnEntries- The column entries to add as available items.columnGroupModel- TheColumnGroupModelneeded to inspect the column groups, can benullif no column grouping is supported in the underlying table composition.sort- Whether the tree should be sorted or not.- Since:
- 2.0
-
populateSelectedTree
public void populateSelectedTree(List<ColumnEntry> columnEntries, ColumnGroupModel columnGroupModel) Populates the selected item tree with the given column entries for the givenColumnGroupModel.- Parameters:
columnEntries- The column entries to add as selected items.columnGroupModel- TheColumnGroupModelneeded to inspect the column groups, can benullif no column grouping is supported in the underlying table composition.
-
populateAvailableTree
public void populateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupHeaderLayer columnGroupHeaderLayer) Populates the available item tree with the given column entries for the new performanceColumnGroupHeaderLayer.- Parameters:
columnEntries- The column entries to add as available items.columnGroupHeaderLayer- The new performanceColumnGroupHeaderLayerneeded to inspect the column groups, can benullif no column grouping is supported in the underlying table composition.- Since:
- 1.6
-
populateAvailableTree
public void populateAvailableTree(List<ColumnEntry> columnEntries, ColumnGroupHeaderLayer columnGroupHeaderLayer, boolean sort) Populates the available item tree with the given column entries for the new performanceColumnGroupHeaderLayer.- Parameters:
columnEntries- The column entries to add as available items.columnGroupHeaderLayer- The new performanceColumnGroupHeaderLayerneeded to inspect the column groups, can benullif no column grouping is supported in the underlying table composition.sort- Whether the tree should be sorted or not.- Since:
- 2.0
-
populateSelectedTree
public void populateSelectedTree(List<ColumnEntry> columnEntries, ColumnGroupHeaderLayer columnGroupHeaderLayer) Populates the selected item tree with the given column entries for the new performanceColumnGroupHeaderLayer.- Parameters:
columnEntries- The column entries to add as selected items.columnGroupHeaderLayer- The new performanceColumnGroupHeaderLayerneeded to inspect the column groups, can benullif no column grouping is supported in the underlying table composition.- Since:
- 1.6
-
moveSelectedUp
protected void moveSelectedUp()Move selected items in the selected tree up (left). -
moveSelectedDown
protected void moveSelectedDown()Move selected items in the selected tree down (right). -
getIndexesOfSelectedLeaves
Return the indexes of the selected leaves in the tree.- Parameters:
tree- TheTreeto inspect.- Returns:
- The indexes of the selected leaves.
-
expandAllLeaves
public void expandAllLeaves()Expands all leaves. -
removeAllLeaves
public void removeAllLeaves()Removes all items from the available and the selected tree. -
setSelectionIncludingNested
-
setSelection
Marks the leaves in the tree as selected- Parameters:
tree- containing the leavesindexes- index of the leaf in the tree
-
getSelectedTree
protected org.eclipse.swt.widgets.Tree getSelectedTree() -
setPreventHidingAllColumns
public void setPreventHidingAllColumns(boolean preventHidingAllColumns) With this option, the dialog can be configure to either allow removing all columns from the set of visible columns or prevent such a state by disabling the "remove from selection" button if the selection contains all remaining visible columns.- Parameters:
preventHidingAllColumns- if true, the dialog will prevent that the user selects no column at all, by disabling the "remove from selection" button appropriately.
-