20 |
20 |
import org.gvsig.tools.dynform.spi.DynFormSPIManager;
|
21 |
21 |
|
22 |
22 |
import com.jeta.forms.components.panel.FormPanel;
|
|
23 |
import java.awt.Color;
|
23 |
24 |
import java.awt.event.ActionEvent;
|
24 |
25 |
import java.awt.event.ActionListener;
|
25 |
26 |
import java.io.File;
|
26 |
27 |
import java.util.ArrayList;
|
27 |
28 |
import java.util.Iterator;
|
28 |
29 |
import java.util.List;
|
|
30 |
import javax.swing.BorderFactory;
|
29 |
31 |
import javax.swing.JButton;
|
30 |
32 |
import javax.swing.JLabel;
|
31 |
33 |
import javax.swing.JList;
|
... | ... | |
51 |
53 |
import org.gvsig.tools.dynform.spi.dynform.JDynFormFactory;
|
52 |
54 |
import org.gvsig.tools.dynform.spi.dynformfield.AbstractJDynFormField;
|
53 |
55 |
import org.gvsig.tools.dynform.spi.dynformfield.JDynFormFieldFactory;
|
|
56 |
import org.gvsig.tools.dynobject.DynField;
|
54 |
57 |
import org.gvsig.tools.dynobject.DynObject;
|
55 |
58 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage;
|
56 |
59 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage.Resource;
|
... | ... | |
342 |
345 |
this.configurePopupMenu(jfield);
|
343 |
346 |
|
344 |
347 |
this.components.put(jfield.getName(), jfield);
|
345 |
|
jfield.asJComponent(); // Forzamos que se inicialize
|
346 |
|
jfield.getJLabel(); // Forzamos que se inicialize
|
|
348 |
jfield.asJComponent(); // Forzamos que se inicialize
|
|
349 |
jfield.getJLabel(); // Forzamos que se inicialize
|
347 |
350 |
} catch(Throwable th1) {
|
348 |
351 |
LOGGER.warn("Can't load field '"+definition.getName()+"' for abeille form '"+resourceName+"'.", th1);
|
349 |
352 |
}
|
... | ... | |
449 |
452 |
|
450 |
453 |
@Override
|
451 |
454 |
public JDynFormField getField(String fieldName) {
|
452 |
|
if (!this.isContentsInitialized()) {
|
453 |
|
this.initComponents();
|
454 |
|
}
|
455 |
455 |
JDynFormField field = this.components.get(fieldName);
|
456 |
456 |
return field;
|
457 |
457 |
}
|
458 |
458 |
|
|
459 |
|
459 |
460 |
@Override
|
460 |
461 |
public void getValues(DynObject values) {
|
461 |
462 |
if (values == null) {
|
462 |
463 |
return;
|
463 |
464 |
}
|
464 |
|
for (JDynFormField jfield : this.getFields()) {
|
465 |
|
try {
|
466 |
|
jfield.fetch(values);
|
467 |
|
} catch (Exception ex) {
|
468 |
|
LOGGER.warn("Can't get value of field '" + jfield.getName() + "'.", ex);
|
|
465 |
DynField[] fields = values.getDynClass().getDynFields();
|
|
466 |
for (DynField field : fields) {
|
|
467 |
String name = field.getName();
|
|
468 |
JDynFormField jfield = (JDynFormField) this.getField(name);
|
|
469 |
if (jfield != null && !jfield.isReadOnly()) {
|
|
470 |
try {
|
|
471 |
jfield.fetch(values);
|
|
472 |
} catch (Exception ex) {
|
|
473 |
LOGGER.warn("Can't get value of field '" + name + "'.", ex);
|
|
474 |
}
|
469 |
475 |
}
|
470 |
476 |
}
|
471 |
477 |
}
|
472 |
|
|
|
478 |
|
473 |
479 |
@Override
|
474 |
480 |
public Object getValue(String fieldName) {
|
475 |
481 |
JDynFormField field = (JDynFormField) this.getField(fieldName);
|