gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.swing / org.gvsig.tools.swing.impl / src / main / java / org / gvsig / tools / swing / impl / dynobject / dynfield / JDynObjectDynfieldComponentFactory.java @ 586
History | View | Annotate | Download (3.54 KB)
1 | 168 | cmartin | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | 270 | cmartin | *
|
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | 168 | cmartin | /*
|
23 | * AUTHORS (In addition to CIT):
|
||
24 | * 2010 Institute of New Imaging Technologies (INIT):
|
||
25 | * http://www.init.uji.es
|
||
26 | * Geographic Information research group:
|
||
27 | * http://www.geoinfo.uji.es
|
||
28 | * Universitat Jaume I, Spain
|
||
29 | */
|
||
30 | |||
31 | /**
|
||
32 | *
|
||
33 | */
|
||
34 | package org.gvsig.tools.swing.impl.dynobject.dynfield; |
||
35 | |||
36 | import org.gvsig.tools.dataTypes.DataTypes; |
||
37 | 535 | cmartin | import org.gvsig.tools.dynobject.DynField; |
38 | 168 | cmartin | import org.gvsig.tools.service.ServiceException; |
39 | import org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponent; |
||
40 | import org.gvsig.tools.swing.api.dynobject.dynfield.JDynFieldComponentFactory; |
||
41 | import org.gvsig.tools.swing.api.dynobject.dynfield.ValueField; |
||
42 | import org.gvsig.tools.swing.spi.AbstractJDynFieldComponentFactory; |
||
43 | |||
44 | /**
|
||
45 | * @author <a href="mailto:reinhold@uji.es">cmartin</a>
|
||
46 | 270 | cmartin | *
|
47 | 168 | cmartin | */
|
48 | 270 | cmartin | public class JDynObjectDynfieldComponentFactory extends |
49 | AbstractJDynFieldComponentFactory implements JDynFieldComponentFactory {
|
||
50 | 168 | cmartin | |
51 | 306 | cordinyana | private static final String DESCRIPTION = "Creates Swing components to rendere DynObject values"; |
52 | 168 | cmartin | |
53 | 535 | cmartin | public JDynFieldComponent createJDynFieldComponent( DynField definition,
|
54 | 306 | cordinyana | ValueField dynObjectValueField, boolean writable)
|
55 | throws ServiceException {
|
||
56 | 298 | cmartin | |
57 | 306 | cordinyana | // TODO: take into account the writable flag
|
58 | 298 | cmartin | |
59 | 306 | cordinyana | // DynObjectManager dynManager = ToolsLocator.getDynObjectManager();
|
60 | // DynField dynField = dynObjectValueField.getDynField();
|
||
61 | |||
62 | // dynObject = (DynObject) dynObjectValueField.getFieldValue();
|
||
63 | // String className = dynField.getName();
|
||
64 | |||
65 | 270 | cmartin | // if (dynObject==null)
|
66 | // this.dynObject =
|
||
67 | // dynManager.createDynObject(dynManager.get(dynField.getElementsType().getName()));
|
||
68 | // else
|
||
69 | // this.dynObject =
|
||
70 | // dynManager.createDynObject(dynManager.get(className));
|
||
71 | 535 | cmartin | |
72 | return new JDynObjectDynFieldComponent(definition, dynObjectValueField, writable); |
||
73 | 168 | cmartin | } |
74 | 270 | cmartin | |
75 | /*
|
||
76 | * (non-Javadoc)
|
||
77 | *
|
||
78 | * @see
|
||
79 | * org.gvsig.tools.swing.spi.AbstractSwingServiceFactory#getFactoryDescription
|
||
80 | * ()
|
||
81 | 168 | cmartin | */
|
82 | @Override
|
||
83 | public String getFactoryDescription() { |
||
84 | 270 | cmartin | // TODO Auto-generated method stub
|
85 | 306 | cordinyana | return this.DESCRIPTION; |
86 | 168 | cmartin | } |
87 | |||
88 | 270 | cmartin | /*
|
89 | * (non-Javadoc)
|
||
90 | *
|
||
91 | * @see
|
||
92 | * org.gvsig.tools.swing.spi.AbstractSwingServiceFactory#getFactorySubType()
|
||
93 | 168 | cmartin | */
|
94 | @Override
|
||
95 | public String getFactorySubType() { |
||
96 | 270 | cmartin | return null; |
97 | 168 | cmartin | } |
98 | |||
99 | 270 | cmartin | /*
|
100 | * (non-Javadoc)
|
||
101 | *
|
||
102 | * @see
|
||
103 | * org.gvsig.tools.swing.spi.AbstractSwingServiceFactory#getFactoryType()
|
||
104 | 168 | cmartin | */
|
105 | @Override
|
||
106 | public Integer getFactoryType() { |
||
107 | 270 | cmartin | return DataTypes.DYNOBJECT;
|
108 | 168 | cmartin | } |
109 | |||
110 | } |