Skip to content

Commit c18e5af

Browse files
author
jantje
committed
Added support for removing and updating json files.
Uptill now it was not possible to update json files and there was no remove functionality. Now when you remove a json in the preferences ardiuino locations the file will be removed from the local system. There is also a checkbox to force all files to be downloaded.
1 parent 61827fd commit c18e5af

File tree

9 files changed

+612
-90
lines changed

9 files changed

+612
-90
lines changed

it.baeyens.arduino.common/src/it/baeyens/arduino/common/ConfigurationPreferences.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
public class ConfigurationPreferences {
1616

17+
static private String stringSplitter = "\n";//$NON-NLS-1$
1718
// private static final String defaulDownloadLocation = new
1819
// Path(System.getProperty("user.home")).append("arduinoPlugin").toString();
1920
// //$NON-NLS-1$ //$NON-NLS-2$
@@ -100,6 +101,10 @@ public static String getBoardURLs() {
100101
return getGlobalString(Const.KEY_MANAGER_BOARD_URLS, Const.DEFAULT_MANAGER_BOARD_URLS);
101102
}
102103

104+
public static String[] getBoardURLList() {
105+
return getBoardURLs().replaceAll("\r", "").split(stringSplitter);
106+
}
107+
103108
public static void setBoardURLs(String urls) {
104109
setGlobalString(Const.KEY_MANAGER_BOARD_URLS, urls);
105110
}

it.baeyens.arduino.common/src/it/baeyens/arduino/common/Const.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class Const {
5959
public static final String KEY_LAST_USED_BOARD_MENU_OPTIONS = "Board Custom Option Selections";//$NON-NLS-1$
6060
public static final String KEY_LAST_USED_SCOPE_FILTER_MENU_OPTION = "Board scope filter on off";//$NON-NLS-1$
6161
public static final String KEY_LAST_USED_EXAMPLES = "Last used Examples";//$NON-NLS-1$
62+
public static final String KEY_UPDATE_JASONS = "Update jsons files";//$NON-NLS-1$
6263

6364
// Serial monitor keys
6465
public static final String KEY_SERIAlRATE = "Serial monitor last selected rate";//$NON-NLS-1$
@@ -132,13 +133,15 @@ public class Const {
132133
public static final String ENV_KEY_JANTJE_SIZE_SWITCH = ENV_KEY_JANTJE_START + "SIZE.SWITCH";//$NON-NLS-1$
133134
public static final String ENV_KEY_JANTJE_BOARDS_FILE = ENV_KEY_JANTJE_START + "BOARDS_FILE";//$NON-NLS-1$
134135
public static final String ENV_KEY_JANTJE_PLATFORM_FILE = ENV_KEY_JANTJE_START + "PLATFORM_FILE";//$NON-NLS-1$
135-
public static final String ENV_KEY_JANTJE_REFERENCED_PLATFORM_FILE = ENV_KEY_JANTJE_START + "REFERENCED_PLATFORM_FILE";//$NON-NLS-1$
136+
public static final String ENV_KEY_JANTJE_REFERENCED_PLATFORM_FILE = ENV_KEY_JANTJE_START
137+
+ "REFERENCED_PLATFORM_FILE";//$NON-NLS-1$
136138
public static final String ENV_KEY_JANTJE_COM_PORT = ENV_KEY_JANTJE_START + "COM_PORT";//$NON-NLS-1$
137139
public static final String ENV_KEY_JANTJE_BOARD_NAME = ENV_KEY_JANTJE_START + "BOARD_NAME";//$NON-NLS-1$
138140

139141
public static final String ENV_KEY_JANTJE_ADDITIONAL_COMPILE_OPTIONS = ENV_KEY_JANTJE_START + "EXTRA.COMPILE";//$NON-NLS-1$
140142
public static final String ENV_KEY_JANTJE_ADDITIONAL_C_COMPILE_OPTIONS = ENV_KEY_JANTJE_START + "EXTRA.C.COMPILE";//$NON-NLS-1$
141-
public static final String ENV_KEY_JANTJE_ADDITIONAL_CPP_COMPILE_OPTIONS = ENV_KEY_JANTJE_START + "EXTRA.CPP.COMPILE";//$NON-NLS-1$
143+
public static final String ENV_KEY_JANTJE_ADDITIONAL_CPP_COMPILE_OPTIONS = ENV_KEY_JANTJE_START
144+
+ "EXTRA.CPP.COMPILE";//$NON-NLS-1$
142145
public static final String ENV_KEY_JANTJE_PACKAGE_ID = ENV_KEY_JANTJE_START + "PACKAGE_ID";//$NON-NLS-1$
143146
public static final String ENV_KEY_JANTJE_ARCITECTURE_ID = ENV_KEY_JANTJE_START + "ARCHITECTURE_ID";//$NON-NLS-1$
144147
public static final String ENV_KEY_JANTJE_BOARD_ID = ENV_KEY_JANTJE_START + "BOARD_ID";//$NON-NLS-1$
@@ -150,15 +153,18 @@ public class Const {
150153
// template Sketch information
151154

152155
public static final String ENV_KEY_JANTJE_SKETCH_TEMPLATE_FOLDER = ENV_KEY_JANTJE_START + "TEMPLATE_FOLDER";//$NON-NLS-1$
153-
public static final String ENV_KEY_JANTJE_SKETCH_TEMPLATE_USE_DEFAULT = ENV_KEY_JANTJE_START + "TEMPLATE_USE_DEFAULT";//$NON-NLS-1$
156+
public static final String ENV_KEY_JANTJE_SKETCH_TEMPLATE_USE_DEFAULT = ENV_KEY_JANTJE_START
157+
+ "TEMPLATE_USE_DEFAULT";//$NON-NLS-1$
154158

155159
public static final String ENV_KEY_WARNING_LEVEL_OFF = " -w ";//$NON-NLS-1$
156160
public static final String ENV_KEY_WARNING_LEVEL_ON = " -Wall ";//$NON-NLS-1$
157161

158162
public static final String ENV_KEY_GNU_SERIAL_PORTS = "gnu.io.rxtx.SerialPorts";//$NON-NLS-1$
159163
public static final String ENV_VALUE_GNU_SERIAL_PORTS_LINUX = "/dev/ttyACM0:/dev/ttyACM1:/dev/ttyACM2:/dev/ttyACM3:/dev/ttyUSB0::/dev/ttyUSB1::/dev/ttyUSB2::/dev/ttyUSB3::/dev/ttyUSB4";//$NON-NLS-1$
160164
// scope stuff
161-
public static final short SCOPE_START_DATA = (short) 0xCDAB;// This is the 205 171 or -85 -51
165+
public static final short SCOPE_START_DATA = (short) 0xCDAB;// This is the
166+
// 205 171 or
167+
// -85 -51
162168
// flag that
163169
// indicates
164170
// scope data is

it.baeyens.arduino.core/META-INF/MANIFEST.MF

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ Require-Bundle: org.eclipse.core.runtime,
1313
org.eclipse.cdt.core,
1414
org.eclipse.equinox.security;bundle-version="1.1.100",
1515
com.google.gson,
16-
org.apache.commons.compress
16+
org.apache.commons.compress,
17+
org.eclipse.swt,
18+
org.eclipse.ui.workbench,
19+
org.eclipse.ui.forms
1720
Bundle-Vendor: Jan Baeyens
1821
Bundle-ActivationPolicy: lazy
1922
Import-Package: it.baeyens.arduino.arduino,

0 commit comments

Comments
 (0)