blob: 684a468dd0e33139c5eddfd45f6d13bf22d45ae6 (
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
|
/*****************************************************************************
* Copyright (c) 2013 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
*
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.interactionoverview.preferences;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.infra.gmfdiag.common.preferences.PreferencesConstantsHelper;
import org.eclipse.papyrus.uml.diagram.interactionoverview.provider.ElementTypes;
public class ControlFlowPreferencePage extends InteractionOverviewDiagramLinkPreferencePage {
/** Constant key to access preferences */
protected static String prefKey = ElementTypes.DIAGRAM_ID + "_ControlFlow"; //$NON-NLS-1$
/** The compartments default visibility for preferences */
public static final Map<String, Boolean> labelDefaultVisibilityMap;
/** Static attribute initialization */
static {
labelDefaultVisibilityMap = new LinkedHashMap<String, Boolean>();
labelDefaultVisibilityMap.put("Name", Boolean.TRUE); //$NON-NLS-1$
labelDefaultVisibilityMap.put("Weight", Boolean.TRUE); //$NON-NLS-1$
labelDefaultVisibilityMap.put("Guard", Boolean.TRUE); //$NON-NLS-1$
labelDefaultVisibilityMap.put("Stereotype", Boolean.TRUE); //$NON-NLS-1$
labelDefaultVisibilityMap.put("undefined_role", Boolean.TRUE); //$NON-NLS-1$
// Start of user code custom static initializations
// End of user code
Collections.unmodifiableMap(labelDefaultVisibilityMap);
}
/** Default constructor */
public ControlFlowPreferencePage() {
super();
setPreferenceKey(ElementTypes.DIAGRAM_ID + "_ControlFlow"); //$NON-NLS-1$
}
/**
* Initialize defaults using a specified {@link IPreferenceStore}
*
* @param store
* the preference store.
*/
public static void initDefaults(final IPreferenceStore store) {
// Start of user code custom default initializations
// End of user code
for (final String labelName : labelDefaultVisibilityMap.keySet()) {
final String showLabelKey = PreferencesConstantsHelper.getCompartmentElementConstant(prefKey, labelName, PreferencesConstantsHelper.LABEL_VISIBILITY);
store.setDefault(showLabelKey, labelDefaultVisibilityMap.get(labelName));
}
}
/**
* {@inheritDoc}
*/
@Override
protected void initializeLabelsList() {
for (final String name : labelDefaultVisibilityMap.keySet()) {
this.labelsList.add(name);
}
}
}
|