1
1
package it .baeyens .arduino .common ;
2
2
3
+ import java .io .File ;
3
4
import java .util .HashMap ;
4
5
import java .util .Map ;
5
6
import java .util .Map .Entry ;
16
17
import org .osgi .service .prefs .BackingStoreException ;
17
18
18
19
/**
19
- * ArduinoPreferences is a class containing only static methods that help
20
- * managing the preferences.
20
+ * ArduinoPreferences is a class containing only static methods that help managing the preferences.
21
21
*
22
22
* @author jan Baeyens
23
23
*
@@ -41,12 +41,10 @@ public static void setAutomaticallyIncludeLibraries(boolean value) {
41
41
}
42
42
43
43
/***
44
- * get the stored option whether a build before the upload is wanted or not.
45
- * If nothing is stored the option is ask and this method will pop up a
44
+ * get the stored option whether a build before the upload is wanted or not. If nothing is stored the option is ask and this method will pop up a
46
45
* dialogbox
47
46
*
48
- * @return true if a build is wanted before upload false if no build is
49
- * wanted before upload
47
+ * @return true if a build is wanted before upload false if no build is wanted before upload
50
48
*/
51
49
public static boolean getBuildBeforeUploadOption () {
52
50
@@ -90,8 +88,7 @@ public void run() {
90
88
}
91
89
92
90
/**
93
- * This method reads the name of the last used arduino board from the
94
- * instance preferences
91
+ * This method reads the name of the last used arduino board from the instance preferences
95
92
*
96
93
* @return the Arduino Board name
97
94
* @author Jan Baeyens
@@ -162,8 +159,7 @@ public static void setGlobalValue(String key, String Value) {
162
159
try {
163
160
myScope .flush ();
164
161
} catch (BackingStoreException e ) {
165
- Common .log (
166
- new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type string " + key )); //$NON-NLS-1$
162
+ Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type string " + key )); //$NON-NLS-1$
167
163
e .printStackTrace ();
168
164
}
169
165
}
@@ -185,8 +181,7 @@ protected static void setGlobalValue(String key, boolean Value) {
185
181
try {
186
182
myScope .flush ();
187
183
} catch (BackingStoreException e ) {
188
- Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID ,
189
- "failed to set global variable of type boolean " + key )); //$NON-NLS-1$
184
+ Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type boolean " + key )); //$NON-NLS-1$
190
185
e .printStackTrace ();
191
186
}
192
187
}
@@ -197,15 +192,13 @@ protected static void setGlobalValue(String key, long Value) {
197
192
try {
198
193
myScope .flush ();
199
194
} catch (BackingStoreException e ) {
200
- Common .log (
201
- new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type long " + key )); //$NON-NLS-1$
195
+ Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type long " + key )); //$NON-NLS-1$
202
196
e .printStackTrace ();
203
197
}
204
198
}
205
199
206
200
/**
207
- * This method returns the index of the last used line ending options are CR
208
- * LF CR+LF none
201
+ * This method returns the index of the last used line ending options are CR LF CR+LF none
209
202
*
210
203
* @return the index of the last used setting
211
204
*/
@@ -214,8 +207,7 @@ public static int GetLastUsedSerialLineEnd() {
214
207
}
215
208
216
209
/**
217
- * This method returns the index of the last used line ending options are CR
218
- * LF CR+LF none
210
+ * This method returns the index of the last used line ending options are CR LF CR+LF none
219
211
*
220
212
* @return the index of the last used setting
221
213
*/
@@ -272,8 +264,7 @@ public static void setConfigured() {
272
264
}
273
265
274
266
/**
275
- * This method returns boolean whether the plugin is properly configured The
276
- * plugin is configured properly if a board has been installed
267
+ * This method returns boolean whether the plugin is properly configured The plugin is configured properly if a board has been installed
277
268
*
278
269
* @return
279
270
*/
@@ -330,15 +321,15 @@ public static void setLastUsedExamples(String[] exampleNames) {
330
321
}
331
322
332
323
public static String [] getPrivateLibraryPaths () {
333
- return getGlobalString (KEY_PRIVATE_LIBRARY_PATHS , Common .getDefaultPrivateLibraryPath ()).split (";" ); //$NON-NLS-1$
324
+ return getGlobalString (KEY_PRIVATE_LIBRARY_PATHS , Common .getDefaultPrivateLibraryPath ()).split (File . pathSeparator );
334
325
}
335
326
336
327
public static void setPrivateLibraryPaths (String [] folderName ) {
337
328
setGlobalValue (KEY_PRIVATE_LIBRARY_PATHS , String .join ("\n " , folderName )); //$NON-NLS-1$
338
329
}
339
330
340
331
public static String [] getPrivateHardwarePaths () {
341
- return getGlobalString (KEY_PRIVATE_HARDWARE_PATHS , Common .getDefaultPrivateHardwarePath ()).split (";" ); //$NON-NLS-1$
332
+ return getGlobalString (KEY_PRIVATE_HARDWARE_PATHS , Common .getDefaultPrivateHardwarePath ()).split (File . pathSeparator );
342
333
}
343
334
344
335
public static void setPrivateHardwarePaths (String [] folderName ) {
0 commit comments