@@ -92,6 +92,7 @@ public class SDKUpdater extends JFrame implements PropertyChangeListener, Tool {
92
92
private JButton actionButtonPlatform ;
93
93
private JTable table ;
94
94
private JTable tablePlatforms ;
95
+ private JTabbedPane tabs ;
95
96
96
97
private ArrayList <String > packagePathsList ;
97
98
private ArrayList <String > platformPathsList ;
@@ -245,18 +246,20 @@ public Channel getChannel() {
245
246
for (String path : installed .keySet ()) {
246
247
Vector info = new Vector ();
247
248
List locInfo = installed .get (path );
248
- packagePathsList .add (path );
249
- info .add (false );
250
- info .add (locInfo .get (0 ));
251
- info .add (locInfo .get (1 ));
252
- if (updated .containsKey (path )) {
253
- String upVer = updated .get (path ).get (1 );
254
- info .add (upVer );
255
- numUpdates ++;
256
- } else {
257
- info .add ("" );
249
+ if (!isPlatform (path )) {
250
+ packagePathsList .add (path );
251
+ info .add (false );
252
+ info .add (locInfo .get (0 ));
253
+ info .add (locInfo .get (1 ));
254
+ if (updated .containsKey (path )) {
255
+ String upVer = updated .get (path ).get (1 );
256
+ info .add (upVer );
257
+ numUpdates ++;
258
+ } else {
259
+ info .add ("" );
260
+ }
261
+ packageList .add (info );
258
262
}
259
- packageList .add (info );
260
263
}
261
264
262
265
return null ;
@@ -288,6 +291,15 @@ protected void done() {
288
291
e .printStackTrace ();
289
292
}
290
293
}
294
+
295
+ private Boolean isPlatform (String path ){
296
+ int end_pos = path .indexOf (";" );
297
+ String pathType = end_pos != -1 ? path .substring (0 ,end_pos ) : "" ;
298
+ if (pathType .equals ("platforms" )) {
299
+ return true ;
300
+ }
301
+ return false ;
302
+ }
291
303
}
292
304
293
305
class DownloadTask extends SwingWorker <Object , Object > {
@@ -330,6 +342,7 @@ protected Object doInBackground() throws Exception {
330
342
331
343
if (remotes .size () == 0 ) {
332
344
actionButtonPlatform .setText ("Install" );
345
+ actionButton .setText ("Update" );
333
346
Messages .showWarning ("SDK Updater" ,"No platform was selected" );
334
347
return null ;
335
348
}
@@ -360,6 +373,7 @@ protected void done() {
360
373
try {
361
374
get ();
362
375
actionButton .setEnabled (false );
376
+ tabs .setEnabled (true );
363
377
status .setText ("Refreshing packages..." );
364
378
statusPlatform .setText ("Refreshing packages..." );
365
379
queryTask = new QueryTask ();
@@ -432,7 +446,7 @@ private void createLayout(final boolean standalone) {
432
446
Box verticalBox1 = Box .createVerticalBox ();
433
447
verticalBox1 .setBorder (new EmptyBorder (BORDER , BORDER , BORDER , BORDER ));
434
448
435
- JTabbedPane tabs = new JTabbedPane ();
449
+ tabs = new JTabbedPane ();
436
450
tabs .add ("SDK Tools" ,verticalBox );
437
451
tabs .add ("Platforms" ,verticalBox1 );
438
452
outer .add (tabs );
@@ -523,6 +537,7 @@ public void actionPerformed(ActionEvent e) {
523
537
524
538
status .setText ("Downloading available updates..." );
525
539
actionButton .setText ("Cancel" );
540
+ tabs .setEnabled (false );
526
541
}
527
542
}
528
543
});
@@ -628,6 +643,7 @@ public void actionPerformed(ActionEvent e) {
628
643
progressBarPlatform .setIndeterminate (true );
629
644
downloadTask .execute ();
630
645
actionButtonPlatform .setText ("Cancel" );
646
+ tabs .setEnabled (false );
631
647
}
632
648
}
633
649
});
0 commit comments