Changeset 395 for trunk/org.modelica.mdt.core/src/org/modelica
- Timestamp:
- 03/07/06 11:38:06 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/org.modelica.mdt.core/src/org/modelica/mdt/core/preferences/PreferenceManager.java
r389 r395 48 48 49 49 /** 50 * Class used to initialize default preference values. 50 * This class manages the settings for the omc plugin (and at the moment the omc 51 * and ui plugin as well, but that's just uggly) 52 * 53 * The class provides two services, it sets the default settings and 54 * gives an easy access to current settings via the get<Setting_Name> methods. 55 * 56 * This class does not provides means for changing settings. To modify the 57 * settings the preference store object should be fetched from the core plugin. 58 * 59 * Following settings are available: 60 * 61 * DisplayCompErrors: 62 * if set to false then compatibility error dialogs will not be displayed when 63 * omc replys with something unexpected, the error will only be logged 64 * 65 * UseStandardOmcPath: 66 * if set to true the OPENMODELICAHOME environment variable will be used to 67 * find the omc binary. if set to false the CustomOmcPath settings value will 68 * be used instead, se below. 69 * 70 * CustomOmcPath: 71 * the value of this setting can be used as alternative path to find omc binary. 72 * used if UseStandardOmcPath settings is set to false, se above. 51 73 */ 52 74 public class PreferenceManager extends AbstractPreferenceInitializer 53 75 { 54 76 /* settings tags in the preference store */ 55 77 public static final String DISPLAY_COMPATIBILTY_ERRORS = 56 "DisplayCompatibilityErrors"; 78 "DisplayCompatibilityErrors"; 79 public static final String USE_STANDARD_OMC_PATH = 80 "UseStandardOmcPath"; 81 public static final String CUSTOM_OMC_PATH = 82 "CustomOmcPath"; 57 83 58 84 private static IPreferenceStore store = null; … … 63 89 public void initializeDefaultPreferences() 64 90 { 65 /* setup default settings */ 66 getStore().setDefault(DISPLAY_COMPATIBILTY_ERRORS, true); 91 /* 92 * setup default settings 93 */ 94 IPreferenceStore store = getStore(); 95 96 store.setDefault(DISPLAY_COMPATIBILTY_ERRORS, true); 97 store.setDefault(USE_STANDARD_OMC_PATH, true); 98 store.setDefault(CUSTOM_OMC_PATH, ""); 67 99 } 68 100 … … 77 109 78 110 /** 79 * @return the current setting for display compatibility errors111 * @return current setting for 'display compatibility errors' 80 112 */ 81 113 public static boolean getDisplayCompErrors() … … 83 115 return getStore().getBoolean(DISPLAY_COMPATIBILTY_ERRORS); 84 116 } 117 118 /** 119 * @return current settig for 'use standard omc path (that is $OPENMODELICAHOME)' 120 */ 121 public static boolean getUseStandardOmcPath() 122 { 123 return getStore().getBoolean(USE_STANDARD_OMC_PATH); 124 } 125 126 /** 127 * @return current settig for 'custom omc path' 128 */ 129 public static String getCustomOmcPath() 130 { 131 return getStore().getString(CUSTOM_OMC_PATH); 132 } 85 133 }
Note: See TracChangeset
for help on using the changeset viewer.