Skip to content

Commit a8434ca

Browse files
committed
Use getPreferenceStore() instead of static field PREFERENCES
- We want to avoid using these global static fields
1 parent eeb4dcb commit a8434ca

File tree

86 files changed

+204
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+204
-230
lines changed

Diff for: com.archimatetool.canvas/src/com/archimatetool/canvas/figures/CanvasStickyFigure.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected void paintFigure(Graphics graphics) {
185185

186186
@Override
187187
public IFigure getToolTip() {
188-
if(!ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.VIEW_TOOLTIPS)) {
188+
if(!ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.VIEW_TOOLTIPS)) {
189189
return null;
190190
}
191191

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/ArchiPlugin.java

-26
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414

1515
import org.eclipse.core.runtime.FileLocator;
1616
import org.eclipse.core.runtime.Platform;
17-
import org.eclipse.jface.preference.IPreferenceStore;
1817
import org.eclipse.osgi.service.datalocation.Location;
1918
import org.eclipse.ui.plugin.AbstractUIPlugin;
20-
import org.osgi.framework.BundleContext;
2119
import org.osgi.framework.Version;
2220

2321

@@ -49,34 +47,10 @@ public class ArchiPlugin extends AbstractUIPlugin {
4947
*/
5048
public static ArchiPlugin INSTANCE;
5149

52-
/**
53-
* The shared Preference store
54-
*/
55-
public static IPreferenceStore PREFERENCES;
56-
5750
public ArchiPlugin() {
58-
}
59-
60-
/**
61-
* This method is called upon plug-in activation
62-
*/
63-
@Override
64-
public void start(BundleContext context) throws Exception {
65-
super.start(context);
66-
6751
INSTANCE = this;
68-
PREFERENCES = getPreferenceStore();
6952
}
7053

71-
/**
72-
* This method is called when the plug-in is stopped
73-
*/
74-
@Override
75-
public void stop(BundleContext context) throws Exception {
76-
// super must be *last*
77-
super.stop(context);
78-
}
79-
8054
/**
8155
* @return The User data folder use for Archi data
8256
*/

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/ArchiWorkbenchAdvisor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void initialize(IWorkbenchConfigurer configurer) {
5151
"true".equals(System.getProperty("showheap")));
5252

5353
// Edge Browser on Windows
54-
if(PlatformUtils.isWindows() && ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.EDGE_BROWSER)) {
54+
if(PlatformUtils.isWindows() && ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.EDGE_BROWSER)) {
5555
System.setProperty("org.eclipse.swt.browser.DefaultType", "edge");
5656
}
5757

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/ArchiWorkbenchWindowAdvisor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public ArchiWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
3131
super(configurer);
3232

3333
// Status Line
34-
boolean doShowStatusLine = ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SHOW_STATUS_LINE);
34+
boolean doShowStatusLine = ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.SHOW_STATUS_LINE);
3535
configurer.setShowStatusLine(doShowStatusLine);
3636
}
3737

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/actions/CheckForNewVersionAction.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ String getOnlineVersion(URL url) throws IOException {
6464
@Override
6565
public void run() {
6666
try {
67-
String versionFile = ArchiPlugin.PREFERENCES.getString(IPreferenceConstants.UPDATE_URL);
67+
String versionFile = ArchiPlugin.INSTANCE.getPreferenceStore().getString(IPreferenceConstants.UPDATE_URL);
6868

6969
if(!StringUtils.isSet(versionFile)) {
7070
return;
@@ -76,7 +76,7 @@ public void run() {
7676
String thisVersion = ArchiPlugin.INSTANCE.getVersion();
7777

7878
if(StringUtils.compareVersionNumbers(newVersion, thisVersion) > 0) {
79-
String downloadURL = ArchiPlugin.PREFERENCES.getString(IPreferenceConstants.DOWNLOAD_URL);
79+
String downloadURL = ArchiPlugin.INSTANCE.getPreferenceStore().getString(IPreferenceConstants.DOWNLOAD_URL);
8080

8181
// No download URL
8282
if(!StringUtils.isSet(downloadURL)) {
@@ -115,7 +115,7 @@ public void run() {
115115

116116
@Override
117117
public boolean isEnabled() {
118-
String versionFile = ArchiPlugin.PREFERENCES.getString(IPreferenceConstants.UPDATE_URL);
118+
String versionFile = ArchiPlugin.INSTANCE.getPreferenceStore().getString(IPreferenceConstants.UPDATE_URL);
119119
return StringUtils.isSet(versionFile);
120120
}
121121

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/actions/MRUMenuManager.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private List<File> loadMRUListFromPreferenceStore() {
6060
List<File> list = new ArrayList<File>();
6161

6262
for(int i = 0; i < getPreferencesMRUMax(); i++) {
63-
String path = ArchiPlugin.PREFERENCES.getString(MRU_PREFS_KEY + i);
63+
String path = ArchiPlugin.INSTANCE.getPreferenceStore().getString(MRU_PREFS_KEY + i);
6464
if(StringUtils.isSet(path)) {
6565
list.add(new File(path));
6666
}
@@ -96,12 +96,12 @@ void addToList(File file) {
9696
private void saveList() {
9797
// Clear
9898
for(int i = 0; i < 50; i++) {
99-
ArchiPlugin.PREFERENCES.setValue(MRU_PREFS_KEY + i, "");
99+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue(MRU_PREFS_KEY + i, "");
100100
}
101101

102102
// Save
103103
for(int i = 0; i < getMRUList().size(); i++) {
104-
ArchiPlugin.PREFERENCES.setValue(MRU_PREFS_KEY + i, getMRUList().get(i).getAbsolutePath());
104+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue(MRU_PREFS_KEY + i, getMRUList().get(i).getAbsolutePath());
105105
}
106106
}
107107

@@ -129,7 +129,7 @@ void clearAll() {
129129
}
130130

131131
int getPreferencesMRUMax() {
132-
int max = ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.MRU_MAX);
132+
int max = ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.MRU_MAX);
133133
if(max < 3) {
134134
max = 3;
135135
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/actions/SetConceptTypeExtensionContributionFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private void changeElementTypes(EClass eClass, Set<IArchimateElement> elements)
222222
for(Entry<IArchimateModel, Set<IArchimateElement>> entry : elementsMap.entrySet()) {
223223
CommandStack stack = (CommandStack)entry.getKey().getAdapter(CommandStack.class);
224224
CompoundCommand cmd = SetConceptTypeCommandFactory.createSetElementTypeCommand(eClass, entry.getValue(),
225-
ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.ADD_DOCUMENTATION_NOTE_ON_RELATION_CHANGE));
225+
ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.ADD_DOCUMENTATION_NOTE_ON_RELATION_CHANGE));
226226
if(stack != null && cmd != null) {
227227
// Wrap the command in a NonNotifyingCompoundCommand to minimise event noise
228228
stack.execute(new NonNotifyingCompoundCommand(cmd));

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/AbstractDiagramEditor.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public CommandStack getCommandStack() {
261261
setPartName(input.getName());
262262

263263
// Listen to App Prefs changes
264-
ArchiPlugin.PREFERENCES.addPropertyChangeListener(appPreferencesListener);
264+
ArchiPlugin.INSTANCE.getPreferenceStore().addPropertyChangeListener(appPreferencesListener);
265265
}
266266

267267
@Override
@@ -448,7 +448,7 @@ protected void setProperties() {
448448
* Apply grid Prefs
449449
*/
450450
protected void applyUserGridPreferences() {
451-
IPreferenceStore store = ArchiPlugin.PREFERENCES;
451+
IPreferenceStore store = ArchiPlugin.INSTANCE.getPreferenceStore();
452452

453453
// Grid Spacing
454454
int gridSize = store.getInt(IPreferenceConstants.GRID_SIZE);
@@ -471,7 +471,7 @@ protected void applyUserGridPreferences() {
471471
@Override
472472
protected PaletteViewerProvider createPaletteViewerProvider() {
473473
// Ensure palette is showing or not
474-
boolean showPalette = ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.PALETTE_STATE);
474+
boolean showPalette = ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.PALETTE_STATE);
475475
getPalettePreferences().setPaletteState(showPalette ? FlyoutPaletteComposite.STATE_PINNED_OPEN : FlyoutPaletteComposite.STATE_COLLAPSED);
476476

477477
return new PaletteViewerProvider(getEditDomain()) {
@@ -1060,7 +1060,7 @@ public void dispose() {
10601060
super.dispose();
10611061

10621062
// Remove Preference listener
1063-
ArchiPlugin.PREFERENCES.removePropertyChangeListener(appPreferencesListener);
1063+
ArchiPlugin.INSTANCE.getPreferenceStore().removePropertyChangeListener(appPreferencesListener);
10641064

10651065
// Remove eCore adapter listener objects
10661066
eCoreAdapter.remove(getModel(), getModel() != null ? getModel().getArchimateModel() : null);

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/ArchimateDiagramEditor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected void setViewpoint() {
7171
getPaletteRoot().updateViewpoint();
7272

7373
// If the preference is to hide elements then refresh the model contents
74-
if(!ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.VIEWPOINTS_GHOST_DIAGRAM_ELEMENTS)) {
74+
if(!ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.VIEWPOINTS_GHOST_DIAGRAM_ELEMENTS)) {
7575
getGraphicalViewer().setContents(getModel());
7676
}
7777
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/ArchimateDiagramEditorPalette.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private void createSpecializationsGroup() {
198198
}
199199
fSpecializationEntries.clear();
200200

201-
if(!ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SHOW_SPECIALIZATIONS_IN_PALETTE)) {
201+
if(!ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.SHOW_SPECIALIZATIONS_IN_PALETTE)) {
202202
fDiagramModel.getArchimateModel().eAdapters().remove(eAdapter);
203203
return;
204204
}
@@ -304,7 +304,7 @@ private void createArchimateElementGroup(String title, EClass[] types) {
304304

305305
private boolean isAllowedConceptForViewpoint(EClass eClass) {
306306
// Preference to show all pallette elements regardless of Viewpoint
307-
if(!ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.VIEWPOINTS_HIDE_PALETTE_ELEMENTS)) {
307+
if(!ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.VIEWPOINTS_HIDE_PALETTE_ELEMENTS)) {
308308
return true;
309309
}
310310

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/ArchimateDiagramModelFactory.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static IDiagramModelArchimateObject createDiagramModelArchimateObject(IAr
4848
IDiagramModelArchimateObject dmo = IArchimateFactory.eINSTANCE.createDiagramModelArchimateObject();
4949
dmo.setArchimateElement(element);
5050
// Figure Type
51-
dmo.setType(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DEFAULT_FIGURE_PREFIX + element.eClass().getName()));
51+
dmo.setType(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DEFAULT_FIGURE_PREFIX + element.eClass().getName()));
5252

5353
// Add new bounds with a default user size
5454
IGraphicalObjectUIProvider provider = (IGraphicalObjectUIProvider)ObjectUIFactory.INSTANCE.getProvider(dmo);
@@ -62,7 +62,7 @@ public static IDiagramModelArchimateObject createDiagramModelArchimateObject(IAr
6262
ColorFactory.setDefaultColors(dmo);
6363

6464
// Gradient
65-
dmo.setGradient(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DEFAULT_GRADIENT));
65+
dmo.setGradient(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DEFAULT_GRADIENT));
6666

6767
return dmo;
6868
}
@@ -139,15 +139,15 @@ else if(object instanceof IDiagramModelGroup) {
139139
group.setName(ArchiLabelProvider.INSTANCE.getDefaultName(fTemplate));
140140
ColorFactory.setDefaultColors(group);
141141
// Gradient
142-
group.setGradient(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DEFAULT_GRADIENT));
142+
group.setGradient(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DEFAULT_GRADIENT));
143143
}
144144

145145
// Note
146146
else if(object instanceof IDiagramModelNote) {
147147
IDiagramModelNote note = (IDiagramModelNote)object;
148148
ColorFactory.setDefaultColors(note);
149149
// Gradient
150-
note.setGradient(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DEFAULT_GRADIENT));
150+
note.setGradient(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DEFAULT_GRADIENT));
151151
}
152152

153153
// Connection

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/FloatingPalette.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ public PaletteState getPaletteState() {
150150
private void saveState(Shell shell) {
151151
Rectangle bounds = shell.getBounds();
152152
String s = "" + bounds.x + "," + bounds.y + "," + bounds.width + "," + bounds.height + "," + fPaletteState.isOpen; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
153-
ArchiPlugin.PREFERENCES.setValue("pallete_floater_state", s); //$NON-NLS-1$
153+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue("pallete_floater_state", s); //$NON-NLS-1$
154154
}
155155

156156
private void loadState() {
157-
String s = ArchiPlugin.PREFERENCES.getString("pallete_floater_state"); //$NON-NLS-1$
157+
String s = ArchiPlugin.INSTANCE.getPreferenceStore().getString("pallete_floater_state"); //$NON-NLS-1$
158158
if(StringUtils.isSet(s)) {
159159
try {
160160
String[] bits = s.split(","); //$NON-NLS-1$

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/ImageExportProvider.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public void init(IExportDialogAdapter adapter, Composite container, IFigure figu
100100
*/
101101
protected void loadPreferences() {
102102
// Value of scale
103-
int scale = ArchiPlugin.PREFERENCES.getInt(PREFS_IMAGE_SCALE);
103+
int scale = ArchiPlugin.INSTANCE.getPreferenceStore().getInt(PREFS_IMAGE_SCALE);
104104
if(scale < SCALE_MIN || scale > SCALE_MAX) {
105105
scale = 100;
106106
}
@@ -113,6 +113,6 @@ protected void loadPreferences() {
113113
protected void savePreferences() {
114114
// Value of scale
115115
int scale = fScaleSpinner.getSelection();
116-
ArchiPlugin.PREFERENCES.setValue(PREFS_IMAGE_SCALE, scale);
116+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue(PREFS_IMAGE_SCALE, scale);
117117
}
118118
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/actions/CopySnapshot.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ public Command getPasteCommand(IDiagramModel targetDiagramModel, GraphicalViewer
456456
// Create new copies of Archimate concepts or not
457457
if(pasteSpecial) {
458458
// Now decide what to do depending of preferences
459-
switch(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DIAGRAM_PASTE_SPECIAL_BEHAVIOR)) {
459+
switch(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DIAGRAM_PASTE_SPECIAL_BEHAVIOR)) {
460460
case 0:
461461
// Force by-ref
462462
fDoCreateNewArchimateComponents = !isSourceAndTargetArchiMateModelSame();

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/actions/ToggleGridEnabledAction.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public ToggleGridEnabledAction() {
3030

3131
@Override
3232
public boolean isChecked() {
33-
return ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.GRID_SNAP);
33+
return ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.GRID_SNAP);
3434
}
3535

3636
@Override
3737
public void run() {
38-
ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.GRID_SNAP, !isChecked());
38+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue(IPreferenceConstants.GRID_SNAP, !isChecked());
3939
}
4040
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/actions/ToggleGridVisibleAction.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public ToggleGridVisibleAction() {
3030

3131
@Override
3232
public boolean isChecked() {
33-
return ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.GRID_VISIBLE);
33+
return ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.GRID_VISIBLE);
3434
}
3535

3636
@Override
3737
public void run() {
38-
ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.GRID_VISIBLE, !isChecked());
38+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue(IPreferenceConstants.GRID_VISIBLE, !isChecked());
3939
}
4040
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/actions/ToggleSnapToAlignmentGuidesAction.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public ToggleSnapToAlignmentGuidesAction() {
3030

3131
@Override
3232
public boolean isChecked() {
33-
return ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.GRID_SHOW_GUIDELINES);
33+
return ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.GRID_SHOW_GUIDELINES);
3434
}
3535

3636
@Override
3737
public void run() {
38-
ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.GRID_SHOW_GUIDELINES, !isChecked());
38+
ArchiPlugin.INSTANCE.getPreferenceStore().setValue(IPreferenceConstants.GRID_SHOW_GUIDELINES, !isChecked());
3939
}
4040
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/commands/AddDiagramModelReferenceCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public AddDiagramModelReferenceCommand(IDiagramModelContainer parent, IDiagramMo
4242
Dimension size = provider.getDefaultSize();
4343
fReference.setBounds(x, y, size.width, size.height);
4444

45-
fReference.setGradient(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DEFAULT_GRADIENT));
45+
fReference.setGradient(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DEFAULT_GRADIENT));
4646

4747
ColorFactory.setDefaultColors(fReference);
4848
}

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/commands/CreateDiagramObjectCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void redo() {
9797
* Edit name of new object if set in Preferences
9898
*/
9999
protected void editNameOfNewObject() {
100-
if(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.EDIT_NAME_ON_NEW_OBJECT)) {
100+
if(ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.EDIT_NAME_ON_NEW_OBJECT)) {
101101
EditPartViewer viewer = fParentEditPart.getViewer();
102102
if(viewer != null) {
103103
EditPart editPart = (EditPart)viewer.getEditPartRegistry().get(fChild);

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/commands/SetConstraintObjectCommand.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public void redo() {
108108
* If the option is set, move children in relation to new resize x, y
109109
*/
110110
protected void createChildConstraintCommands() {
111-
if(ArchiPlugin.PREFERENCES.getInt(IPreferenceConstants.DIAGRAM_OBJECT_RESIZE_BEHAVIOUR) != 0 ||
111+
if(ArchiPlugin.INSTANCE.getPreferenceStore().getInt(IPreferenceConstants.DIAGRAM_OBJECT_RESIZE_BEHAVIOUR) != 0 ||
112112
fRequest == null ||
113113
!(fObject instanceof IDiagramModelContainer)) {
114114
return;

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/dialog/NewNestedRelationDialog.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ private List<NestedConnectionInfo> createValidRelationships() {
208208
* @return True if type is an allowed relation type for a given Viewpoint
209209
*/
210210
private boolean isAllowedRelationInViewpoint(IDiagramModelArchimateComponent dmc, EClass type) {
211-
if(!ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.VIEWPOINTS_HIDE_PALETTE_ELEMENTS)) {
211+
if(!ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.VIEWPOINTS_HIDE_PALETTE_ELEMENTS)) {
212212
return true;
213213
}
214214

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/dialog/NewNestedRelationsDialog.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private List<NestedConnectionInfo> createValidRelations(IDiagramModelArchimateOb
157157
* @return True if type is an allowed relation type for a given Viewpoint
158158
*/
159159
private boolean isAllowedRelationInViewpoint(IDiagramModelArchimateComponent dmc, EClass type) {
160-
if(!ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.VIEWPOINTS_HIDE_PALETTE_ELEMENTS)) {
160+
if(!ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.VIEWPOINTS_HIDE_PALETTE_ELEMENTS)) {
161161
return true;
162162
}
163163

Diff for: com.archimatetool.editor/src/com/archimatetool/editor/diagram/editparts/AbstractArchimateElementEditPart.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected Set<IDiagramModelObject> getObjectsToUpdateConnections(IConnectable co
181181
@Override
182182
protected void refreshFigure() {
183183
// Set Enabled according to current Viewpoint
184-
if(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.VIEWPOINTS_GHOST_DIAGRAM_ELEMENTS)) {
184+
if(ArchiPlugin.INSTANCE.getPreferenceStore().getBoolean(IPreferenceConstants.VIEWPOINTS_GHOST_DIAGRAM_ELEMENTS)) {
185185
getFigure().setEnabled(ViewpointManager.INSTANCE.isAllowedDiagramModelComponent(getModel()));
186186
}
187187
else {

0 commit comments

Comments
 (0)