File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
it.baeyens.arduino.common/src/it/baeyens/arduino/common
it.baeyens.arduino.core/src/it/baeyens/arduino/ui Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change
1
+ package it .baeyens .arduino .common ;
2
+
3
+ public class Defaults {
4
+ public static final boolean OPEN_SERIAL_WITH_MONITOR = true ;
5
+ public static final boolean AUTO_IMPORT_LIBRARIES = true ;
6
+ }
Original file line number Diff line number Diff line change 26
26
public class InstancePreferences extends Const {
27
27
28
28
public static boolean getOpenSerialWithMonitor () {
29
- return getGlobalBoolean (KEY_OPEN_SERIAL_WITH_MONITOR , true );
29
+ return getGlobalBoolean (KEY_OPEN_SERIAL_WITH_MONITOR , Defaults . OPEN_SERIAL_WITH_MONITOR );
30
30
}
31
31
32
32
public static void setOpenSerialWithMonitor (boolean value ) {
@@ -39,7 +39,7 @@ public static void setOpenSerialWithMonitor(boolean value) {
39
39
* @return true if libraries need to be added else false.
40
40
*/
41
41
public static boolean getAutomaticallyIncludeLibraries () {
42
- return getGlobalBoolean (KEY_AUTO_IMPORT_LIBRARIES , true );
42
+ return getGlobalBoolean (KEY_AUTO_IMPORT_LIBRARIES , Defaults . AUTO_IMPORT_LIBRARIES );
43
43
}
44
44
45
45
public static void setAutomaticallyIncludeLibraries (boolean value ) {
Original file line number Diff line number Diff line change 15
15
import org .eclipse .ui .preferences .ScopedPreferenceStore ;
16
16
17
17
import it .baeyens .arduino .common .Const ;
18
+ import it .baeyens .arduino .common .Defaults ;
18
19
19
20
/**
20
21
* ArduinoPreferencePage is the class that is behind the preference page of
@@ -38,7 +39,11 @@ public class PreferencePage extends FieldEditorPreferencePage implements IWorkbe
38
39
public PreferencePage () {
39
40
super (org .eclipse .jface .preference .FieldEditorPreferencePage .GRID );
40
41
setDescription (Messages .ui_workspace_settings );
41
- setPreferenceStore (new ScopedPreferenceStore (InstanceScope .INSTANCE , Const .NODE_ARDUINO ));
42
+
43
+ ScopedPreferenceStore preferences = new ScopedPreferenceStore (InstanceScope .INSTANCE , Const .NODE_ARDUINO );
44
+ preferences .setDefault (Const .KEY_OPEN_SERIAL_WITH_MONITOR , Defaults .OPEN_SERIAL_WITH_MONITOR );
45
+ preferences .setDefault (Const .KEY_AUTO_IMPORT_LIBRARIES , Defaults .AUTO_IMPORT_LIBRARIES );
46
+ setPreferenceStore (preferences );
42
47
}
43
48
44
49
@ Override
You can’t perform that action at this time.
0 commit comments