Revision 1886 org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.lib/src/main/java/org/gvsig/tools/dataTypes/impl/DefaultDataTypesManager.java

View differences:

DefaultDataTypesManager.java
36 36
import java.util.Set;
37 37

  
38 38
import org.gvsig.installer.lib.api.Version;
39
import org.gvsig.tools.ToolsLocator;
39 40
import org.gvsig.tools.dataTypes.CoercionException;
40 41
import org.gvsig.tools.dataTypes.DataType;
41 42
import org.gvsig.tools.dataTypes.DataTypes;
......
72 73
    public DefaultDataTypesManager() {
73 74

  
74 75
        this.addtype(BOOLEAN, null, "Boolean", Boolean.class,
75
            new CoerceToBoolean());
76
            new CoerceToBoolean(), "datatype-boolean");
76 77
        this.addtype(BYTE, null, "Byte", Byte.class, new CoerceToByte());
77 78
        this.addtype(CHAR, null, "Char", Character.class, new CoerceToString());
78
        this.addtype(INT, null, "Integer", Integer.class, new CoerceToInt());
79
        this.addtype(LONG, null, "Long", Long.class, new CoerceToLong());
80
        this.addtype(FLOAT, null, "Float", Float.class, new CoerceToFloat());
81
        this.addtype(DOUBLE, null, "Double", Double.class, new CoerceToDouble());
79
        this.addtype(INT, null, "Integer", Integer.class, new CoerceToInt(), "datatype-integer");
80
        this.addtype(LONG, null, "Long", Long.class, new CoerceToLong(),"datatype-long");
81
        this.addtype(FLOAT, null, "Float", Float.class, new CoerceToFloat(),"datatype-float");
82
        this.addtype(DOUBLE, null, "Double", Double.class, new CoerceToDouble(),"datatype-double");
82 83
        this.addtype(BIGDECIMAL, null, "BigDecimal", BigDecimal.class, new CoerceToBigDecimal());
83
        this.addtype(STRING, null, "String", String.class, new CoerceToString());
84
        this.addtype(DATE, SUBTYPE_DATE, "Date", Date.class, new CoerceToDate());
85
        this.addtype(TIME, SUBTYPE_DATE, "Time", Date.class, new CoerceToTime());
86
        this.addtype(TIMESTAMP, null, "Timestamp", Timestamp.class, new CoerceToTimestamp());
84
        this.addtype(STRING, null, "String", String.class, new CoerceToString(), "datatype-string");
85
        this.addtype(DATE, SUBTYPE_DATE, "Date", Date.class, new CoerceToDate(),"datatype-date");
86
        this.addtype(TIME, SUBTYPE_DATE, "Time", Date.class, new CoerceToTime(),"datatype-time");
87
        this.addtype(TIMESTAMP, null, "Timestamp", Timestamp.class, new CoerceToTimestamp(),"datatype-timestamp");
87 88
        this.addtype(VERSION, null, "Version", Version.class, new CoerceToVersion());
88 89

  
89
        this.addtype(BYTEARRAY, null, "ByteArray", null, null);
90
        this.addtype(BYTEARRAY, null, "ByteArray", null, null,"datatype-bytearray");
90 91
        this.addtype(FILE, SUBTYPE_FILE, "File", File.class, new CoerceToFile());
91 92
        this.addtype(FOLDER, SUBTYPE_FOLDER, "Folder", File.class,
92 93
            new CoerceToFile());
......
99 100
        this.addtype(SET, null, "Set", Set.class, null);
100 101
        this.addtype(MAP, null, "Map", Map.class, null);
101 102

  
102
        this.addtype(OBJECT, null, "Object", Object.class, new CoerceToObject());
103
        this.addtype(OBJECT, null, "Object", Object.class, new CoerceToObject(),"datatype-object");
103 104
    }
104 105

  
105 106
    public synchronized int addtype(int type, String subtype, String name,
106 107
        Class defaultClass, Coercion coercion) {
108
        return addtype(type, subtype, name, defaultClass, coercion, null);
109
    }
110
    
111
    public synchronized int addtype(int type, String subtype, String name,
112
        Class defaultClass, Coercion coercion, String iconName) {
107 113
        if (type == INVALID) {
108 114
            type = getNewObjectIndexType();
109 115
        }
......
123 129
        }
124 130

  
125 131
        DataType dataType =
126
            new DefaultDataType(type, subtype, name, defaultClass, coercion);
132
            new DefaultDataType(type, subtype, name, defaultClass, coercion, iconName);
127 133
        types[type] = dataType;
128 134
        LOG.info("Registered data type {}.", dataType.toString());
129 135
        return type;
......
250 256
            "There is not any registered data type with the class or a "
251 257
                + "parent of the class: " + defaultClass);
252 258
    }
259
    
253 260
}

Also available in: Unified diff