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 @ 43020
History | View | Annotate | Download (3.01 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
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 3
|
||
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 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | 40435 | jjdelcerro | package org.gvsig.fmap.dal.serverexplorer.filesystem; |
25 | |||
26 | import org.gvsig.fmap.dal.DataServerExplorerParameters; |
||
27 | import org.gvsig.fmap.dal.DataTypes; |
||
28 | import org.gvsig.fmap.dal.spi.AbstractDataParameters; |
||
29 | import org.gvsig.tools.ToolsLocator; |
||
30 | import org.gvsig.tools.dynobject.DelegatedDynObject; |
||
31 | import org.gvsig.tools.dynobject.DynClass; |
||
32 | import org.gvsig.tools.dynobject.DynField; |
||
33 | import org.gvsig.tools.dynobject.DynObjectManager; |
||
34 | |||
35 | public class FilesystemServerExplorerParameters extends AbstractDataParameters |
||
36 | implements DataServerExplorerParameters {
|
||
37 | |||
38 | public static final String DYNCLASS_NAME = "FilesystemServerExplorerParameters"; |
||
39 | |||
40 | private static final String FIELD_ROOT = "root"; |
||
41 | |||
42 | private DelegatedDynObject delegatedDynObject;
|
||
43 | |||
44 | public FilesystemServerExplorerParameters() {
|
||
45 | this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
|
||
46 | .getDynObjectManager() |
||
47 | .createDynObject(this.registerDynClass());
|
||
48 | } |
||
49 | |||
50 | private DynClass registerDynClass() {
|
||
51 | DynObjectManager dynman = ToolsLocator.getDynObjectManager(); |
||
52 | DynClass dynClass = dynman.get(DYNCLASS_NAME); |
||
53 | DynField field; |
||
54 | if (dynClass == null) { |
||
55 | dynClass = dynman.add(DYNCLASS_NAME); |
||
56 | |||
57 | field = dynClass.addDynField(FIELD_ROOT); |
||
58 | field.setType(DataTypes.STRING); |
||
59 | field.setDescription("Root directory path of the explorer");
|
||
60 | field.setTheTypeOfAvailableValues(DynField.ANY); |
||
61 | |||
62 | |||
63 | field = dynClass.addDynField("initialpath");
|
||
64 | field.setType(DataTypes.STRING); |
||
65 | field.setDescription("Initial path of the explorer");
|
||
66 | field.setTheTypeOfAvailableValues(DynField.ANY); |
||
67 | |||
68 | } |
||
69 | return dynClass;
|
||
70 | } |
||
71 | |||
72 | public void setRoot(String path) { |
||
73 | this.setDynValue(FIELD_ROOT, path);
|
||
74 | } |
||
75 | |||
76 | public String getRoot() { |
||
77 | return (String) this.getDynValue(FIELD_ROOT); |
||
78 | } |
||
79 | |||
80 | public void setInitialpath(String path) { |
||
81 | this.setDynValue("initialpath", path); |
||
82 | } |
||
83 | |||
84 | public String getInitialpath() { |
||
85 | return (String) this.getDynValue("initialpath"); |
||
86 | } |
||
87 | |||
88 | public String getExplorerName() { |
||
89 | return FilesystemServerExplorer.NAME;
|
||
90 | } |
||
91 | |||
92 | protected DelegatedDynObject getDelegatedDynObject() {
|
||
93 | return delegatedDynObject;
|
||
94 | } |
||
95 | } |