Revision 25789 branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dbf/DBFLibrary.java
DBFLibrary.java | ||
---|---|---|
29 | 29 |
|
30 | 30 |
import org.gvsig.fmap.dal.DALFileLocator; |
31 | 31 |
import org.gvsig.fmap.dal.DALLocator; |
32 |
import org.gvsig.fmap.dal.DataTypes; |
|
32 | 33 |
import org.gvsig.fmap.dal.spi.DataManagerProviderServices; |
34 |
import org.gvsig.tools.dynobject.DynClass; |
|
35 |
import org.gvsig.tools.dynobject.DynField; |
|
36 |
import org.gvsig.tools.dynobject.DynObjectValueItem; |
|
33 | 37 |
import org.gvsig.tools.locator.BaseLibrary; |
34 | 38 |
import org.gvsig.tools.locator.ReferenceNotRegisteredException; |
35 | 39 |
|
36 | 40 |
|
37 | 41 |
public class DBFLibrary extends BaseLibrary { |
38 | 42 |
|
43 |
public static final String DYNFIELD_CODEPAGE_NAME = "codePage"; |
|
44 |
|
|
45 |
static DynField addCodePageField(DynClass dynClass) { |
|
46 |
|
|
47 |
DynField dynField = dynClass.addDynField(DYNFIELD_CODEPAGE_NAME); |
|
48 |
dynField.setDescription("Code Page"); |
|
49 |
dynField.setDefaultValue(new Byte((byte) 0x2)); |
|
50 |
dynField.setType(DataTypes.BYTE); |
|
51 |
dynField.setTheTypeOfAvailableValues(DynField.CHOICE); |
|
52 |
dynField.setAvailableValues(new DynObjectValueItem[] { |
|
53 |
new DynObjectValueItem(new Byte((byte) 0x1),"DOS USA"), |
|
54 |
new DynObjectValueItem(new Byte((byte) 0x2),"DOS Multilingual"), |
|
55 |
new DynObjectValueItem(new Byte((byte) 0x3),"Windows ANSI"), |
|
56 |
new DynObjectValueItem(new Byte((byte) 0x4),"Standard Macintosh"), |
|
57 |
new DynObjectValueItem(new Byte((byte) 0x64),"EE MS-DOS"), |
|
58 |
new DynObjectValueItem(new Byte((byte) 0x65),"Nordic MS-DOS"), |
|
59 |
new DynObjectValueItem(new Byte((byte) 0x66),"Russian MS-DOS"), |
|
60 |
new DynObjectValueItem(new Byte((byte) 0x67),"Icelandic MS-DOS"), |
|
61 |
new DynObjectValueItem(new Byte((byte) 0x68),"Kamenicky (Czech) MS-DOS"), |
|
62 |
new DynObjectValueItem(new Byte((byte) 0x69),"Mazovia (Polish) MS-DOS"), |
|
63 |
new DynObjectValueItem(new Byte((byte) 0x6A),"Greek MS-DOS (437G)"), |
|
64 |
new DynObjectValueItem(new Byte((byte) 0x6B),"Turkish MS-DOS"), |
|
65 |
new DynObjectValueItem(new Byte((byte) 0x96),"Russian Macintosh"), |
|
66 |
new DynObjectValueItem(new Byte((byte) 0x97),"Eastern European Macintosh"), |
|
67 |
new DynObjectValueItem(new Byte((byte) 0x98),"Greek Macintosh"), |
|
68 |
new DynObjectValueItem(new Byte((byte) 0xC8),"Windows EE"), |
|
69 |
new DynObjectValueItem(new Byte((byte) 0xC9),"Russian Windows"), |
|
70 |
new DynObjectValueItem(new Byte((byte) 0xCA),"Turkish Windows"), |
|
71 |
new DynObjectValueItem(new Byte((byte) 0xCB),"Greek Windows"), |
|
72 |
|
|
73 |
}); |
|
74 |
return dynField; |
|
75 |
|
|
76 |
} |
|
77 |
|
|
39 | 78 |
public void postInitialize() throws ReferenceNotRegisteredException { |
40 | 79 |
super.postInitialize(); |
41 | 80 |
|
42 |
// DynObjectManager dynObjectManager = |
|
43 |
// ToolsLocator.getDynObjectManager(); |
|
44 |
// |
|
45 |
// DynClass dynClass = dynObjectManager.add("DBFStoreParameters", |
|
46 |
// "DBF File Store parameters"); |
|
47 |
// dynClass.addDynField("dbffilename"); |
|
48 | 81 |
|
82 |
DBFStoreParameters.registerDynClass(); |
|
83 |
DBFNewStoreParameters.registerDynClass(); |
|
84 |
DBFStoreProvider.registerDynClass(); |
|
85 |
|
|
49 | 86 |
DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator |
50 | 87 |
.getDataManager(); |
51 | 88 |
|
... | ... | |
54 | 91 |
DBFStoreProvider.class, DBFStoreParameters.class); |
55 | 92 |
} |
56 | 93 |
|
94 |
|
|
95 |
|
|
57 | 96 |
DALFileLocator.getFilesystemServerExplorerManager().registerProvider( |
58 | 97 |
DBFStoreProvider.NAME, DBFStoreProvider.DESCRIPTION, |
59 | 98 |
DBFFilesystemServerProvider.class); |
Also available in: Unified diff