Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: c2b136d31d1cc034680e11d7321ea7d8907f3d0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*****************************************************************************
 * Copyright (c) 2014 CEA LIST.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *
 *		 Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.infra.nattable.preferences;


/**
 *
 * @author Vincent Lorenzo
 *
 */
public class TablePreferencesConstantsHelper {

	private TablePreferencesConstantsHelper() {
		// to prevent instanciation
	}

	/**
	 * Prefix for preference for Papyrus nattable Level editor
	 */
	public final static String PAPYRUS_TABLE_EDITOR_PREFERENCE_PREFIX = "PAPYRUS_TABLE_EDITOR"; //$NON-NLS-1$

	/**
	 * Prefix for preference for Diagram Level
	 */
	public final static String TABLE_PREFERENCE_PREFIX = "NATTABLE_"; //$NON-NLS-1$

	/**
	 * Prefix for preference for element Level
	 */
	public final static String TABLE_ELEMENT = "TABLE_ELEMENT_"; //$NON-NLS-1$

	/**
	 * Get the preference constant used to store the preference of an element.
	 *
	 * @param elementName
	 *            the name of the element
	 * @param preferenceType
	 *            the type of preference to store. It must be a value defined in {@link TablePreferencesConstantsHelper}
	 * @return the constant used.
	 */
	public static String getConstant(String elementName, int preferenceType) {
		throw new UnsupportedOperationException("Not yet implemented");//$NON-NLS-1$
		// StringBuffer sb = new StringBuffer();
		// sb.append(elementName);
		//		sb.append("."); //$NON-NLS-1$
		// switch(preferenceType) {
		//
		// default:
		// break;
		// }
		// return sb.toString();
	}

	/**
	 *
	 * @param preferenceType
	 *            the type of preference to store. It must be a value defined in {@link TablePreferencesConstantsHelper}
	 * @return get the preference key at the papyrus editor level
	 */
	public static String getPapyrusEditorConstant(int preferenceType) {
		return getConstant(PAPYRUS_TABLE_EDITOR_PREFERENCE_PREFIX, preferenceType);
	}

	/**
	 *
	 * @param diagramKind
	 *            the kind of diagram.
	 * @param preferenceType
	 *            the type of preference to store. It must be a value defined in {@link PreferenceConstantHelper}
	 * @return the preference key at the diagram level
	 */
	public static String getNatTableConstant(String tableKind, int preferenceType) {
		return TABLE_PREFERENCE_PREFIX + getConstant(tableKind, preferenceType);
	}
}

Back to the top