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
87
88
89
90
|
/*****************************************************************************
* Copyright (c) 2011 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:
* Amine EL KOUHEN (CEA LIST/LIFL) - Amine.El-Kouhen@lifl.fr
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.deployment.preferences;
import java.util.Map;
import java.util.TreeMap;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.papyrus.infra.gmfdiag.preferences.pages.AbstractPapyrusLinkPreferencePage;
import org.eclipse.papyrus.infra.gmfdiag.preferences.utils.PreferenceConstantHelper;
import org.eclipse.papyrus.uml.diagram.common.util.StringComparator;
import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DeploymentDiagramEditPart;
import org.eclipse.papyrus.uml.diagram.deployment.part.UMLDiagramEditorPlugin;
/**
* @generated
*/
public class ManifestationPreferencePage extends AbstractPapyrusLinkPreferencePage {
/**
* @generated
*/
public ManifestationPreferencePage() {
super();
setPreferenceKey(DeploymentDiagramEditPart.MODEL_ID + "_Manifestation");
}
/**
* @generated
*/
@Override
protected String getBundleId() {
return UMLDiagramEditorPlugin.ID;
}
/**
* @generated
*/
public static void initDefaults(IPreferenceStore store) {
String key = DeploymentDiagramEditPart.MODEL_ID + "_Manifestation";
Map<String, Boolean> map = getStaticLabelVisibilityPreferences();
for(String role : map.keySet()) {
String preferenceName = PreferenceConstantHelper.getLabelElementConstant(key, role, PreferenceConstantHelper.LABEL_VISIBILITY);
store.setDefault(preferenceName, map.get(role));
}
}
/**
* @generated
*/
private static TreeMap<String, String> getStaticLabelRole() {
TreeMap<String, String> map = new TreeMap<String, String>(new StringComparator());
map.put("Name", "");//$NON-NLS-1$ //$NON-NLS-2$
map.put("Stereotype", "");//$NON-NLS-1$ //$NON-NLS-2$
return map;
}
/**
* @generated
*/
private static TreeMap<String, Boolean> getStaticLabelVisibilityPreferences() {
TreeMap<String, Boolean> map = new TreeMap<String, Boolean>();
map.put("Name", Boolean.TRUE);
map.put("Stereotype", Boolean.TRUE);
return map;
}
/**
* @generated
*/
@Override
protected TreeMap<String, String> getLabelRole() {
return getStaticLabelRole();
}
}
|