Revision 24091 trunk/extensions/extTopology/src/org/gvsig/topology/ui/TopologyErrorPanel.java
TopologyErrorPanel.java | ||
---|---|---|
107 | 107 |
import com.iver.cit.gvsig.project.documents.ProjectDocument; |
108 | 108 |
import com.iver.cit.gvsig.project.documents.view.IProjectView; |
109 | 109 |
import com.iver.cit.gvsig.project.documents.view.gui.View; |
110 |
import com.iver.utiles.swing.threads.TopologyBatchCorrectionTask; |
|
110 | 111 |
|
111 | 112 |
/** |
112 | 113 |
* Panel to show topology errors stored in a ITopologyErrorContainer. |
... | ... | |
289 | 290 |
getShowExceptionsCb(), getShowViewExtentCb() }; |
290 | 291 |
this.addRow(row, 600, DEFAULT_HEIGHT); |
291 | 292 |
|
292 |
this.addRow(new JComponent[] { getUpdateButton() }, 600, |
|
293 |
this.addRow(new JComponent[] { getUpdateButton(), getBatchFixButton() }, 600,
|
|
293 | 294 |
DEFAULT_HEIGHT); |
294 | 295 |
|
295 | 296 |
this.addRow(new JComponent[] { new JScrollPane(getErrorInspectorTable()) }, |
... | ... | |
362 | 363 |
}); |
363 | 364 |
return updateButton; |
364 | 365 |
} |
366 |
|
|
367 |
private JButton getBatchFixButton(){ |
|
368 |
JButton batchFixButton = new JButton(PluginServices.getText(this, "BATCH_FIX")); |
|
369 |
batchFixButton.addActionListener(new ActionListener() { |
|
370 |
public void actionPerformed(ActionEvent arg0) { |
|
371 |
batchFix(); |
|
372 |
} |
|
365 | 373 |
|
374 |
|
|
375 |
}); |
|
376 |
return batchFixButton; |
|
377 |
} |
|
378 |
|
|
379 |
private void batchFix() { |
|
380 |
ITopologyRule selectedRule = getSelectedRule(); |
|
381 |
ITopologyErrorFix errorFix = selectedRule.getDefaultFix(); |
|
382 |
if(errorFix instanceof ITopologyErrorFixWithParameters){ |
|
383 |
GUIUtil.getInstance().messageBox(PluginServices.getText(this, "correction_needs_user_interaction"), |
|
384 |
PluginServices.getText(this, "could_not_launch_process")); |
|
385 |
return; |
|
386 |
} |
|
387 |
|
|
388 |
TopologyBatchCorrectionTask task = new TopologyBatchCorrectionTask(this.errorContainer, selectedRule); |
|
389 |
PluginServices.cancelableBackgroundExecution(task); |
|
390 |
|
|
391 |
} |
|
392 |
|
|
366 | 393 |
private JTable getErrorInspectorTable() { |
367 | 394 |
if (errorInspectorTable == null) { |
368 | 395 |
errorInspectorTable = new JTable(); |
Also available in: Unified diff