Revision 716
org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.impl/src/main/java/org/gvsig/scripting/swing/impl/composer/DefaultJScriptingComposer.java | ||
---|---|---|
1407 | 1407 |
*/ |
1408 | 1408 |
public void closeAllScripts() { |
1409 | 1409 |
List<DockedPanel> modifiedPanels = new ArrayList<>(); |
1410 |
List<DockedPanel> toRemove = new ArrayList<>(); |
|
1410 | 1411 |
|
1411 | 1412 |
for (DockedPanel panel : this.dock) { |
1412 | 1413 |
if (Dock.DOCK_CENTER.equals(panel.getAlign())) { |
1413 | 1414 |
if (panel.isModified()) { |
1414 | 1415 |
modifiedPanels.add(panel); |
1416 |
} else { |
|
1417 |
toRemove.add(panel); |
|
1415 | 1418 |
} |
1416 | 1419 |
} |
1417 | 1420 |
} |
1418 |
if (modifiedPanels.isEmpty()) { |
|
1421 |
if (modifiedPanels.isEmpty() && toRemove.isEmpty()) {
|
|
1419 | 1422 |
return; |
1420 | 1423 |
} |
1421 | 1424 |
int action = JOptionPane.showConfirmDialog( |
... | ... | |
1434 | 1437 |
editor.getUnit().setSaved(true); |
1435 | 1438 |
} |
1436 | 1439 |
editor.save(); |
1437 |
panel.remove();
|
|
1440 |
toRemove.add(panel);
|
|
1438 | 1441 |
} |
1439 | 1442 |
break; |
1440 | 1443 |
case JOptionPane.NO_OPTION: |
... | ... | |
1443 | 1446 |
if (editor.getUnit() != null) { |
1444 | 1447 |
editor.getUnit().setSaved(true); |
1445 | 1448 |
} |
1446 |
panel.remove();
|
|
1449 |
toRemove.add(panel);
|
|
1447 | 1450 |
} |
1448 | 1451 |
} |
1449 |
|
|
1452 |
if( toRemove.isEmpty() ) { |
|
1453 |
return; |
|
1454 |
} |
|
1455 |
for (DockedPanel panel : toRemove) { |
|
1456 |
panel.remove(); |
|
1457 |
} |
|
1450 | 1458 |
} |
1451 | 1459 |
|
1452 | 1460 |
/** |
Also available in: Unified diff