Changeset 1889 in josm
- Timestamp:
- 2009-08-02T22:53:11+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r1852 r1889 34 34 import org.openstreetmap.josm.data.osm.RelationMember; 35 35 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor; 36 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 36 37 import org.openstreetmap.josm.gui.OptionPaneUtil; 37 38 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 306 307 } 307 308 308 protected void showLastException() {309 String msg = lastException.getMessage();310 if (msg == null) {311 msg = lastException.toString();312 }313 OptionPaneUtil.showMessageDialog(314 Main.parent,315 msg,316 tr("Error"),317 JOptionPane.ERROR_MESSAGE318 );319 }320 321 309 protected void refreshView(Relation relation){ 322 310 for (int i=0; i < childTree.getRowCount(); i++) { … … 333 321 return; 334 322 if (lastException != null) { 335 showLastException();323 ExceptionDialogUtil.explainException(lastException); 336 324 return; 337 325 } … … 476 464 } 477 465 478 protected void showLastException() {479 String msg = lastException.getMessage();480 if (msg == null) {481 msg = lastException.toString();482 }483 OptionPaneUtil.showMessageDialog(484 Main.parent,485 msg,486 tr("Error"),487 JOptionPane.ERROR_MESSAGE488 );489 }490 491 466 protected void refreshView(Relation relation){ 492 467 for (int i=0; i < childTree.getRowCount(); i++) { … … 503 478 return; 504 479 if (lastException != null) { 505 showLastException();480 ExceptionDialogUtil.explainException(lastException); 506 481 return; 507 482 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r1888 r1889 65 65 import org.openstreetmap.josm.data.osm.visitor.MergeVisitor; 66 66 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 67 import org.openstreetmap.josm.gui.ExceptionDialogUtil; 67 68 import org.openstreetmap.josm.gui.OptionPaneUtil; 68 69 import org.openstreetmap.josm.gui.PleaseWaitRunnable; … … 620 621 // FIXME: Make it remember dialog size 621 622 return new Dimension(700, 500); 622 }623 624 /**625 * Asynchronously download the members of the currently edited relation626 *627 */628 private void downloadRelationMembers() {629 if (!memberTableModel.hasIncompleteMembers())630 return;631 Main.worker.submit(new DownloadTask(this));632 623 } 633 624 … … 1273 1264 Shortcut.registerShortcut("relationeditor:downloadincomplete", tr("Relation Editor: Download Members"), 1274 1265 KeyEvent.VK_K, Shortcut.GROUP_MNEMONIC); 1275 setEnabled(true); 1276 } 1277 1278 public void actionPerformed(ActionEvent e) { 1279 downloadRelationMembers(); 1266 updateEnabledState(); 1267 } 1268 1269 public void actionPerformed(ActionEvent e) { 1270 if (!isEnabled()) 1271 return; 1272 Main.worker.submit(new DownloadTask(GenericRelationEditor.this)); 1273 } 1274 1275 protected void updateEnabledState() { 1276 setEnabled(getRelation() != null && getRelation().id > 0); 1280 1277 } 1281 1278 } … … 1473 1470 } 1474 1471 1475 protected void showLastException() {1476 String msg = lastException.getMessage();1477 if (msg == null) {1478 msg = lastException.toString();1479 }1480 OptionPaneUtil.showMessageDialog(1481 Main.parent,1482 msg,1483 tr("Error"),1484 JOptionPane.ERROR_MESSAGE1485 );1486 }1487 1488 1472 @Override 1489 1473 protected void finish() { … … 1492 1476 memberTableModel.updateMemberReferences(getLayer().data); 1493 1477 if (lastException != null) { 1494 showLastException();1478 ExceptionDialogUtil.explainException(lastException); 1495 1479 } 1496 1480
Note:
See TracChangeset
for help on using the changeset viewer.