Revision 9529 branches/piloto3d/applications/appgvSIG/src/com/iver/cit/gvsig/gui/panels/FPanelCreateField.java
FPanelCreateField.java | ||
---|---|---|
41 | 41 |
package com.iver.cit.gvsig.gui.panels; |
42 | 42 |
|
43 | 43 |
import java.awt.BorderLayout; |
44 |
import java.awt.GridLayout; |
|
44 | 45 |
import java.awt.LayoutManager; |
45 | 46 |
import java.awt.event.ActionListener; |
46 | 47 |
import java.awt.event.KeyEvent; |
47 | 48 |
import java.awt.event.KeyListener; |
48 | 49 |
import java.sql.Types; |
49 | 50 |
import java.text.ParseException; |
50 |
import java.util.Vector; |
|
51 | 51 |
|
52 | 52 |
import javax.swing.JComboBox; |
53 | 53 |
import javax.swing.JLabel; |
... | ... | |
56 | 56 |
|
57 | 57 |
import org.gvsig.gui.beans.AcceptCancelPanel; |
58 | 58 |
|
59 |
import com.hardcode.gdbms.engine.instruction.SemanticException; |
|
60 | 59 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
61 | 60 |
import com.iver.andami.PluginServices; |
62 | 61 |
import com.iver.andami.ui.mdiManager.IWindow; |
63 | 62 |
import com.iver.andami.ui.mdiManager.WindowInfo; |
64 | 63 |
import com.iver.cit.gvsig.fmap.drivers.FieldDescription; |
65 |
import java.awt.GridLayout; |
|
66 | 64 |
|
67 | 65 |
public class FPanelCreateField extends JPanel implements IWindow { |
68 | 66 |
|
... | ... | |
100 | 98 |
}} |
101 | 99 |
public void keyTyped(KeyEvent e) { } |
102 | 100 |
}; |
101 |
private String[] currentFieldNames; |
|
103 | 102 |
|
104 | 103 |
public FPanelCreateField() { |
105 | 104 |
super(); |
... | ... | |
160 | 159 |
if (jTxtFieldName == null) { |
161 | 160 |
jTxtFieldName = new JTextField(); |
162 | 161 |
jTxtFieldName.setBounds(new java.awt.Rectangle(147,15,138,22)); |
162 |
|
|
163 | 163 |
} |
164 | 164 |
return jTxtFieldName; |
165 | 165 |
} |
... | ... | |
361 | 361 |
return jPnlFields; |
362 | 362 |
} |
363 | 363 |
|
364 |
public void setCurrentFieldNames(String[] fieldNames) { |
|
365 |
currentFieldNames = fieldNames; |
|
366 |
String newField = PluginServices.getText(this, "new_field").replaceAll(" +", "_"); |
|
367 |
int index=0; |
|
368 |
for (int i = 0; i < currentFieldNames.length; i++) { |
|
369 |
if (currentFieldNames[i].startsWith(newField)) { |
|
370 |
try { |
|
371 |
index = Integer.parseInt(currentFieldNames[i].replaceAll(newField,"")); |
|
372 |
} catch (Exception e) { /* we don't care */} |
|
373 |
} |
|
374 |
} |
|
375 |
jTxtFieldName.setText(newField+(++index)); |
|
376 |
} |
|
377 |
|
|
364 | 378 |
} // @jve:decl-index=0:visual-constraint="9,10" |
Also available in: Unified diff