From d050a47357a3bfa9775916a20bcd10e819a2132a Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 19 Sep 2017 21:50:42 +0200 Subject: [PATCH] ensure string consistency --- .../src/com/minres/rdl/ui/preferences/RdlPreferencePage.xtend | 2 +- .../com/minres/rdl/ui/preferences/RdlPreferencePage.java | 2 +- .../src/com/minres/rdl/preferences/PreferenceConstants.java | 4 ++++ .../src/com/minres/rdl/preferences/PreferenceInitializer.java | 4 ++-- .../src/com/minres/rdl/preferences/RdlPreferences.java | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/preferences/RdlPreferencePage.xtend b/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/preferences/RdlPreferencePage.xtend index 45da980..b7b28bb 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/preferences/RdlPreferencePage.xtend +++ b/com.minres.rdl.parent/com.minres.rdl.ui/src/com/minres/rdl/ui/preferences/RdlPreferencePage.xtend @@ -13,7 +13,7 @@ class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchP new() { super(GRID) - val store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "com.minres.rdl.rdl"); + val store = new ScopedPreferenceStore(InstanceScope.INSTANCE, PreferenceConstants.SCOPE_NAME); setPreferenceStore(store); setDescription("Code generator configuration options"); } diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/preferences/RdlPreferencePage.java b/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/preferences/RdlPreferencePage.java index f386630..ceac146 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/preferences/RdlPreferencePage.java +++ b/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/preferences/RdlPreferencePage.java @@ -14,7 +14,7 @@ import org.eclipse.ui.preferences.ScopedPreferenceStore; public class RdlPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public RdlPreferencePage() { super(FieldEditorPreferencePage.GRID); - final ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, "com.minres.rdl.rdl"); + final ScopedPreferenceStore store = new ScopedPreferenceStore(InstanceScope.INSTANCE, PreferenceConstants.SCOPE_NAME); this.setPreferenceStore(store); this.setDescription("Code generator configuration options"); } diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceConstants.java b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceConstants.java index d37a29a..9611520 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceConstants.java +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceConstants.java @@ -5,8 +5,12 @@ package com.minres.rdl.preferences; */ public class PreferenceConstants { + public static final String SCOPE_NAME = "com.minres.rdl.rdl"; + public static final String P_GENERATE_CSV = "booleanCsvPreference"; public static final String P_ADDRESSUNIT = "choiceAddrunitPreference"; + public static final String ADDRESSUNIT_PROP = "com.minres.rdl.addrunit"; + } diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceInitializer.java b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceInitializer.java index 882789b..5e0460f 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceInitializer.java +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/PreferenceInitializer.java @@ -18,7 +18,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences() { IEclipsePreferences store = getPreferenceStore(); store.putBoolean(PreferenceConstants.P_GENERATE_CSV, true); - String value = System.getProperty("com.minres.rdl.rdl.addrunit"); + String value = System.getProperty(PreferenceConstants.ADDRESSUNIT_PROP); if(value!=null){ if("byte".equals(value)){ store.put(PreferenceConstants.P_ADDRESSUNIT, "byte"); @@ -35,7 +35,7 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer { } public static IEclipsePreferences getPreferenceStore() { - return DefaultScope.INSTANCE.getNode("com.minres.rdl.rdl"); + return DefaultScope.INSTANCE.getNode(PreferenceConstants.SCOPE_NAME); } } diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/RdlPreferences.java b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/RdlPreferences.java index a9370ac..1cedea5 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/RdlPreferences.java +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/preferences/RdlPreferences.java @@ -10,10 +10,10 @@ public class RdlPreferences { } public static String getAddrUnit() { - return getPreferenceStore().get(PreferenceConstants.P_ADDRESSUNIT, System.getProperty("com.minres.rdl.rdl.addrunit")); + return getPreferenceStore().get(PreferenceConstants.P_ADDRESSUNIT, System.getProperty(PreferenceConstants.ADDRESSUNIT_PROP)); } public static IEclipsePreferences getPreferenceStore() { - return InstanceScope.INSTANCE.getNode("com.minres.rdl.rdl"); + return InstanceScope.INSTANCE.getNode(PreferenceConstants.SCOPE_NAME); } } \ No newline at end of file