47 |
47 |
import java.awt.event.ActionListener;
|
48 |
48 |
import java.sql.Types;
|
49 |
49 |
import java.text.ParseException;
|
|
50 |
import java.util.ArrayList;
|
50 |
51 |
|
51 |
52 |
import javax.swing.DefaultCellEditor;
|
52 |
53 |
import javax.swing.JComboBox;
|
... | ... | |
63 |
64 |
import javax.swing.table.TableColumn;
|
64 |
65 |
import javax.swing.table.TableModel;
|
65 |
66 |
|
66 |
|
import org.gvsig.gui.beans.swing.GridBagLayoutPanel;
|
67 |
67 |
import org.gvsig.gui.beans.swing.JButton;
|
68 |
68 |
|
69 |
|
import sun.net.www.content.image.jpeg;
|
70 |
|
|
71 |
69 |
import com.hardcode.driverManager.DriverLoadException;
|
72 |
70 |
import com.hardcode.gdbms.engine.data.driver.DriverException;
|
73 |
71 |
import com.iver.andami.PluginServices;
|
... | ... | |
108 |
106 |
|
109 |
107 |
private FPanelCreateField panelNewField = new FPanelCreateField();
|
110 |
108 |
|
|
109 |
|
111 |
110 |
// private IFieldManager fieldManager;;
|
112 |
111 |
private EditableAdapter edAdapter = null;
|
113 |
112 |
|
... | ... | |
442 |
441 |
jBtnNewField = new JButton();
|
443 |
442 |
jBtnNewField.setText(PluginServices.getText(this, "new_field"));
|
444 |
443 |
jBtnNewField.addActionListener(new java.awt.event.ActionListener() {
|
|
444 |
private ArrayList tempFieldNames = new ArrayList();
|
|
445 |
|
|
446 |
{
|
|
447 |
try{
|
|
448 |
String[] f = edAdapter.getRecordset().getFieldNames();
|
|
449 |
for (int i = 0; i < f.length; i++) {
|
|
450 |
tempFieldNames.add(f[i]);
|
|
451 |
}
|
|
452 |
} catch (Exception ex) {}
|
|
453 |
}
|
|
454 |
|
445 |
455 |
public void actionPerformed(java.awt.event.ActionEvent e) {
|
446 |
|
|
447 |
456 |
ActionListener okAction;
|
448 |
457 |
okAction = new java.awt.event.ActionListener() {
|
449 |
458 |
|
... | ... | |
454 |
463 |
JOptionPane.showMessageDialog(DlgFieldManager.this, PluginServices.getText(this, "max_length_is") + ":" + MAX_FIELD_LENGTH);
|
455 |
464 |
fld.setFieldLength(MAX_FIELD_LENGTH);
|
456 |
465 |
}
|
|
466 |
|
457 |
467 |
if (edAdapter.getRecordset().getFieldIndexByName(fld.getFieldAlias()) != -1)
|
458 |
468 |
{
|
459 |
469 |
JOptionPane.showMessageDialog(
|
... | ... | |
461 |
471 |
PluginServices.getText(this, "field_already_exists"));
|
462 |
472 |
return;
|
463 |
473 |
}
|
|
474 |
tempFieldNames.add(fld.getFieldAlias());
|
464 |
475 |
edAdapter.addField(fld);
|
465 |
476 |
jTableFields.revalidate();
|
466 |
477 |
PluginServices.getMDIManager().closeWindow(panelNewField);
|
... | ... | |
478 |
489 |
}
|
479 |
490 |
};
|
480 |
491 |
panelNewField.setOkAction(okAction);
|
|
492 |
String[] names = (String[]) tempFieldNames.toArray(new String[0]);
|
|
493 |
panelNewField.setCurrentFieldNames(names);
|
481 |
494 |
panelNewField = (FPanelCreateField) PluginServices.getMDIManager().addWindow(panelNewField);
|
482 |
495 |
}
|
483 |
496 |
});
|