svn-gvsig-desktop / 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 / dataStoreParameters / DataStoreDynObjectParametersPanel.java @ 43720
History | View | Annotate | Download (1.45 KB)
1 | 42754 | jjdelcerro | |
---|---|---|---|
2 | 43208 | jjdelcerro | package org.gvsig.fmap.dal.swing.impl.dataStoreParameters; |
3 | 42754 | jjdelcerro | |
4 | import java.awt.Dimension; |
||
5 | import javax.swing.JComponent; |
||
6 | 43208 | jjdelcerro | import org.gvsig.fmap.dal.swing.dataStoreParameters.AbstractDataStoreParametersPanel; |
7 | 42754 | jjdelcerro | import org.gvsig.tools.dynform.DynFormLocator; |
8 | import org.gvsig.tools.dynform.JDynForm; |
||
9 | import org.gvsig.tools.dynobject.DynObject; |
||
10 | import org.gvsig.tools.service.ServiceException; |
||
11 | |||
12 | |||
13 | 43208 | jjdelcerro | public class DataStoreDynObjectParametersPanel extends AbstractDataStoreParametersPanel { |
14 | 43720 | jjdelcerro | private final DynObject parameters; |
15 | 42754 | jjdelcerro | private JDynForm form;
|
16 | |||
17 | 43208 | jjdelcerro | public DataStoreDynObjectParametersPanel(DynObject paramters) {
|
18 | 43720 | jjdelcerro | this.parameters = paramters;
|
19 | 42754 | jjdelcerro | try {
|
20 | 43720 | jjdelcerro | this.form = DynFormLocator.getDynFormManager().createJDynForm(this.parameters); |
21 | 42754 | jjdelcerro | } catch (ServiceException ex) {
|
22 | 43720 | jjdelcerro | throw new RuntimeException("Can't create JDynForm from '"+this.parameters.getDynClass().getFullName()+"'.", ex); |
23 | 42754 | jjdelcerro | } |
24 | this.form.setLayoutMode(this.form.USE_TABS); |
||
25 | |||
26 | } |
||
27 | |||
28 | @Override
|
||
29 | public void putParameters(DynObject parameters) { |
||
30 | 43720 | jjdelcerro | this.form.setValues(parameters);
|
31 | 42754 | jjdelcerro | } |
32 | |||
33 | @Override
|
||
34 | public void fetchParameters(DynObject parameters) { |
||
35 | 43720 | jjdelcerro | this.form.getValues(parameters);
|
36 | 42754 | jjdelcerro | } |
37 | |||
38 | @Override
|
||
39 | public JComponent asJComponent() { |
||
40 | JComponent x = this.form.asJComponent(); |
||
41 | x.setPreferredSize(new Dimension(500,250)); |
||
42 | return x;
|
||
43 | } |
||
44 | 43172 | fdiaz | |
45 | @Override
|
||
46 | public JDynForm getForm() {
|
||
47 | return this.form; |
||
48 | } |
||
49 | |||
50 | 42754 | jjdelcerro | } |