40
40
import it .baeyens .arduino .tools .Helpers ;
41
41
42
42
/**
43
- * The ArduinoSelectionPage class is used in the new wizard and the project
44
- * properties. This class controls the gui and the data underneath the gui. This
45
- * class allows to select the arduino board and the port name
43
+ * The ArduinoSelectionPage class is used in the new wizard and the project properties. This class controls the gui and the data underneath the gui.
44
+ * This class allows to select the arduino board and the port name
46
45
*
47
46
* @author Jan Baeyens
48
47
* @see ArduinoProperties ArduinoSettingsPage
@@ -68,8 +67,7 @@ public class BoardSelectionPage extends AbstractCPropertyTab {
68
67
// for the current arduino environment
69
68
70
69
/**
71
- * Get the configuration we are currently working in. The configuration is
72
- * null if we are in the create sketch wizard.
70
+ * Get the configuration we are currently working in. The configuration is null if we are in the create sketch wizard.
73
71
*
74
72
* @return the configuration to save info into
75
73
*/
@@ -81,8 +79,7 @@ public ICConfigurationDescription getConfdesc() {
81
79
}
82
80
83
81
/**
84
- * Listener for the child or leave fields. The listener saves the
85
- * information in the configuration
82
+ * Listener for the child or leave fields. The listener saves the information in the configuration
86
83
*
87
84
* @author jan
88
85
*
@@ -128,8 +125,7 @@ public void handleEvent(Event e) {
128
125
*/
129
126
String CurrentBoard = BoardSelectionPage .this .mcontrolBoardName .getText ();
130
127
BoardSelectionPage .this .mcontrolBoardName .removeAll ();
131
- BoardSelectionPage .this .mcontrolBoardName
132
- .setItems (BoardSelectionPage .this .mAllBoardsFiles [selectedBoardFile ].GetArduinoBoards ());
128
+ BoardSelectionPage .this .mcontrolBoardName .setItems (BoardSelectionPage .this .mAllBoardsFiles [selectedBoardFile ].GetArduinoBoards ());
133
129
BoardSelectionPage .this .mcontrolBoardName .setText (CurrentBoard );
134
130
135
131
BoardSelectionPage .this .BoardModifyListener .handleEvent (null );
@@ -144,8 +140,8 @@ public void handleEvent(Event e) {
144
140
String boardName = BoardSelectionPage .this .mcontrolBoardName .getText ();
145
141
146
142
for (LabelCombo curLabelCombo : BoardSelectionPage .this .mBoardOptionCombos ) {
147
- curLabelCombo .setItems (BoardSelectionPage . this . mAllBoardsFiles [ selectedBoardFile ]
148
- .getMenuItemNames (curLabelCombo .getMenuName (), boardName ));
143
+ curLabelCombo .setItems (
144
+ BoardSelectionPage . this . mAllBoardsFiles [ selectedBoardFile ] .getMenuItemNames (curLabelCombo .getMenuName (), boardName ));
149
145
}
150
146
151
147
IEnvironmentVariableManager envManager = CCorePlugin .getDefault ().getBuildEnvironmentManager ();
@@ -242,8 +238,7 @@ public void draw(Composite composite) {
242
238
this .mcontrolBoardName .setEnabled (false );
243
239
244
240
// ----
245
- this .mControlUploadPort = new LabelCombo (composite , Messages .ui_port , this .ncol - 1 ,
246
- Const .ENV_KEY_JANTJE_COM_PORT , false );
241
+ this .mControlUploadPort = new LabelCombo (composite , Messages .ui_port , this .ncol - 1 , Const .ENV_KEY_JANTJE_COM_PORT , false );
247
242
248
243
this .mControlUploadPort .setItems (ArrayUtil .addAll (Activator .bonjourDiscovery .getList (), Common .listComPorts ()));
249
244
@@ -257,8 +252,7 @@ public void draw(Composite composite) {
257
252
this .mBoardOptionCombos = new LabelCombo [menuNames .length ];
258
253
for (int currentOption = 0 ; currentOption < menuNames .length ; currentOption ++) {
259
254
String menuName = menuNames [currentOption ];
260
- this .mBoardOptionCombos [currentOption ] = new LabelCombo (composite , menuName , this .ncol - 1 ,
261
- Const .ENV_KEY_JANTJE_START + menuName , true );
255
+ this .mBoardOptionCombos [currentOption ] = new LabelCombo (composite , menuName , this .ncol - 1 , Const .ENV_KEY_JANTJE_START + menuName , true );
262
256
}
263
257
264
258
// Create the control to alert parents of changes
@@ -348,8 +342,7 @@ protected void updateButtons() {
348
342
}
349
343
350
344
/**
351
- * Based on the current selection save the last used values$this to make
352
- * sure you can create the same sketch quickly again
345
+ * Based on the current selection save the last used values$this to make sure you can create the same sketch quickly again
353
346
*/
354
347
private void saveAllLastUseds () {
355
348
//
@@ -369,8 +362,7 @@ private void saveAllLastUseds() {
369
362
}
370
363
371
364
/**
372
- * Based on the selected board and parameters save all info needed to the
373
- * build environments
365
+ * Based on the selected board and parameters save all info needed to the build environments
374
366
*
375
367
* @param confdesc
376
368
*/
@@ -382,17 +374,14 @@ public void saveAllSelections(ICConfigurationDescription confdesc) {
382
374
IContributedEnvironment contribEnv = envManager .getContributedEnvironment ();
383
375
384
376
// Set the path variables
385
- IPath platformPath = new Path (new File (this .mControlBoardsTxtFile .getText ().trim ()).getParent ())
386
- .append (Const .PLATFORM_FILE_NAME );
377
+ IPath platformPath = new Path (new File (this .mControlBoardsTxtFile .getText ().trim ()).getParent ()).append (Const .PLATFORM_FILE_NAME );
387
378
Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_BOARDS_FILE , boardFile );
388
- Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_PLATFORM_FILE ,
389
- platformPath .toString ());
379
+ Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_PLATFORM_FILE , platformPath .toString ());
390
380
Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_BOARD_NAME , boardName );
391
381
Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_COM_PORT , uploadPort );
392
382
393
383
Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_PACKAGE_ID , getPackage ());
394
- Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_ARCITECTURE_ID ,
395
- getArchitecture ());
384
+ Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_ARCITECTURE_ID , getArchitecture ());
396
385
Common .setBuildEnvironmentVariable (contribEnv , confdesc , Const .ENV_KEY_JANTJE_BOARD_ID , getBoardID ());
397
386
398
387
for (LabelCombo curLabelCombo : this .mBoardOptionCombos ) {
@@ -411,7 +400,7 @@ private void setValues(ICConfigurationDescription confdesc) {
411
400
boardName = Common .getBuildEnvironmentVariable (confdesc , Const .ENV_KEY_JANTJE_BOARD_NAME , boardName );
412
401
uploadPort = Common .getBuildEnvironmentVariable (confdesc , Const .ENV_KEY_JANTJE_COM_PORT , uploadPort );
413
402
}
414
- Map < String , String > options = InstancePreferences . getLastUsedMenuOption ();
403
+
415
404
this .mControlBoardsTxtFile .setText (boardFile );
416
405
// if no boards file is selected select the first
417
406
if (this .mControlBoardsTxtFile .getText ().isEmpty ()) {
@@ -424,9 +413,9 @@ private void setValues(ICConfigurationDescription confdesc) {
424
413
this .mControlUploadPort .setValue (uploadPort );
425
414
426
415
// set the options in the combo boxes before setting the value
416
+ Map <String , String > options = InstancePreferences .getLastUsedMenuOption ();
427
417
for (LabelCombo curLabelCombo : this .mBoardOptionCombos ) {
428
- curLabelCombo .setItems (
429
- this .mAllBoardsFiles [selectedBoardFile ].getMenuItemNames (curLabelCombo .getMenuName (), boardName ));
418
+ curLabelCombo .setItems (this .mAllBoardsFiles [selectedBoardFile ].getMenuItemNames (curLabelCombo .getMenuName (), boardName ));
430
419
if (confdesc != null ) {
431
420
curLabelCombo .getStoredValue (confdesc );
432
421
} else {
@@ -496,8 +485,7 @@ public void handleTabEvent(int kind, Object data) {
496
485
}
497
486
498
487
/*
499
- * Returns the package name based on the platformfile name Caters for the
500
- * packages (with version number and for the old way
488
+ * Returns the package name based on the platformfile name Caters for the packages (with version number and for the old way
501
489
*/
502
490
public String getPackage () {
503
491
IPath platformFile = new Path (this .mControlBoardsTxtFile .getText ().trim ());
@@ -510,8 +498,7 @@ public String getPackage() {
510
498
}
511
499
512
500
/*
513
- * Returns the architecture based on the platfor file name Caters for the
514
- * packages (with version number and for the old way
501
+ * Returns the architecture based on the platfor file name Caters for the packages (with version number and for the old way
515
502
*/
516
503
public String getArchitecture () {
517
504
IPath platformFile = new Path (this .mControlBoardsTxtFile .getText ().trim ());
0 commit comments