Revision 45154 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.swing/org.gvsig.fmap.dal.swing.impl/src/main/java/org/gvsig/fmap/dal/swing/impl/featuretype/DefaultFeatureAttributePanel.java
DefaultFeatureAttributePanel.java | ||
---|---|---|
6 | 6 |
import java.awt.event.ItemEvent; |
7 | 7 |
import java.net.URL; |
8 | 8 |
import java.util.ArrayList; |
9 |
import java.util.Collections; |
|
9 | 10 |
import java.util.List; |
10 | 11 |
import java.util.Objects; |
11 | 12 |
import javax.swing.DefaultComboBoxModel; |
... | ... | |
96 | 97 |
implements FeatureTypeAttributePanel { |
97 | 98 |
|
98 | 99 |
private static final Logger LOGGER = LoggerFactory.getLogger(DefaultFeatureAttributePanel.class); |
100 |
|
|
101 |
// ---- |
|
102 |
// Los he eliminado del GUI pero los mantengo aqui por si decido rescatarlos |
|
103 |
private final JTextComponent txtMaxValue = new JTextField(); |
|
104 |
private final JTextComponent txtMinValue = new JTextField(); |
|
105 |
private final JComponent lblMinValue = new JLabel(); |
|
106 |
private final JComponent lblMaxValue = new JLabel(); |
|
107 |
// ---- |
|
99 | 108 |
|
100 | 109 |
private static class ForeingKeyController { |
101 | 110 |
|
... | ... | |
105 | 114 |
private final JComboBox cboCode; |
106 | 115 |
private final JTextField txtFormula; |
107 | 116 |
private final JButton btnFormula; |
117 |
private final JButton btnFormulaHistory; |
|
118 |
private final JButton btnFormulaBokkmarks; |
|
108 | 119 |
private ExpressionPickerController pickerFormula; |
109 | 120 |
private boolean editable; |
110 | 121 |
private FeatureStoreElement featureStoreElement; |
... | ... | |
116 | 127 |
JComboBox cboTable, |
117 | 128 |
JComboBox cboCode, |
118 | 129 |
JTextField txtFormula, |
119 |
JButton btnFormula |
|
130 |
JButton btnFormula, |
|
131 |
JButton btnFormulaBokkmarks, |
|
132 |
JButton btnFormulaHistory |
|
120 | 133 |
) { |
121 | 134 |
this.chkIsForeingKey = chkIsForeingKey; |
122 | 135 |
this.chkIsClosedList = chkIsClosedList; |
... | ... | |
124 | 137 |
this.cboCode = cboCode; |
125 | 138 |
this.txtFormula = txtFormula; |
126 | 139 |
this.btnFormula = btnFormula; |
140 |
this.btnFormulaHistory = btnFormulaHistory; |
|
141 |
this.btnFormulaBokkmarks = btnFormulaBokkmarks; |
|
127 | 142 |
this.initComponents(); |
128 | 143 |
} |
129 | 144 |
|
... | ... | |
134 | 149 |
|
135 | 150 |
DefaultComboBoxModel<String> model = new DefaultComboBoxModel(); |
136 | 151 |
StoresRepository repository = DALLocator.getDataManager().getStoresRepository(); |
152 |
List<String> tableNames = new ArrayList<>(); |
|
137 | 153 |
for (String tableName : repository.keySet()) { |
154 |
tableNames.add(tableName); |
|
155 |
} |
|
156 |
Collections.sort(tableNames); |
|
157 |
for (String tableName : tableNames) { |
|
138 | 158 |
model.addElement(tableName); |
139 | 159 |
} |
140 | 160 |
this.cboTable.setModel(model); |
... | ... | |
148 | 168 |
th.start(); |
149 | 169 |
}); |
150 | 170 |
this.btnFormula.setText(""); |
171 |
this.btnFormulaBokkmarks.setText(""); |
|
172 |
this.btnFormulaHistory.setText(""); |
|
151 | 173 |
this.featureStoreElement = dataSwingManager.createFeatureStoreElement(); |
152 | 174 |
this.pickerFormula = ExpressionEvaluatorSwingLocator.getManager() |
153 |
.createExpressionPickerController(txtFormula, btnFormula); |
|
175 |
.createExpressionPickerController(txtFormula, btnFormula, btnFormulaBokkmarks, btnFormulaHistory);
|
|
154 | 176 |
this.pickerFormula.addElement(this.featureStoreElement); |
155 | 177 |
|
156 | 178 |
// this.chkIsForeingKey.addChangeListener(new ChangeListener() { |
... | ... | |
603 | 625 |
cboForeingKeyTableName, |
604 | 626 |
cboForeingKeyCodeName, |
605 | 627 |
txtForeingKeyFormula, |
606 |
btnForeingKeyFormula |
|
628 |
btnForeingKeyFormula, |
|
629 |
btnForeingKeyFormulaBookmarks, |
|
630 |
btnForeingKeyFormulaHistory |
|
607 | 631 |
); |
608 | 632 |
this.pickerIntervalEnd = swingManager.createDatePickerController( |
609 | 633 |
this.txtIntervalEnd, |
... | ... | |
653 | 677 |
this.btnVirtualField.setText(""); |
654 | 678 |
this.featureStoreElement = dataSwingManager.createFeatureStoreElement(); |
655 | 679 |
this.pickerVirtualField = ExpressionEvaluatorSwingLocator.getManager() |
656 |
.createExpressionPickerController(txtVirtualField, btnVirtualField); |
|
680 |
.createExpressionPickerController(txtVirtualField, btnVirtualField, btnVirtualFieldBookmarks, btnVirtualFieldHistory);
|
|
657 | 681 |
this.pickerVirtualField.addElement(this.featureStoreElement); |
658 | 682 |
this.chkVirtualField.addChangeListener((ChangeEvent e) -> { |
659 | 683 |
if (chkVirtualField.isSelected()) { |
... | ... | |
1211 | 1235 |
DataType dataType = this.getDataType(); |
1212 | 1236 |
switch(this.mode) { |
1213 | 1237 |
case MODE_EDIT_ALL: |
1238 |
this.cboRelationType.setEnabled(true); |
|
1214 | 1239 |
this.txtDefaultValue.setEditable(true); |
1215 | 1240 |
this.txtFieldName.setEditable(true); |
1216 | 1241 |
this.pickerIntervalEnd.setEditable(true); |
... | ... | |
1276 | 1301 |
this.pickerCRS.setEditable(false); |
1277 | 1302 |
} |
1278 | 1303 |
|
1304 |
this.cboRelationType.setEnabled(true); |
|
1279 | 1305 |
this.txtDefaultValue.setEditable(true); |
1280 | 1306 |
this.pickerIntervalEnd.setEditable(true); |
1281 | 1307 |
this.pickerIntervalStart.setEditable(true); |
... | ... | |
1307 | 1333 |
this.foreingKeyController.setEditable(true); |
1308 | 1334 |
break; |
1309 | 1335 |
case MODE_SHOW_ONLY: |
1336 |
this.cboRelationType.setEnabled(false); |
|
1310 | 1337 |
this.txtDefaultValue.setEditable(false); |
1311 | 1338 |
this.txtFieldName.setEditable(false); |
1312 | 1339 |
this.pickerIntervalEnd.setEditable(false); |
Also available in: Unified diff