Revision 44152 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/DefaultFeatureTypeAttributePanel.java
DefaultFeatureTypeAttributePanel.java | ||
---|---|---|
42 | 42 |
import org.gvsig.timesupport.RelativeInterval; |
43 | 43 |
import org.gvsig.tools.ToolsLocator; |
44 | 44 |
import org.gvsig.tools.dataTypes.DataTypesManager; |
45 |
import org.gvsig.tools.i18n.I18nManager; |
|
45 | 46 |
import org.gvsig.tools.swing.api.ListElement; |
46 | 47 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
47 | 48 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
... | ... | |
204 | 205 |
this.pickerPrecision = evaluatorManager.createCalculatorController( |
205 | 206 |
this.txtPrecision, DataTypes.INT |
206 | 207 |
); |
207 |
// this.pickerFieldName = evaluatorManager.createCalculatorController( |
|
208 |
// this.txtFieldName, DataTypes.STRING |
|
209 |
// ); |
|
210 | 208 |
this.pickerDefaultValue = evaluatorManager.createCalculatorController( |
211 | 209 |
this.txtDefaultValue, DataTypes.OBJECT |
212 | 210 |
); |
... | ... | |
276 | 274 |
|
277 | 275 |
@Override |
278 | 276 |
public EditableFeatureAttributeDescriptor fetch(EditableFeatureAttributeDescriptor descriptor) { |
277 |
I18nManager i18n = ToolsLocator.getI18nManager(); |
|
279 | 278 |
try { |
280 | 279 |
descriptor.setDataType((int) ListElement.getSelected(this.cboFieldType)); |
281 | 280 |
descriptor.setName(this.txtFieldName.getText()); |
282 | 281 |
descriptor.setAllowNull(this.chkAllowNulls.isSelected()); |
283 | 282 |
descriptor.setIsPrimaryKey(this.chkIsPrimaryKey.isSelected()); |
284 | 283 |
descriptor.setIsAutomatic(this.chkIsAutomatic.isSelected()); |
285 |
descriptor.setSize(this.pickerSize.get()); |
|
286 |
descriptor.setPrecision(this.pickerPrecision.get()); |
|
284 |
descriptor.setSize(this.pickerSize.get(0));
|
|
285 |
descriptor.setPrecision(this.pickerPrecision.get(0));
|
|
287 | 286 |
descriptor.setDefaultValue(this.pickerDefaultValue.get()); |
288 | 287 |
switch (descriptor.getType()) { |
289 | 288 |
case DataTypes.GEOMETRY: |
... | ... | |
310 | 309 |
if( expression==null ) { |
311 | 310 |
descriptor.setFeatureAttributeEmulator(null); |
312 | 311 |
} else { |
313 |
if( StringUtils.equalsIgnoreCase("Field1", descriptor.getName()) ) { |
|
314 |
if( !StringUtils.startsWithIgnoreCase(expression.getPhrase(), "IFNULL") ) { |
|
315 |
LOGGER.info("OOhh!!! sa-roto."); |
|
316 |
} |
|
317 |
} |
|
318 | 312 |
DataManager dataManager = DALLocator.getDataManager(); |
319 | 313 |
FeatureAttributeEmulatorExpression emulator = dataManager.createFeatureAttributeEmulatorExpression( |
320 | 314 |
descriptor.getFeatureType(), |
... | ... | |
323 | 317 |
descriptor.setFeatureAttributeEmulator(emulator); |
324 | 318 |
} |
325 | 319 |
} |
320 |
descriptor.setDataProfileName( |
|
321 |
StringUtils.defaultIfBlank((String) this.cboDataProfile.getSelectedItem(),null) |
|
322 |
); |
|
326 | 323 |
} catch (Exception ex) { |
324 |
LOGGER.warn("Can't retrieve information from user form.",ex); |
|
327 | 325 |
ThreadSafeDialogsManager dialogs = ToolsSwingLocator.getThreadSafeDialogsManager(); |
328 | 326 |
dialogs.messageDialog( |
329 |
"Can't retrieve information from user form.", |
|
330 |
"Warning", |
|
327 |
i18n.getTranslation("_Cant_retrieve_information_from_user_form")+ |
|
328 |
"\n"+ |
|
329 |
i18n.getTranslation("_See_log_for_details"), |
|
330 |
i18n.getTranslation("_Warning"), |
|
331 | 331 |
JOptionPane.WARNING_MESSAGE |
332 | 332 |
); |
333 |
return null; |
|
333 | 334 |
} |
334 |
descriptor.setDataProfileName( |
|
335 |
StringUtils.defaultIfBlank((String) this.cboDataProfile.getSelectedItem(),null) |
|
336 |
); |
|
337 | 335 |
return descriptor; |
338 | 336 |
} |
339 | 337 |
|
Also available in: Unified diff