Skip to content

Package: TableConfiguration

TableConfiguration

nameinstructionbranchcomplexitylinemethod
static {...}
M: 0 C: 48
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 12
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2019 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Mat Hansen - initial API and implementation
13: * Christian W. Damus - bug 534829
14: ******************************************************************************/
15: package org.eclipse.emfforms.spi.swt.table;
16:
17: import java.util.Arrays;
18: import java.util.Collections;
19: import java.util.LinkedHashSet;
20: import java.util.Map;
21: import java.util.Set;
22:
23: import org.eclipse.emfforms.common.Feature;
24:
25: /**
26: * A TableConfiguration is used to describe how a table viewer should be configured.
27: *
28: * Currently all configured TableConfiguration keys are passed down to each column as well.
29: * This is subject to change.
30: *
31: * @author Mat Hansen <mhansen@eclipsesource.com>
32: *
33: * @noextend This class is not intended to be subclassed by clients.
34: * @noimplement This interface is not intended to be implemented by clients.
35: *
36: */
37: public interface TableConfiguration {
38:
39:         /**
40:          * Feature toggle for column hide/show support.
41:          */
42:         Feature FEATURE_COLUMN_HIDE_SHOW = //
43:                 new Feature("column_hide_show", "Enable column hide/show support", Feature.STRATEGY.INHERIT); //$NON-NLS-1$ //$NON-NLS-2$
44:
45:         /**
46:          * Feature toggle for column filter support.
47:          */
48:         Feature FEATURE_COLUMN_FILTER = //
49:                 new Feature("column_filter", "Enable column filter support", Feature.STRATEGY.INHERIT); //$NON-NLS-1$ //$NON-NLS-2$
50:
51:         /**
52:          * Feature toggle for column regular expression filter support.
53:          *
54:          * @since 1.21
55:          */
56:         Feature FEATURE_COLUMN_REGEX_FILTER = //
57:                 new Feature("column_regex_filter", "Enable column regex filter support", Feature.STRATEGY.INHERIT); //$NON-NLS-1$ //$NON-NLS-2$
58:
59:         /**
60:          * All configurable features.
61:          *
62:          * @since 1.21
63:          */
64:         Set<Feature> ALL_FEATURES = Collections.unmodifiableSet(new LinkedHashSet<>(
65:                 Arrays.asList(FEATURE_COLUMN_HIDE_SHOW,
66:                         FEATURE_COLUMN_FILTER,
67:                         FEATURE_COLUMN_REGEX_FILTER)));
68:
69:         /**
70:          * All configurable features.
71:          *
72:          * @deprecated Since 1.21, use the immutable {@link #ALL_FEATURES} set instead of this,
73:          * which can be modified in place.
74:          */
75:         @Deprecated
76:         Feature[] FEATURES = ALL_FEATURES.toArray(new Feature[0]);
77:
78:         /**
79:          * Table data configuration key.
80:          */
81:         String ID = "emfforms.table.configuration"; //$NON-NLS-1$
82:
83:         /** Data key for a domain model reference. */
84:         String DMR = "domain_model_reference"; //$NON-NLS-1$
85:
86:         /**
87:          * Returns a static array of enabled features.
88:          *
89:          * @return array of enabled features.
90:          */
91:         Set<Feature> getEnabledFeatures();
92:
93:         /**
94:          * Get the underlying data map.
95:          *
96:          * @return data map object
97:          */
98:         Map<String, Object> getData();
99:
100:         /**
101:          * Dispose this configuration and all its properties.
102:          */
103:         void dispose();
104:
105: }