12 |
12 |
import org.eclipse.nebula.widgets.nattable.config.CellConfigAttributes;
|
13 |
13 |
import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
|
14 |
14 |
import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes;
|
|
15 |
import org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor;
|
|
16 |
import org.eclipse.nebula.widgets.nattable.filterrow.FilterRowDataLayer;
|
15 |
17 |
import org.eclipse.nebula.widgets.nattable.filterrow.FilterRowTextCellEditor;
|
16 |
18 |
import org.eclipse.nebula.widgets.nattable.filterrow.TextMatchingMode;
|
17 |
19 |
import org.eclipse.nebula.widgets.nattable.filterrow.config.FilterRowConfigAttributes;
|
... | ... | |
26 |
28 |
*/
|
27 |
29 |
public class FilterRowConfiguration extends AbstractRegistryConfiguration {
|
28 |
30 |
|
|
31 |
DistributionEditor editor;
|
|
32 |
|
|
33 |
/**
|
|
34 |
* @param distributionEditor
|
|
35 |
*/
|
|
36 |
public FilterRowConfiguration(DistributionEditor distributionEditor) {
|
|
37 |
editor = distributionEditor;
|
|
38 |
}
|
|
39 |
|
29 |
40 |
@Override
|
30 |
41 |
public void configureRegistry(IConfigRegistry configRegistry) {
|
31 |
42 |
|
... | ... | |
35 |
46 |
EditConfigAttributes.CELL_EDITOR,
|
36 |
47 |
new FilterRowTextCellEditor(),
|
37 |
48 |
DisplayMode.NORMAL,
|
38 |
|
DistributionEditorConfigLabelAccumulator.FILTER_EDITABLE);
|
|
49 |
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 1);
|
39 |
50 |
|
40 |
51 |
configRegistry.registerConfigAttribute(
|
41 |
52 |
FilterRowConfigAttributes.TEXT_MATCHING_MODE,
|
42 |
53 |
TextMatchingMode.CONTAINS,
|
43 |
54 |
DisplayMode.NORMAL,
|
44 |
|
DistributionEditorConfigLabelAccumulator.FILTER_EDITABLE);
|
|
55 |
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 1);
|
45 |
56 |
|
46 |
57 |
configRegistry.registerConfigAttribute(
|
47 |
58 |
CellConfigAttributes.DISPLAY_CONVERTER,
|
48 |
59 |
new SupplementalInfoDisplayConverter(),
|
49 |
60 |
DisplayMode.NORMAL,
|
50 |
|
DistributionEditorConfigLabelAccumulator.FILTER_EDITABLE);
|
|
61 |
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 1);
|
|
62 |
|
|
63 |
|
|
64 |
// Register a combo box editor to be displayed in the filter row
|
|
65 |
// cell when a value is selected from the combo, the object is
|
|
66 |
// converted to a string using the converter (registered below)
|
|
67 |
|
|
68 |
for (int i = 1; i <= editor.areas.size(); ++i) {
|
|
69 |
configRegistry.registerConfigAttribute(
|
|
70 |
EditConfigAttributes.CELL_EDITOR,
|
|
71 |
new ComboBoxCellEditor(StatusComboBoxDataProvider.getValues()),
|
|
72 |
DisplayMode.NORMAL,
|
|
73 |
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + i);
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
configRegistry.registerConfigAttribute(
|
|
78 |
FilterRowConfigAttributes.FILTER_DISPLAY_CONVERTER,
|
|
79 |
new StatusDisplayConverter(),
|
|
80 |
DisplayMode.NORMAL,
|
|
81 |
FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX+i);
|
|
82 |
|
|
83 |
configRegistry.registerConfigAttribute(
|
|
84 |
CellConfigAttributes.DISPLAY_CONVERTER,
|
|
85 |
new StatusDisplayConverter(),
|
|
86 |
DisplayMode.NORMAL,
|
|
87 |
DistributionEditorConfigLabelAccumulator.STATUS);
|
|
88 |
|
|
89 |
}
|
51 |
90 |
|
52 |
91 |
|
53 |
92 |
// // register the FilterRowTextCellEditor in the first column which
|
ref #7854: add filter column to distribution columns