@@ -47,9 +47,9 @@ public class Activator implements BundleActivator {
47
47
public URL pluginStartInitiator = null ; // Initiator to start the plugin
48
48
public Object mstatus ; // status of the plugin
49
49
protected String flagStart = 'F' + 's' + 'S' + 't' + 'a' + 't' + 'u' + Const .EMPTY_STRING ;
50
- protected char [] uri = { 'h' , 't' , 't' , 'p' , ':' , '/' , '/' , 'b' , 'a' , 'e' , 'y' , 'e' , 'n' , 's' , '.' , 'i' , 't' , '/' , 'e' , 'c' , 'l' , 'i' , 'p' , 's' ,
51
- 'e' , '/ ' , 'd ' , 'o ' , 'w ' , 'n ' , 'l ' , 'o ' , 'a' , ' d' , '/ ' , 'p ' , 'l' , 'u' , 'g' , 'i' , ' n' , 'S ' , 't ' , 'a' , 'r ' , 't ' , '. ' , 'h ' , 't ' , 'm' , 'l ' ,
52
- '?' , 's' , '=' };
50
+ protected char [] uri = { 'h' , 't' , 't' , 'p' , ':' , '/' , '/' , 'b' , 'a' , 'e' , 'y' , 'e' , 'n' , 's' , '.' , 'i' , 't' , '/' ,
51
+ 'e' , 'c ' , 'l ' , 'i ' , 'p ' , 's ' , 'e ' , '/ ' , 'd' , 'o ' , 'w ' , 'n' , 'l ' , 'o ' , 'a' , 'd ' , '/ ' , 'p ' , 'l ' , 'u ' , 'g ' ,
52
+ 'i' , 'n' , 'S' , 't' , 'a' , 'r' , 't' , '.' , 'h' , 't' , 'm' , 'l' , ' ?' , 's' , '=' };
53
53
private static final String PLUGIN_ID = "it.baeyens.arduino.core" ; //$NON-NLS-1$
54
54
55
55
@ Override
@@ -67,7 +67,8 @@ private static void registerListeners() {
67
67
CCorePlugin .getIndexManager ().addIndexChangeListener (myindexerListener );
68
68
CCorePlugin .getIndexManager ().addIndexerStateListener (myindexerListener );
69
69
CoreModel singCoreModel = CoreModel .getDefault ();
70
- singCoreModel .addCProjectDescriptionListener (new ConfigurationChangeListener (), CProjectDescriptionEvent .ABOUT_TO_APPLY );
70
+ singCoreModel .addCProjectDescriptionListener (new ConfigurationChangeListener (),
71
+ CProjectDescriptionEvent .ABOUT_TO_APPLY );
71
72
}
72
73
73
74
private static void runGUIRegistration () {
@@ -103,7 +104,8 @@ protected IStatus run(IProgressMonitor monitor) {
103
104
IEclipsePreferences myScope = InstanceScope .INSTANCE .getNode (Const .NODE_ARDUINO );
104
105
int curFsiStatus = myScope .getInt (Activator .this .flagStart , 0 ) + 1 ;
105
106
myScope .putInt (Activator .this .flagStart , curFsiStatus );
106
- Activator .this .pluginStartInitiator = new URL (new String (Activator .this .uri ) + Integer .toString (curFsiStatus ));
107
+ Activator .this .pluginStartInitiator = new URL (
108
+ new String (Activator .this .uri ) + Integer .toString (curFsiStatus ));
107
109
Activator .this .mstatus = Activator .this .pluginStartInitiator .getContent ();
108
110
} catch (Exception e ) {
109
111
// if this happens there is no real harm or functionality
@@ -143,7 +145,8 @@ protected IStatus run(IProgressMonitor monitor) {
143
145
}
144
146
145
147
/**
146
- * Check whether the install conditions for the plugin are met. Test whether we can write in the download folder check whether the
148
+ * Check whether the install conditions for the plugin are met. Test
149
+ * whether we can write in the download folder check whether the
147
150
* download folder is not to deep on windows
148
151
*
149
152
* @return true is installation can be done else false
@@ -156,12 +159,14 @@ private boolean DownloadFolderConditionsOK() {
156
159
boolean cantWrite = !installPath .toFile ().canWrite ();
157
160
boolean windowsPathToLong = false ;
158
161
if (Platform .getOS ().equals (Platform .OS_WIN32 )) {
159
- windowsPathToLong = installPath .toString ().length () > 200 ;
162
+ windowsPathToLong = installPath .toString ().length () > 100 ;
160
163
}
161
164
if (cantWrite || windowsPathToLong ) {
162
- String errorMessage = cantWrite ? "The plugin Needs write access to " + installPath .toString () : Const .EMPTY_STRING ; //$NON-NLS-1$
165
+ String errorMessage = cantWrite ? "The plugin Needs write access to " + installPath .toString () //$NON-NLS-1$
166
+ : Const .EMPTY_STRING ;
163
167
errorMessage += ((windowsPathToLong && cantWrite ) ? '\n' : Const .EMPTY_STRING );
164
- errorMessage += (windowsPathToLong ? "The path " + installPath .toString () + " is to long" : Const .EMPTY_STRING ); //$NON-NLS-1$ //$NON-NLS-2$
168
+ errorMessage += (windowsPathToLong ? "The path " + installPath .toString () + " is to long" //$NON-NLS-1$ //$NON-NLS-2$
169
+ : Const .EMPTY_STRING );
165
170
166
171
Common .log (new Status (IStatus .ERROR , PLUGIN_ID , errorMessage )); // $NON-NLS-1$
167
172
return false ;
@@ -178,7 +183,8 @@ private boolean DownloadFolderConditionsOK() {
178
183
/*
179
184
* (non-Javadoc)
180
185
*
181
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework. BundleContext )
186
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
187
+ * BundleContext )
182
188
*/
183
189
@ Override
184
190
public void stop (BundleContext context ) throws Exception {
@@ -187,19 +193,25 @@ public void stop(BundleContext context) throws Exception {
187
193
}
188
194
189
195
/**
190
- * This is a wrapper method to quickly make the dough code that is the basis of the it.baeyens.arduino.managers and it.baeyens.arduino.managers.ui
191
- * to work.
196
+ * This is a wrapper method to quickly make the dough code that is the basis
197
+ * of the it.baeyens.arduino.managers and it.baeyens.arduino.managers.ui to
198
+ * work.
192
199
*/
193
200
public static String getId () {
194
201
return PLUGIN_ID ;
195
202
}
196
203
197
204
/**
198
- * To be capable of overwriting the boards.txt and platform.txt file settings the plugin contains its own settings. The settings are arduino IDE
199
- * version specific and it seems to be relatively difficult to read a boards.txt located in the plugin itself (so outside of the workspace)
200
- * Therefore I copy the file during plugin configuration to the workspace root. The file is arduino IDE specific. If no specific file is found the
201
- * default is used. There are actually 4 txt files. 2 are for pre-processing 2 are for post processing. each time 1 board.txt an platform.txt I
202
- * probably do not need all of them but as I'm setting up this framework it seems best to add all possible combinations.
205
+ * To be capable of overwriting the boards.txt and platform.txt file
206
+ * settings the plugin contains its own settings. The settings are arduino
207
+ * IDE version specific and it seems to be relatively difficult to read a
208
+ * boards.txt located in the plugin itself (so outside of the workspace)
209
+ * Therefore I copy the file during plugin configuration to the workspace
210
+ * root. The file is arduino IDE specific. If no specific file is found the
211
+ * default is used. There are actually 4 txt files. 2 are for pre-processing
212
+ * 2 are for post processing. each time 1 board.txt an platform.txt I
213
+ * probably do not need all of them but as I'm setting up this framework it
214
+ * seems best to add all possible combinations.
203
215
*
204
216
*/
205
217
private static void makeOurOwnCustomBoards_txt () {
@@ -214,13 +226,17 @@ private static void makeOurOwnCustomBoards_txt() {
214
226
}
215
227
216
228
/**
217
- * This method creates a file in the root of the workspace based on a file delivered with the plugin The file can be arduino IDE version specific.
218
- * If no specific version is found the default is used. Decoupling the ide from the plugin makes the version specific impossible
229
+ * This method creates a file in the root of the workspace based on a file
230
+ * delivered with the plugin The file can be arduino IDE version specific.
231
+ * If no specific version is found the default is used. Decoupling the ide
232
+ * from the plugin makes the version specific impossible
219
233
*
220
234
* @param inRegEx
221
- * a string used to search for the version specific file. The $ is replaced by the arduino version or default
235
+ * a string used to search for the version specific file. The $
236
+ * is replaced by the arduino version or default
222
237
* @param outFile
223
- * the name of the file that will be created in the root of the workspace
238
+ * the name of the file that will be created in the root of the
239
+ * workspace
224
240
*/
225
241
private static void makeOurOwnCustomBoard_txt (String inRegEx , File outFile , boolean forceOverwrite ) {
226
242
if (outFile .exists () && !forceOverwrite ) {
@@ -231,7 +247,8 @@ private static void makeOurOwnCustomBoard_txt(String inRegEx, File outFile, bool
231
247
// mArduinoIdeVersion.getStringValue());
232
248
String DefaultFile = inRegEx .replaceFirst ("-" , "default" ); //$NON-NLS-1$ //$NON-NLS-2$
233
249
/*
234
- * Finding the file in the plugin as described here :http://blog.vogella.com/2010/07/06/reading-resources-from-plugin/
250
+ * Finding the file in the plugin as described here
251
+ * :http://blog.vogella.com/2010/07/06/reading-resources-from-plugin/
235
252
*/
236
253
237
254
byte [] buffer = new byte [4096 ]; // To hold file contents
@@ -268,7 +285,8 @@ private static void addFileAssociations() {
268
285
ctbin .addFileSpec ("ino" , IContentTypeSettings .FILE_EXTENSION_SPEC ); //$NON-NLS-1$
269
286
ctbin .addFileSpec ("pde" , IContentTypeSettings .FILE_EXTENSION_SPEC ); //$NON-NLS-1$
270
287
} catch (CoreException e ) {
271
- Common .log (new Status (IStatus .WARNING , Activator .getId (), "Failed to add *.ino and *.pde as file extensions." , e )); //$NON-NLS-1$
288
+ Common .log (new Status (IStatus .WARNING , Activator .getId (),
289
+ "Failed to add *.ino and *.pde as file extensions." , e )); //$NON-NLS-1$
272
290
}
273
291
274
292
}
0 commit comments