17
17
import org .osgi .service .prefs .BackingStoreException ;
18
18
19
19
/**
20
- * ArduinoPreferences is a class containing only static methods that help managing the preferences.
20
+ * ArduinoPreferences is a class containing only static methods that help
21
+ * managing the preferences.
21
22
*
22
23
* @author jan Baeyens
23
24
*
@@ -46,10 +47,12 @@ public static void setAutomaticallyIncludeLibraries(boolean value) {
46
47
}
47
48
48
49
/***
49
- * 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
50
+ * get the stored option whether a build before the upload is wanted or not.
51
+ * If nothing is stored the option is ask and this method will pop up a
50
52
* dialogbox
51
53
*
52
- * @return true if a build is wanted before upload false if no build is wanted before upload
54
+ * @return true if a build is wanted before upload false if no build is
55
+ * wanted before upload
53
56
*/
54
57
public static boolean getBuildBeforeUploadOption () {
55
58
@@ -93,7 +96,8 @@ public void run() {
93
96
}
94
97
95
98
/**
96
- * This method reads the name of the last used arduino board from the instance preferences
99
+ * This method reads the name of the last used arduino board from the
100
+ * instance preferences
97
101
*
98
102
* @return the Arduino Board name
99
103
* @author Jan Baeyens
@@ -164,7 +168,8 @@ public static void setGlobalValue(String key, String Value) {
164
168
try {
165
169
myScope .flush ();
166
170
} catch (BackingStoreException e ) {
167
- Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type string " + key )); //$NON-NLS-1$
171
+ Common .log (
172
+ new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type string " + key )); //$NON-NLS-1$
168
173
e .printStackTrace ();
169
174
}
170
175
}
@@ -186,7 +191,8 @@ protected static void setGlobalValue(String key, boolean Value) {
186
191
try {
187
192
myScope .flush ();
188
193
} catch (BackingStoreException e ) {
189
- Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type boolean " + key )); //$NON-NLS-1$
194
+ Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID ,
195
+ "failed to set global variable of type boolean " + key )); //$NON-NLS-1$
190
196
e .printStackTrace ();
191
197
}
192
198
}
@@ -197,13 +203,15 @@ protected static void setGlobalValue(String key, long Value) {
197
203
try {
198
204
myScope .flush ();
199
205
} catch (BackingStoreException e ) {
200
- Common .log (new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type long " + key )); //$NON-NLS-1$
206
+ Common .log (
207
+ new Status (IStatus .WARNING , CORE_PLUGIN_ID , "failed to set global variable of type long " + key )); //$NON-NLS-1$
201
208
e .printStackTrace ();
202
209
}
203
210
}
204
211
205
212
/**
206
- * This method returns the index of the last used line ending options are CR LF CR+LF none
213
+ * This method returns the index of the last used line ending options are CR
214
+ * LF CR+LF none
207
215
*
208
216
* @return the index of the last used setting
209
217
*/
@@ -212,7 +220,8 @@ public static int GetLastUsedSerialLineEnd() {
212
220
}
213
221
214
222
/**
215
- * This method returns the index of the last used line ending options are CR LF CR+LF none
223
+ * This method returns the index of the last used line ending options are CR
224
+ * LF CR+LF none
216
225
*
217
226
* @return the index of the last used setting
218
227
*/
@@ -269,7 +278,8 @@ public static void setConfigured() {
269
278
}
270
279
271
280
/**
272
- * This method returns boolean whether the plugin is properly configured The plugin is configured properly if a board has been installed
281
+ * This method returns boolean whether the plugin is properly configured The
282
+ * plugin is configured properly if a board has been installed
273
283
*
274
284
* @return
275
285
*/
@@ -326,15 +336,17 @@ public static void setLastUsedExamples(String[] exampleNames) {
326
336
}
327
337
328
338
public static String [] getPrivateLibraryPaths () {
329
- return getGlobalString (KEY_PRIVATE_LIBRARY_PATHS , Common .getDefaultPrivateLibraryPath ()).split (File .pathSeparator );
339
+ return getGlobalString (KEY_PRIVATE_LIBRARY_PATHS , Common .getDefaultPrivateLibraryPath ())
340
+ .split (File .pathSeparator );
330
341
}
331
342
332
343
public static void setPrivateLibraryPaths (String [] folderName ) {
333
- setGlobalValue (KEY_PRIVATE_LIBRARY_PATHS , String .join (File .pathSeparator , folderName )); //$NON-NLS-1$
344
+ setGlobalValue (KEY_PRIVATE_LIBRARY_PATHS , String .join (File .pathSeparator , folderName ));
334
345
}
335
346
336
347
public static String [] getPrivateHardwarePaths () {
337
- return getGlobalString (KEY_PRIVATE_HARDWARE_PATHS , Common .getDefaultPrivateHardwarePath ()).split (File .pathSeparator );
348
+ return getGlobalString (KEY_PRIVATE_HARDWARE_PATHS , Common .getDefaultPrivateHardwarePath ())
349
+ .split (File .pathSeparator );
338
350
}
339
351
340
352
public static void setPrivateHardwarePaths (String [] folderName ) {
@@ -347,8 +359,8 @@ public static void setPrivateHardwarePaths(String[] folderName) {
347
359
* @return a list of all the folder locations that can contain hardware
348
360
*/
349
361
public static String [] getHardwarePaths () {
350
- return (getGlobalString (KEY_PRIVATE_HARDWARE_PATHS , EMPTY_STRING ) + File .pathSeparator + ConfigurationPreferences . getInstallationPath ())
351
- .split (File .pathSeparator );
362
+ return (getGlobalString (KEY_PRIVATE_HARDWARE_PATHS , EMPTY_STRING ) + File .pathSeparator
363
+ + ConfigurationPreferences . getInstallationPath ()) .split (File .pathSeparator );
352
364
}
353
365
354
366
}
0 commit comments