svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.file / org.gvsig.fmap.dal.file.lib / src / main / java / org / gvsig / fmap / dal / serverexplorer / filesystem / FilesystemServerExplorerParameters.java @ 40435
History | View | Annotate | Download (2.08 KB)
1 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.serverexplorer.filesystem; |
---|---|---|---|
2 | |||
3 | import org.gvsig.fmap.dal.DataServerExplorerParameters; |
||
4 | import org.gvsig.fmap.dal.DataTypes; |
||
5 | import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
||
6 | import org.gvsig.tools.ToolsLocator; |
||
7 | import org.gvsig.tools.dynobject.DelegatedDynObject; |
||
8 | import org.gvsig.tools.dynobject.DynClass; |
||
9 | import org.gvsig.tools.dynobject.DynField; |
||
10 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
11 | |||
12 | public class FilesystemServerExplorerParameters extends AbstractDataParameters |
||
13 | implements DataServerExplorerParameters {
|
||
14 | |||
15 | public static final String DYNCLASS_NAME = "FilesystemServerExplorerParameters"; |
||
16 | |||
17 | private static final String FIELD_ROOT = "root"; |
||
18 | |||
19 | private DelegatedDynObject delegatedDynObject;
|
||
20 | |||
21 | public FilesystemServerExplorerParameters() {
|
||
22 | this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
|
||
23 | .getDynObjectManager() |
||
24 | .createDynObject(this.registerDynClass());
|
||
25 | } |
||
26 | |||
27 | private DynClass registerDynClass() {
|
||
28 | DynObjectManager dynman = ToolsLocator.getDynObjectManager(); |
||
29 | DynClass dynClass = dynman.get(DYNCLASS_NAME); |
||
30 | DynField field; |
||
31 | if (dynClass == null) { |
||
32 | dynClass = dynman.add(DYNCLASS_NAME); |
||
33 | |||
34 | field = dynClass.addDynField(FIELD_ROOT); |
||
35 | field.setType(DataTypes.STRING); |
||
36 | field.setDescription("Root directory path of the explorer");
|
||
37 | field.setTheTypeOfAvailableValues(DynField.ANY); |
||
38 | |||
39 | |||
40 | field = dynClass.addDynField("initialpath");
|
||
41 | field.setType(DataTypes.STRING); |
||
42 | field.setDescription("Initial path of the explorer");
|
||
43 | field.setTheTypeOfAvailableValues(DynField.ANY); |
||
44 | |||
45 | } |
||
46 | return dynClass;
|
||
47 | } |
||
48 | |||
49 | public void setRoot(String path) { |
||
50 | this.setDynValue(FIELD_ROOT, path);
|
||
51 | } |
||
52 | |||
53 | public String getRoot() { |
||
54 | return (String) this.getDynValue(FIELD_ROOT); |
||
55 | } |
||
56 | |||
57 | public void setInitialpath(String path) { |
||
58 | this.setDynValue("initialpath", path); |
||
59 | } |
||
60 | |||
61 | public String getInitialpath() { |
||
62 | return (String) this.getDynValue("initialpath"); |
||
63 | } |
||
64 | |||
65 | public String getExplorerName() { |
||
66 | return FilesystemServerExplorer.NAME;
|
||
67 | } |
||
68 | |||
69 | protected DelegatedDynObject getDelegatedDynObject() {
|
||
70 | return delegatedDynObject;
|
||
71 | } |
||
72 | } |