Statistics
| Revision:

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
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
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
/*
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
import org.gvsig.tools.dynobject.DynField;
38
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
 * 
47
 */
48
public class JDynObjectDynfieldComponentFactory extends
49
    AbstractJDynFieldComponentFactory implements JDynFieldComponentFactory {
50

    
51
        private static final String DESCRIPTION = "Creates Swing components to rendere DynObject values";
52

    
53
        public JDynFieldComponent createJDynFieldComponent( DynField definition,
54
                        ValueField dynObjectValueField, boolean writable)
55
                        throws ServiceException {
56

    
57
                // TODO: take into account the writable flag
58

    
59
//        DynObjectManager dynManager = ToolsLocator.getDynObjectManager();
60
//        DynField dynField = dynObjectValueField.getDynField();
61
        
62
//        dynObject = (DynObject) dynObjectValueField.getFieldValue();
63
//        String className = dynField.getName();
64
        
65
        // 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

    
72
        return new JDynObjectDynFieldComponent(definition, dynObjectValueField, writable);
73
    }
74

    
75
    /*
76
     * (non-Javadoc)
77
     * 
78
     * @see
79
     * org.gvsig.tools.swing.spi.AbstractSwingServiceFactory#getFactoryDescription
80
     * ()
81
     */
82
    @Override
83
    public String getFactoryDescription() {
84
        // TODO Auto-generated method stub
85
        return this.DESCRIPTION;
86
    }
87

    
88
    /*
89
     * (non-Javadoc)
90
     * 
91
     * @see
92
     * org.gvsig.tools.swing.spi.AbstractSwingServiceFactory#getFactorySubType()
93
     */
94
    @Override
95
    public String getFactorySubType() {
96
        return null;
97
    }
98

    
99
    /*
100
     * (non-Javadoc)
101
     * 
102
     * @see
103
     * org.gvsig.tools.swing.spi.AbstractSwingServiceFactory#getFactoryType()
104
     */
105
    @Override
106
    public Integer getFactoryType() {
107
        return DataTypes.DYNOBJECT;
108
    }
109

    
110
}