Revision 45670
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.geodb.app/org.gvsig.geodb.app.mainplugin/src/main/java/org/gvsig/geodb/TableInfoController.java | ||
---|---|---|
40 | 40 |
import org.gvsig.tools.ToolsLocator; |
41 | 41 |
import org.gvsig.tools.i18n.I18nManager; |
42 | 42 |
import org.gvsig.tools.locator.LocatorException; |
43 |
import org.gvsig.tools.swing.api.ChangeListenerHelper; |
|
44 |
import org.gvsig.tools.swing.api.ChangeListenerSupport; |
|
43 | 45 |
import org.gvsig.tools.swing.api.JListWithCheckbox; |
44 | 46 |
import org.gvsig.tools.swing.api.SupportIsEnable; |
45 | 47 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
... | ... | |
53 | 55 |
* |
54 | 56 |
* @author fdiaz |
55 | 57 |
*/ |
56 |
public class TableInfoController implements SupportIsEnable { |
|
58 |
public class TableInfoController implements SupportIsEnable, ChangeListenerSupport {
|
|
57 | 59 |
|
58 | 60 |
public static final String CONFIGURABLE_PANEL_ID = "TableInfoController"; |
61 |
private final ChangeListenerHelper changeListener; |
|
59 | 62 |
|
60 | 63 |
public static class RemoveDALInformationAction extends AbstractAction { |
61 | 64 |
|
... | ... | |
144 | 147 |
this.btnAdvancedProperties = btnAdvancedProperties; |
145 | 148 |
this.lblReadOnlyNotification = lblReadOnlyNotification; |
146 | 149 |
this.pnlCfgActions = pnlCfgActions; |
150 |
|
|
151 |
this.changeListener = ToolsSwingLocator.getToolsSwingManager().createChangeListenerHelper(); |
|
147 | 152 |
|
148 | 153 |
initComponents(); |
149 | 154 |
} |
... | ... | |
194 | 199 |
if (e.getStateChange() == ItemEvent.SELECTED) { |
195 | 200 |
doChangeGeometryField(); |
196 | 201 |
updateLabel(); |
202 |
changeListener.fireEvent(); |
|
197 | 203 |
} |
198 | 204 |
}); |
199 | 205 |
this.btnDeselectAllColumns.addActionListener((ActionEvent e) -> { |
... | ... | |
223 | 229 |
} |
224 | 230 |
info.setIdFieldSelected(this.cboIdField.getSelectedIndex()); |
225 | 231 |
updateLabel(); |
232 |
changeListener.fireEvent(); |
|
226 | 233 |
} |
227 | 234 |
|
228 | 235 |
private void doChangeProjection() { |
... | ... | |
232 | 239 |
} |
233 | 240 |
info.setProjection(this.pickerProjection.get()); |
234 | 241 |
updateLabel(); |
242 |
changeListener.fireEvent(); |
|
235 | 243 |
} |
236 | 244 |
|
237 | 245 |
private void doChangeGeometryField() { |
... | ... | |
339 | 347 |
this.pickerFilter.set(tableInfo.getFilter()); |
340 | 348 |
|
341 | 349 |
updateLabel(); |
350 |
changeListener.fireEvent(); |
|
342 | 351 |
} |
343 | 352 |
|
344 | 353 |
private void updateLabel() throws LocatorException { |
... | ... | |
475 | 484 |
cfgActionsManager.addConfigurableAction(CONFIGURABLE_PANEL_ID, new RemoveDALInformationAction()); |
476 | 485 |
} |
477 | 486 |
|
487 |
@Override |
|
488 |
public void addChangeListener(ChangeListener listener) { |
|
489 |
this.changeListener.addChangeListener(listener); |
|
490 |
} |
|
491 |
|
|
492 |
@Override |
|
493 |
public ChangeListener[] getChangeListeners() { |
|
494 |
return this.changeListener.getChangeListeners(); |
|
495 |
} |
|
496 |
|
|
497 |
@Override |
|
498 |
public void removeChangeListener(ChangeListener listener) { |
|
499 |
this.changeListener.removeChangeListener(listener); |
|
500 |
} |
|
501 |
|
|
502 |
@Override |
|
503 |
public void removeAllChangeListener() { |
|
504 |
this.changeListener.removeAllChangeListener(); |
|
505 |
} |
|
506 |
|
|
507 |
@Override |
|
508 |
public boolean hasChangeListeners() { |
|
509 |
return this.changeListener.hasChangeListeners(); |
|
510 |
} |
|
511 |
|
|
512 |
|
|
478 | 513 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.geodb.app/org.gvsig.geodb.app.mainplugin/src/main/java/org/gvsig/geodb/AbstractWizardDB.java | ||
---|---|---|
10 | 10 |
import javax.swing.DefaultListModel; |
11 | 11 |
import javax.swing.ListSelectionModel; |
12 | 12 |
import javax.swing.event.ChangeEvent; |
13 |
import javax.swing.event.ChangeListener; |
|
13 | 14 |
import javax.swing.event.ListSelectionEvent; |
14 | 15 |
import org.gvsig.app.gui.WizardPanel; |
15 | 16 |
import org.gvsig.expressionevaluator.swing.ExpressionEvaluatorSwingLocator; |
... | ... | |
114 | 115 |
this.view.lblReadOnlyNotification, |
115 | 116 |
this.view.pnlCfgActions |
116 | 117 |
); |
118 |
|
|
119 |
this.tableInfoController.addChangeListener(new ChangeListener() { |
|
120 |
@Override |
|
121 |
public void stateChanged(ChangeEvent e) { |
|
122 |
checkFinishable(); |
|
123 |
} |
|
124 |
}); |
|
117 | 125 |
|
118 | 126 |
this.clearTables(); |
119 | 127 |
this.setEditableTables(false); |
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.geodb.app/org.gvsig.geodb.app.mainplugin/src/main/java/org/gvsig/geodb/TableInfo.java | ||
---|---|---|
391 | 391 |
if (this.getGeomFieldSelected() < 0 && requireGeometry()) { |
392 | 392 |
return false; |
393 | 393 |
} |
394 |
if (this.requireGeometry()) { |
|
395 |
FeatureType featType = this.getFeatureType(); |
|
396 |
if (StringUtils.isBlank(this.getGeomField())) { |
|
397 |
return false; |
|
398 |
} |
|
399 |
if (this.getGeometryType() == Geometry.TYPES.NULL || this.getGeometryType() == Geometry.TYPES.UNKNOWN) { |
|
400 |
return false; |
|
401 |
} |
|
402 |
if (this.getGeometrySubtype() == Geometry.SUBTYPES.UNKNOWN) { |
|
403 |
return false; |
|
404 |
} |
|
405 |
} |
|
406 |
|
|
394 | 407 |
JDBCStoreParameters p = this.getParameters(); |
395 | 408 |
try { |
396 | 409 |
p.validate(); |
Also available in: Unified diff