Revision 42832
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/assembly/gvsig-andami-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-andami-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>.</baseDirectory> |
|
32 |
<!-- |
|
33 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
34 |
--> |
|
35 |
<files> |
|
36 |
<file> |
|
37 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
38 |
<outputDirectory>lib</outputDirectory> |
|
39 |
</file> |
|
40 |
<file> |
|
41 |
<source>src/main/resources/default-log4j/log4j.properties</source> |
|
42 |
<outputDirectory>.</outputDirectory> |
|
43 |
</file> |
|
44 |
</files> |
|
45 |
<fileSets> |
|
46 |
<fileSet> |
|
47 |
<directory>src/main/resources-application</directory> |
|
48 |
<outputDirectory>.</outputDirectory> |
|
49 |
</fileSet> |
|
50 |
<fileSet> |
|
51 |
<directory>src/main/resources/org/gvsig/andami</directory> |
|
52 |
<outputDirectory>i18n/andami</outputDirectory> |
|
53 |
</fileSet> |
|
54 |
</fileSets> |
|
55 |
|
|
56 |
<dependencySets> |
|
57 |
<dependencySet> |
|
58 |
<useProjectArtifact>false</useProjectArtifact> |
|
59 |
<useTransitiveDependencies>true</useTransitiveDependencies> |
|
60 |
<outputDirectory>lib</outputDirectory> |
|
61 |
</dependencySet> |
|
62 |
</dependencySets> |
|
63 |
|
|
64 |
</assembly> |
|
65 |
|
|
0 | 66 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/IExtensionExecuteWithArgs.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins; |
|
25 |
|
|
26 |
|
|
27 |
public interface IExtensionExecuteWithArgs { |
|
28 |
|
|
29 |
public void execute(String action, Object[] args); |
|
30 |
} |
|
0 | 31 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/ExclusiveUIExtension.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins; |
|
25 |
|
|
26 |
/** |
|
27 |
* Extensions implementing this interface are able to take control |
|
28 |
* over the user interface, by deciding which of the other extensions |
|
29 |
* will be enabled/disabled or visible/hidden. |
|
30 |
* |
|
31 |
* Besides implementing this interface, the extension needs to |
|
32 |
* be set as ExclusiveUIExtension during Andami startup process. |
|
33 |
* This is performed by providing a command line argument to |
|
34 |
* Andami: |
|
35 |
* <br> |
|
36 |
* <code>ExclusiveUIExtension=ExtensionName</code> |
|
37 |
* |
|
38 |
* @author Cesar Martinez Izquierdo <cesar.martinez@iver.es> |
|
39 |
*/ |
|
40 |
public interface ExclusiveUIExtension extends IExtension { |
|
41 |
|
|
42 |
/** |
|
43 |
* This method is used when this extension is installed as |
|
44 |
* ExclusiveUIExtension. This extension will be asked for |
|
45 |
* each installed extension to determine which of them |
|
46 |
* should be enabled. |
|
47 |
* |
|
48 |
* @return true if the provided extension should be enabled, |
|
49 |
* false if it should be disabled. |
|
50 |
*/ |
|
51 |
public boolean isEnabled(IExtension extension); |
|
52 |
|
|
53 |
/** |
|
54 |
* This method is used when this extension is installed as |
|
55 |
* ExclusiveUIExtension. This extension will be asked for |
|
56 |
* each installed extension to determine which of them |
|
57 |
* should be visible. |
|
58 |
* |
|
59 |
* @return true if the provided extension should be visible, |
|
60 |
* false if it should be hidden. |
|
61 |
*/ |
|
62 |
public boolean isVisible(IExtension extension); |
|
63 |
} |
|
0 | 64 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/status/IUnsavedData.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins.status; |
|
25 |
|
|
26 |
import javax.swing.ImageIcon; |
|
27 |
|
|
28 |
import org.gvsig.andami.plugins.IExtension; |
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
/** |
|
33 |
* <p>This interface represents some unsaved data, associated to one extension. |
|
34 |
* There are methods to get the associated extension, to get info about these |
|
35 |
* data, to get the type of the data and a suitable icon for this type, |
|
36 |
* and a method to save the data.</p> |
|
37 |
* |
|
38 |
* <p>It is used during the Andami termination process, to construct the |
|
39 |
* dialog of unsaved data, although it can be used at any time.</p> |
|
40 |
* |
|
41 |
* <p>Normally, it should not be directly implemented, use the convenience |
|
42 |
* UnsavedData class.</p> |
|
43 |
* |
|
44 |
* @see IExtensionStatus |
|
45 |
* @see UnsavedData |
|
46 |
* @see IExtension |
|
47 |
* @author Cesar Martinez Izquierdo <cesar.martinez@iver.es> |
|
48 |
*/ |
|
49 |
public interface IUnsavedData { |
|
50 |
|
|
51 |
/** |
|
52 |
* Gets the resource name of this unsaved data. Normally, this will be |
|
53 |
* a file path, but it may be different for certain type of unsaved data |
|
54 |
* (for example, database connections). |
|
55 |
* |
|
56 |
* @return The resource name of this unsaved data |
|
57 |
*/ |
|
58 |
public String getResourceName(); |
|
59 |
|
|
60 |
/** |
|
61 |
* <p>Gets a description of this unsaved data. This would be combined with the |
|
62 |
* resource name to show a coherent information to the user.</p> |
|
63 |
* |
|
64 |
* <p>Examples of descriptions: |
|
65 |
* <ul><li>Modified SHP Layer</li> |
|
66 |
* <li>Modified gvSIG project</li> |
|
67 |
* </ul> |
|
68 |
* |
|
69 |
* @return A description for this unsaved data, probably containing the type |
|
70 |
* of data and the kind of modification. |
|
71 |
*/ |
|
72 |
public String getDescription(); |
|
73 |
|
|
74 |
/** |
|
75 |
* <p>Save the existing changes for this resource (for example, save the layer |
|
76 |
* to disk or to the database, etc). The resource should not be closed at this |
|
77 |
* point (files, database connections, etc should no be closed), as they may |
|
78 |
* be still needed by other extensions. Resources should be closed at |
|
79 |
* {@link IExtension#terminate()}.</p> |
|
80 |
* |
|
81 |
* @return true if the data was correctly saved, false if it was not saved |
|
82 |
* (there are many reasons for this: there was an error, the user cancelled |
|
83 |
* the process, etc). |
|
84 |
*/ |
|
85 |
public boolean saveData(); |
|
86 |
|
|
87 |
/** |
|
88 |
* Each IUnsavedData object is associated with one extension, which is |
|
89 |
* in charge of this data. This method gets the extension associated with |
|
90 |
* this object. |
|
91 |
* |
|
92 |
* @return The extension associated with this IUnsavedData object. |
|
93 |
*/ |
|
94 |
public IExtension getExtension(); |
|
95 |
|
|
96 |
/** |
|
97 |
* Gets an icon suitable to represent this type of data. |
|
98 |
* |
|
99 |
* @return An icon representing this type of data, or null if no icon is |
|
100 |
* available |
|
101 |
*/ |
|
102 |
public String getIcon(); |
|
103 |
|
|
104 |
} |
|
0 | 105 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/status/IExtensionStatus.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins.status; |
|
25 |
|
|
26 |
import org.gvsig.andami.plugins.IExtension; |
|
27 |
import org.gvsig.utils.swing.threads.IMonitorableTask; |
|
28 |
|
|
29 |
|
|
30 |
/** |
|
31 |
* <p>This interface provides a framework to query the status of |
|
32 |
* extensions. By default, the interface provides methods to check |
|
33 |
* if the extension has some unsaved data (and save them), and methods |
|
34 |
* to check if the extension has some associated background tasks. |
|
35 |
* However, additional aspects can be included in the status by extending |
|
36 |
* this interface.</p> |
|
37 |
* |
|
38 |
* <p>Each extension will have an associated IExtensionStatus object, which |
|
39 |
* can be used at any time to check the status. This is specially useful |
|
40 |
* during the Andami termination process, to check if there are unfinished |
|
41 |
* tasks which should be attended before exiting.</p> |
|
42 |
* |
|
43 |
* @see IUnsavedData |
|
44 |
* @see UnsavedData |
|
45 |
* @see IExtension |
|
46 |
* @author Cesar Martinez Izquierdo <cesar.martinez@iver.es> |
|
47 |
* |
|
48 |
*/ |
|
49 |
public interface IExtensionStatus { |
|
50 |
/** |
|
51 |
* This method is used to check if the extension has some unsaved data. |
|
52 |
* For example, if the project has been modified, or there is a layer in |
|
53 |
* edition mode. |
|
54 |
* |
|
55 |
* @return true if the extension has some unsaved data, false otherwise. |
|
56 |
*/ |
|
57 |
public boolean hasUnsavedData(); |
|
58 |
|
|
59 |
/** |
|
60 |
* <p>Gets an array of the UnsavedData objects, which contain information about |
|
61 |
* the unsaved data and allows to save it.</p> |
|
62 |
* |
|
63 |
* @return An array of the associated unsaved data, or null in case the extension |
|
64 |
* has not unsaved data. |
|
65 |
*/ |
|
66 |
public IUnsavedData[] getUnsavedData(); |
|
67 |
|
|
68 |
/** |
|
69 |
* This method is used to check if the extension has some associated |
|
70 |
* background process which is currently running. |
|
71 |
* |
|
72 |
* @return true if the extension has some associated background process, |
|
73 |
* false otherwise. |
|
74 |
*/ |
|
75 |
public boolean hasRunningProcesses(); |
|
76 |
|
|
77 |
|
|
78 |
/** |
|
79 |
* <p>Gets an array of the traceable background tasks associated with this |
|
80 |
* extension. These tasks may be tracked, canceled, etc.</p> |
|
81 |
* |
|
82 |
* @return An array of the associated background tasks, or null in case there is |
|
83 |
* no associated background tasks. |
|
84 |
*/ |
|
85 |
public IMonitorableTask[] getRunningProcesses(); |
|
86 |
|
|
87 |
//public IStatusGUI getGUI(); |
|
88 |
} |
|
0 | 89 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/status/UnsavedData.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins.status; |
|
25 |
|
|
26 |
import javax.swing.ImageIcon; |
|
27 |
|
|
28 |
import org.gvsig.andami.plugins.IExtension; |
|
29 |
|
|
30 |
|
|
31 |
/** |
|
32 |
* Abstract class implementing IUnsavedData. is a convenience |
|
33 |
* class used to allow easier modifications of IUnsaveData |
|
34 |
* interface. |
|
35 |
* |
|
36 |
* @author Cesar Martinez Izquierdo <cesar.martinez@iver.es> |
|
37 |
* |
|
38 |
*/ |
|
39 |
public abstract class UnsavedData implements IUnsavedData { |
|
40 |
|
|
41 |
/** |
|
42 |
* This UnsavedData object is associated to this extension. |
|
43 |
*/ |
|
44 |
private IExtension ext; |
|
45 |
|
|
46 |
/** |
|
47 |
* Creates a new UnsavedData object which will be associated to |
|
48 |
* the provided extension. |
|
49 |
* |
|
50 |
* @param extension |
|
51 |
*/ |
|
52 |
public UnsavedData(IExtension extension) { |
|
53 |
ext = extension; |
|
54 |
} |
|
55 |
|
|
56 |
/* (non-Javadoc) |
|
57 |
* @see com.iver.andami.plugins.status.IUnsavedData#getDescription() |
|
58 |
*/ |
|
59 |
public abstract String getDescription() ; |
|
60 |
|
|
61 |
/* (non-Javadoc) |
|
62 |
* @see com.iver.andami.plugins.status.IUnsavedData#getExtension() |
|
63 |
*/ |
|
64 |
public IExtension getExtension() { |
|
65 |
return ext; |
|
66 |
} |
|
67 |
|
|
68 |
/* (non-Javadoc) |
|
69 |
* @see com.iver.andami.plugins.status.IUnsavedData#getIcon() |
|
70 |
*/ |
|
71 |
public String getIcon() { |
|
72 |
return null; |
|
73 |
} |
|
74 |
|
|
75 |
/* (non-Javadoc) |
|
76 |
* @see com.iver.andami.plugins.status.IUnsavedData#getResourceName() |
|
77 |
*/ |
|
78 |
public abstract String getResourceName(); |
|
79 |
|
|
80 |
/* (non-Javadoc) |
|
81 |
* @see com.iver.andami.plugins.status.IUnsavedData#saveData() |
|
82 |
*/ |
|
83 |
public abstract boolean saveData(); |
|
84 |
|
|
85 |
} |
|
0 | 86 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/IExtensionQueryByAction.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins; |
|
25 |
|
|
26 |
public interface IExtensionQueryByAction { |
|
27 |
|
|
28 |
public boolean canQueryByAction(); |
|
29 |
|
|
30 |
public boolean isEnabled(String action); |
|
31 |
public boolean isVisible(String action); |
|
32 |
|
|
33 |
} |
|
0 | 34 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/IExtension.java | ||
---|---|---|
1 |
/** |
|
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 |
package org.gvsig.andami.plugins; |
|
25 |
|
|
26 |
import org.gvsig.andami.plugins.status.IExtensionStatus; |
|
27 |
|
|
28 |
/** |
|
29 |
* <p> |
|
30 |
* Extensions are the way in which plugins extend Andami. Every class |
|
31 |
* implementing this interface is an extension (although this class |
|
32 |
* should not be directly implemented, extending the {@link Extension} |
|
33 |
* abstract class is the preferred way). During startup, |
|
34 |
* Andami creates an instance from each extension. Extensions are able |
|
35 |
* to add controls (tools, toolbars and menus) |
|
36 |
* to the user interface (GUI); when these controls |
|
37 |
* are clicked or modified, Andami will call the <code>execute()</code> |
|
38 |
* method from the associated extension. Extensions will also control |
|
39 |
* whether their associated controls are enabled or not, and whether |
|
40 |
* they are visible or hidden. |
|
41 |
* </p> |
|
42 |
* <p> |
|
43 |
* Besides implementing this interface, extensions are required to have |
|
44 |
* an empty constructor, because it will be invoked to create the |
|
45 |
* extension's instance. |
|
46 |
* </p> |
|
47 |
* <p> |
|
48 |
* On correctly installed plugins, an instance of every plugin's |
|
49 |
* extension will be created. Then, the <code>initialize()</code> |
|
50 |
* method will be executed for each extension. |
|
51 |
* </p> |
|
52 |
* <p> |
|
53 |
* Each time the active window is switched and every time the execute |
|
54 |
* method is called, Andami checks the <code>isEnabled()</code> and |
|
55 |
* <code>isVisible()</code> for each extension, to decide whether |
|
56 |
* they will be enabled and visible. |
|
57 |
* </p> |
|
58 |
* <p> |
|
59 |
* The <code>execute()</code> method will be called from the GUI |
|
60 |
* thread, so it will block the GUI until it finishes. Therefore, |
|
61 |
* execution must be fast. If long process must be started from |
|
62 |
* the <code>execute</code> method, a new thread must be created. |
|
63 |
* </p> |
|
64 |
* <p> |
|
65 |
* Normally, extensions should not directly implement this interface, |
|
66 |
* but they should extend the <code>Extension</code> abstract class. |
|
67 |
* </p> |
|
68 |
* |
|
69 |
* @see Extension |
|
70 |
*/public interface IExtension { |
|
71 |
/** |
|
72 |
* Extension's initialization code should be here. |
|
73 |
* This method is called for all the extensions during |
|
74 |
* Andami's initialization. |
|
75 |
*/ |
|
76 |
public void initialize(); |
|
77 |
|
|
78 |
/** |
|
79 |
* Extension's post-initialization code should be here. |
|
80 |
* This method is called for all the extensions during |
|
81 |
* Andami's initialization, after <code>initialize()</code> |
|
82 |
* has been called for ALL the extensions. |
|
83 |
*/ |
|
84 |
public void postInitialize(); |
|
85 |
|
|
86 |
/** |
|
87 |
* Extension's termination code should be here. |
|
88 |
* This method is called for all the extensions during |
|
89 |
* Andami's termination. |
|
90 |
*/ |
|
91 |
public void terminate(); |
|
92 |
|
|
93 |
/** |
|
94 |
* This method is executed when the user clicks on any of the |
|
95 |
* controls associated with this extension (menus, tools, etc). |
|
96 |
* |
|
97 |
* @param actionCommand An String specifying the action to |
|
98 |
* execute. This is useful when there are different |
|
99 |
* controls associated with the same extension. |
|
100 |
*/ |
|
101 |
public void execute(String actionCommand); |
|
102 |
|
|
103 |
/** |
|
104 |
* This method is invoked by Andami to check whether the extension |
|
105 |
* (and its associated controls) is enabled or disabled. |
|
106 |
* Disabled controls (menus and buttons) are shown in light grey |
|
107 |
* colour, and it is not possible to click on them. |
|
108 |
* |
|
109 |
* @return true if the extension should be enabled, false otherwise |
|
110 |
*/ |
|
111 |
public boolean isEnabled(); |
|
112 |
|
|
113 |
/** |
|
114 |
* This method is invoked by Andami to check whether the extension |
|
115 |
* (and its associated controls) is visible or hidden. |
|
116 |
* |
|
117 |
* @return true if the extension should be visible, false otherwise |
|
118 |
*/ |
|
119 |
public boolean isVisible(); |
|
120 |
|
|
121 |
/** |
|
122 |
* Gets the status of the extension, which may be queried to check |
|
123 |
* if the extension has some unsaved data or some associated background |
|
124 |
* tasks. |
|
125 |
* |
|
126 |
* @see IExtensionStatus |
|
127 |
* @return An IExtensionStatus object, containing the status of this |
|
128 |
* extension. |
|
129 |
*/ |
|
130 |
public IExtensionStatus getStatus(); |
|
131 |
public IExtensionStatus getStatus(IExtension extension); |
|
132 |
} |
|
0 | 133 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/config/generate/ExtensionTypeDescriptor.java | ||
---|---|---|
1 |
/** |
|
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 |
/* |
|
25 |
* This class was automatically generated with |
|
26 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML |
|
27 |
* Schema. |
|
28 |
* $Id: ExtensionTypeDescriptor.java 29593 2009-06-29 15:54:31Z jpiera $ |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.andami.plugins.config.generate; |
|
32 |
|
|
33 |
//---------------------------------/ |
|
34 |
//- Imported classes and packages -/ |
|
35 |
//---------------------------------/ |
|
36 |
|
|
37 |
import org.exolab.castor.mapping.AccessMode; |
|
38 |
import org.exolab.castor.xml.TypeValidator; |
|
39 |
import org.exolab.castor.xml.XMLFieldDescriptor; |
|
40 |
import org.exolab.castor.xml.validators.*; |
|
41 |
|
|
42 |
/** |
|
43 |
* Class ExtensionTypeDescriptor. |
|
44 |
* |
|
45 |
* @version $Revision: 29593 $ $Date: 2009-06-29 17:54:31 +0200 (lun, 29 jun 2009) $ |
|
46 |
*/ |
|
47 |
public class ExtensionTypeDescriptor extends org.gvsig.andami.plugins.config.generate.SkinExtensionTypeDescriptor { |
|
48 |
|
|
49 |
|
|
50 |
//--------------------------/ |
|
51 |
//- Class/Member Variables -/ |
|
52 |
//--------------------------/ |
|
53 |
|
|
54 |
/** |
|
55 |
* Field nsPrefix |
|
56 |
*/ |
|
57 |
private java.lang.String nsPrefix; |
|
58 |
|
|
59 |
/** |
|
60 |
* Field nsURI |
|
61 |
*/ |
|
62 |
private java.lang.String nsURI; |
|
63 |
|
|
64 |
/** |
|
65 |
* Field xmlName |
|
66 |
*/ |
|
67 |
private java.lang.String xmlName; |
|
68 |
|
|
69 |
/** |
|
70 |
* Field identity |
|
71 |
*/ |
|
72 |
private org.exolab.castor.xml.XMLFieldDescriptor identity; |
|
73 |
|
|
74 |
|
|
75 |
//----------------/ |
|
76 |
//- Constructors -/ |
|
77 |
//----------------/ |
|
78 |
|
|
79 |
public ExtensionTypeDescriptor() { |
|
80 |
super(); |
|
81 |
setExtendsWithoutFlatten(new org.gvsig.andami.plugins.config.generate.SkinExtensionTypeDescriptor()); |
|
82 |
xmlName = "extension-type"; |
|
83 |
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; |
|
84 |
org.exolab.castor.xml.XMLFieldHandler handler = null; |
|
85 |
org.exolab.castor.xml.FieldValidator fieldValidator = null; |
|
86 |
//-- initialize attribute descriptors |
|
87 |
|
|
88 |
//-- _priority |
|
89 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_priority", "priority", org.exolab.castor.xml.NodeType.Attribute); |
|
90 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
91 |
public java.lang.Object getValue( java.lang.Object object ) |
|
92 |
throws IllegalStateException |
|
93 |
{ |
|
94 |
ExtensionType target = (ExtensionType) object; |
|
95 |
if(!target.hasPriority()) |
|
96 |
return null; |
|
97 |
return new java.lang.Integer(target.getPriority()); |
|
98 |
} |
|
99 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
100 |
throws IllegalStateException, IllegalArgumentException |
|
101 |
{ |
|
102 |
try { |
|
103 |
ExtensionType target = (ExtensionType) object; |
|
104 |
// if null, use delete method for optional primitives |
|
105 |
if (value == null) { |
|
106 |
target.deletePriority(); |
|
107 |
return; |
|
108 |
} |
|
109 |
target.setPriority( ((java.lang.Integer)value).intValue()); |
|
110 |
} |
|
111 |
catch (java.lang.Exception ex) { |
|
112 |
throw new IllegalStateException(ex.toString()); |
|
113 |
} |
|
114 |
} |
|
115 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
116 |
return null; |
|
117 |
} |
|
118 |
} ); |
|
119 |
desc.setHandler(handler); |
|
120 |
addFieldDescriptor(desc); |
|
121 |
|
|
122 |
//-- validation code for: _priority |
|
123 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
124 |
{ //-- local scope |
|
125 |
IntegerValidator typeValidator= new IntegerValidator(); |
|
126 |
fieldValidator.setValidator(typeValidator); |
|
127 |
} |
|
128 |
desc.setValidator(fieldValidator); |
|
129 |
//-- _active |
|
130 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_active", "active", org.exolab.castor.xml.NodeType.Attribute); |
|
131 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
132 |
public java.lang.Object getValue( java.lang.Object object ) |
|
133 |
throws IllegalStateException |
|
134 |
{ |
|
135 |
ExtensionType target = (ExtensionType) object; |
|
136 |
if(!target.hasActive()) |
|
137 |
return null; |
|
138 |
return (target.getActive() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); |
|
139 |
} |
|
140 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
141 |
throws IllegalStateException, IllegalArgumentException |
|
142 |
{ |
|
143 |
try { |
|
144 |
ExtensionType target = (ExtensionType) object; |
|
145 |
// if null, use delete method for optional primitives |
|
146 |
if (value == null) { |
|
147 |
target.deleteActive(); |
|
148 |
return; |
|
149 |
} |
|
150 |
target.setActive( ((java.lang.Boolean)value).booleanValue()); |
|
151 |
} |
|
152 |
catch (java.lang.Exception ex) { |
|
153 |
throw new IllegalStateException(ex.toString()); |
|
154 |
} |
|
155 |
} |
|
156 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
157 |
return null; |
|
158 |
} |
|
159 |
} ); |
|
160 |
desc.setHandler(handler); |
|
161 |
addFieldDescriptor(desc); |
|
162 |
|
|
163 |
//-- validation code for: _active |
|
164 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
165 |
{ //-- local scope |
|
166 |
BooleanValidator typeValidator = new BooleanValidator(); |
|
167 |
fieldValidator.setValidator(typeValidator); |
|
168 |
} |
|
169 |
desc.setValidator(fieldValidator); |
|
170 |
//-- _description |
|
171 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Attribute); |
|
172 |
desc.setImmutable(true); |
|
173 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
174 |
public java.lang.Object getValue( java.lang.Object object ) |
|
175 |
throws IllegalStateException |
|
176 |
{ |
|
177 |
ExtensionType target = (ExtensionType) object; |
|
178 |
return target.getDescription(); |
|
179 |
} |
|
180 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
181 |
throws IllegalStateException, IllegalArgumentException |
|
182 |
{ |
|
183 |
try { |
|
184 |
ExtensionType target = (ExtensionType) object; |
|
185 |
target.setDescription( (java.lang.String) value); |
|
186 |
} |
|
187 |
catch (java.lang.Exception ex) { |
|
188 |
throw new IllegalStateException(ex.toString()); |
|
189 |
} |
|
190 |
} |
|
191 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
192 |
return null; |
|
193 |
} |
|
194 |
} ); |
|
195 |
desc.setHandler(handler); |
|
196 |
addFieldDescriptor(desc); |
|
197 |
|
|
198 |
//-- validation code for: _description |
|
199 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
200 |
{ //-- local scope |
|
201 |
StringValidator typeValidator = new StringValidator(); |
|
202 |
typeValidator.setWhiteSpace("preserve"); |
|
203 |
fieldValidator.setValidator(typeValidator); |
|
204 |
} |
|
205 |
desc.setValidator(fieldValidator); |
|
206 |
//-- _alwaysvisible |
|
207 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_alwaysvisible", "alwaysvisible", org.exolab.castor.xml.NodeType.Attribute); |
|
208 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
209 |
public java.lang.Object getValue( java.lang.Object object ) |
|
210 |
throws IllegalStateException |
|
211 |
{ |
|
212 |
ExtensionType target = (ExtensionType) object; |
|
213 |
if(!target.hasAlwaysvisible()) |
|
214 |
return null; |
|
215 |
return (target.getAlwaysvisible() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); |
|
216 |
} |
|
217 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
218 |
throws IllegalStateException, IllegalArgumentException |
|
219 |
{ |
|
220 |
try { |
|
221 |
ExtensionType target = (ExtensionType) object; |
|
222 |
// if null, use delete method for optional primitives |
|
223 |
if (value == null) { |
|
224 |
target.deleteAlwaysvisible(); |
|
225 |
return; |
|
226 |
} |
|
227 |
target.setAlwaysvisible( ((java.lang.Boolean)value).booleanValue()); |
|
228 |
} |
|
229 |
catch (java.lang.Exception ex) { |
|
230 |
throw new IllegalStateException(ex.toString()); |
|
231 |
} |
|
232 |
} |
|
233 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
234 |
return null; |
|
235 |
} |
|
236 |
} ); |
|
237 |
desc.setHandler(handler); |
|
238 |
addFieldDescriptor(desc); |
|
239 |
|
|
240 |
//-- validation code for: _alwaysvisible |
|
241 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
242 |
{ //-- local scope |
|
243 |
BooleanValidator typeValidator = new BooleanValidator(); |
|
244 |
fieldValidator.setValidator(typeValidator); |
|
245 |
} |
|
246 |
desc.setValidator(fieldValidator); |
|
247 |
//-- initialize element descriptors |
|
248 |
|
|
249 |
} //-- com.iver.andami.plugins.config.generate.ExtensionTypeDescriptor() |
|
250 |
|
|
251 |
|
|
252 |
//-----------/ |
|
253 |
//- Methods -/ |
|
254 |
//-----------/ |
|
255 |
|
|
256 |
/** |
|
257 |
* Method getAccessMode |
|
258 |
*/ |
|
259 |
public org.exolab.castor.mapping.AccessMode getAccessMode() |
|
260 |
{ |
|
261 |
return null; |
|
262 |
} //-- org.exolab.castor.mapping.AccessMode getAccessMode() |
|
263 |
|
|
264 |
/** |
|
265 |
* Method getExtends |
|
266 |
*/ |
|
267 |
public org.exolab.castor.mapping.ClassDescriptor getExtends() |
|
268 |
{ |
|
269 |
return super.getExtends(); |
|
270 |
} //-- org.exolab.castor.mapping.ClassDescriptor getExtends() |
|
271 |
|
|
272 |
/** |
|
273 |
* Method getIdentity |
|
274 |
*/ |
|
275 |
public org.exolab.castor.mapping.FieldDescriptor getIdentity() |
|
276 |
{ |
|
277 |
if (identity == null) |
|
278 |
return super.getIdentity(); |
|
279 |
return identity; |
|
280 |
} //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() |
|
281 |
|
|
282 |
/** |
|
283 |
* Method getJavaClass |
|
284 |
*/ |
|
285 |
public java.lang.Class getJavaClass() |
|
286 |
{ |
|
287 |
return org.gvsig.andami.plugins.config.generate.ExtensionType.class; |
|
288 |
} //-- java.lang.Class getJavaClass() |
|
289 |
|
|
290 |
/** |
|
291 |
* Method getNameSpacePrefix |
|
292 |
*/ |
|
293 |
public java.lang.String getNameSpacePrefix() |
|
294 |
{ |
|
295 |
return nsPrefix; |
|
296 |
} //-- java.lang.String getNameSpacePrefix() |
|
297 |
|
|
298 |
/** |
|
299 |
* Method getNameSpaceURI |
|
300 |
*/ |
|
301 |
public java.lang.String getNameSpaceURI() |
|
302 |
{ |
|
303 |
return nsURI; |
|
304 |
} //-- java.lang.String getNameSpaceURI() |
|
305 |
|
|
306 |
/** |
|
307 |
* Method getValidator |
|
308 |
*/ |
|
309 |
public org.exolab.castor.xml.TypeValidator getValidator() |
|
310 |
{ |
|
311 |
return this; |
|
312 |
} //-- org.exolab.castor.xml.TypeValidator getValidator() |
|
313 |
|
|
314 |
/** |
|
315 |
* Method getXMLName |
|
316 |
*/ |
|
317 |
public java.lang.String getXMLName() |
|
318 |
{ |
|
319 |
return xmlName; |
|
320 |
} //-- java.lang.String getXMLName() |
|
321 |
|
|
322 |
} |
|
0 | 323 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/config/generate/LabelDescriptor.java | ||
---|---|---|
1 |
/** |
|
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 |
/* |
|
25 |
* This class was automatically generated with |
|
26 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML |
|
27 |
* Schema. |
|
28 |
* $Id: LabelDescriptor.java 29593 2009-06-29 15:54:31Z jpiera $ |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.andami.plugins.config.generate; |
|
32 |
|
|
33 |
//---------------------------------/ |
|
34 |
//- Imported classes and packages -/ |
|
35 |
//---------------------------------/ |
|
36 |
|
|
37 |
import org.exolab.castor.mapping.AccessMode; |
|
38 |
import org.exolab.castor.xml.TypeValidator; |
|
39 |
import org.exolab.castor.xml.XMLFieldDescriptor; |
|
40 |
import org.exolab.castor.xml.validators.*; |
|
41 |
|
|
42 |
/** |
|
43 |
* Class LabelDescriptor. |
|
44 |
* |
|
45 |
* @version $Revision: 29593 $ $Date: 2009-06-29 17:54:31 +0200 (lun, 29 jun 2009) $ |
|
46 |
*/ |
|
47 |
public class LabelDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { |
|
48 |
|
|
49 |
|
|
50 |
//--------------------------/ |
|
51 |
//- Class/Member Variables -/ |
|
52 |
//--------------------------/ |
|
53 |
|
|
54 |
/** |
|
55 |
* Field nsPrefix |
|
56 |
*/ |
|
57 |
private java.lang.String nsPrefix; |
|
58 |
|
|
59 |
/** |
|
60 |
* Field nsURI |
|
61 |
*/ |
|
62 |
private java.lang.String nsURI; |
|
63 |
|
|
64 |
/** |
|
65 |
* Field xmlName |
|
66 |
*/ |
|
67 |
private java.lang.String xmlName; |
|
68 |
|
|
69 |
/** |
|
70 |
* Field identity |
|
71 |
*/ |
|
72 |
private org.exolab.castor.xml.XMLFieldDescriptor identity; |
|
73 |
|
|
74 |
|
|
75 |
//----------------/ |
|
76 |
//- Constructors -/ |
|
77 |
//----------------/ |
|
78 |
|
|
79 |
public LabelDescriptor() { |
|
80 |
super(); |
|
81 |
xmlName = "label"; |
|
82 |
org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; |
|
83 |
org.exolab.castor.xml.XMLFieldHandler handler = null; |
|
84 |
org.exolab.castor.xml.FieldValidator fieldValidator = null; |
|
85 |
//-- initialize attribute descriptors |
|
86 |
|
|
87 |
//-- _size |
|
88 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_size", "size", org.exolab.castor.xml.NodeType.Attribute); |
|
89 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
90 |
public java.lang.Object getValue( java.lang.Object object ) |
|
91 |
throws IllegalStateException |
|
92 |
{ |
|
93 |
Label target = (Label) object; |
|
94 |
if(!target.hasSize()) |
|
95 |
return null; |
|
96 |
return new java.lang.Integer(target.getSize()); |
|
97 |
} |
|
98 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
99 |
throws IllegalStateException, IllegalArgumentException |
|
100 |
{ |
|
101 |
try { |
|
102 |
Label target = (Label) object; |
|
103 |
// ignore null values for non optional primitives |
|
104 |
if (value == null) return; |
|
105 |
|
|
106 |
target.setSize( ((java.lang.Integer)value).intValue()); |
|
107 |
} |
|
108 |
catch (java.lang.Exception ex) { |
|
109 |
throw new IllegalStateException(ex.toString()); |
|
110 |
} |
|
111 |
} |
|
112 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
113 |
return null; |
|
114 |
} |
|
115 |
} ); |
|
116 |
desc.setHandler(handler); |
|
117 |
desc.setRequired(true); |
|
118 |
addFieldDescriptor(desc); |
|
119 |
|
|
120 |
//-- validation code for: _size |
|
121 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
122 |
fieldValidator.setMinOccurs(1); |
|
123 |
{ //-- local scope |
|
124 |
IntegerValidator typeValidator= new IntegerValidator(); |
|
125 |
fieldValidator.setValidator(typeValidator); |
|
126 |
} |
|
127 |
desc.setValidator(fieldValidator); |
|
128 |
//-- _id |
|
129 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); |
|
130 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
|
131 |
public java.lang.Object getValue( java.lang.Object object ) |
|
132 |
throws IllegalStateException |
|
133 |
{ |
|
134 |
Label target = (Label) object; |
|
135 |
return target.getId(); |
|
136 |
} |
|
137 |
public void setValue( java.lang.Object object, java.lang.Object value) |
|
138 |
throws IllegalStateException, IllegalArgumentException |
|
139 |
{ |
|
140 |
try { |
|
141 |
Label target = (Label) object; |
|
142 |
target.setId( (java.lang.String) value); |
|
143 |
} |
|
144 |
catch (java.lang.Exception ex) { |
|
145 |
throw new IllegalStateException(ex.toString()); |
|
146 |
} |
|
147 |
} |
|
148 |
public java.lang.Object newInstance( java.lang.Object parent ) { |
|
149 |
return new java.lang.String(); |
|
150 |
} |
|
151 |
} ); |
|
152 |
desc.setHandler(handler); |
|
153 |
desc.setRequired(true); |
|
154 |
addFieldDescriptor(desc); |
|
155 |
|
|
156 |
//-- validation code for: _id |
|
157 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
|
158 |
fieldValidator.setMinOccurs(1); |
|
159 |
{ //-- local scope |
|
160 |
NameValidator typeValidator = new NameValidator(NameValidator.NMTOKEN); |
|
161 |
fieldValidator.setValidator(typeValidator); |
|
162 |
} |
|
163 |
desc.setValidator(fieldValidator); |
|
164 |
//-- initialize element descriptors |
|
165 |
|
|
166 |
} //-- com.iver.andami.plugins.config.generate.LabelDescriptor() |
|
167 |
|
|
168 |
|
|
169 |
//-----------/ |
|
170 |
//- Methods -/ |
|
171 |
//-----------/ |
|
172 |
|
|
173 |
/** |
|
174 |
* Method getAccessMode |
|
175 |
*/ |
|
176 |
public org.exolab.castor.mapping.AccessMode getAccessMode() |
|
177 |
{ |
|
178 |
return null; |
|
179 |
} //-- org.exolab.castor.mapping.AccessMode getAccessMode() |
|
180 |
|
|
181 |
/** |
|
182 |
* Method getExtends |
|
183 |
*/ |
|
184 |
public org.exolab.castor.mapping.ClassDescriptor getExtends() |
|
185 |
{ |
|
186 |
return null; |
|
187 |
} //-- org.exolab.castor.mapping.ClassDescriptor getExtends() |
|
188 |
|
|
189 |
/** |
|
190 |
* Method getIdentity |
|
191 |
*/ |
|
192 |
public org.exolab.castor.mapping.FieldDescriptor getIdentity() |
|
193 |
{ |
|
194 |
return identity; |
|
195 |
} //-- org.exolab.castor.mapping.FieldDescriptor getIdentity() |
|
196 |
|
|
197 |
/** |
|
198 |
* Method getJavaClass |
|
199 |
*/ |
|
200 |
public java.lang.Class getJavaClass() |
|
201 |
{ |
|
202 |
return org.gvsig.andami.plugins.config.generate.Label.class; |
|
203 |
} //-- java.lang.Class getJavaClass() |
|
204 |
|
|
205 |
/** |
|
206 |
* Method getNameSpacePrefix |
|
207 |
*/ |
|
208 |
public java.lang.String getNameSpacePrefix() |
|
209 |
{ |
|
210 |
return nsPrefix; |
|
211 |
} //-- java.lang.String getNameSpacePrefix() |
|
212 |
|
|
213 |
/** |
|
214 |
* Method getNameSpaceURI |
|
215 |
*/ |
|
216 |
public java.lang.String getNameSpaceURI() |
|
217 |
{ |
|
218 |
return nsURI; |
|
219 |
} //-- java.lang.String getNameSpaceURI() |
|
220 |
|
|
221 |
/** |
|
222 |
* Method getValidator |
|
223 |
*/ |
|
224 |
public org.exolab.castor.xml.TypeValidator getValidator() |
|
225 |
{ |
|
226 |
return this; |
|
227 |
} //-- org.exolab.castor.xml.TypeValidator getValidator() |
|
228 |
|
|
229 |
/** |
|
230 |
* Method getXMLName |
|
231 |
*/ |
|
232 |
public java.lang.String getXMLName() |
|
233 |
{ |
|
234 |
return xmlName; |
|
235 |
} //-- java.lang.String getXMLName() |
|
236 |
|
|
237 |
} |
|
0 | 238 |
tags/org.gvsig.desktop-2.0.137/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/plugins/config/generate/ExtensionType.java | ||
---|---|---|
1 |
/** |
|
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 |
/* |
|
25 |
* This class was automatically generated with |
|
26 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML |
|
27 |
* Schema. |
|
28 |
* $Id: ExtensionType.java 29593 2009-06-29 15:54:31Z jpiera $ |
|
29 |
*/ |
|
30 |
|
|
31 |
package org.gvsig.andami.plugins.config.generate; |
|
32 |
|
|
33 |
//---------------------------------/ |
|
34 |
//- Imported classes and packages -/ |
|
35 |
//---------------------------------/ |
|
36 |
|
|
37 |
import java.io.IOException; |
|
38 |
import java.io.Reader; |
|
39 |
import java.io.Serializable; |
|
40 |
import java.io.Writer; |
|
41 |
import org.exolab.castor.xml.MarshalException; |
|
42 |
import org.exolab.castor.xml.Marshaller; |
|
43 |
import org.exolab.castor.xml.Unmarshaller; |
|
44 |
import org.exolab.castor.xml.ValidationException; |
|
45 |
import org.xml.sax.ContentHandler; |
|
46 |
|
|
47 |
/** |
|
48 |
* Class ExtensionType. |
|
49 |
* |
|
50 |
* @version $Revision: 29593 $ $Date: 2009-06-29 17:54:31 +0200 (lun, 29 jun 2009) $ |
|
51 |
*/ |
|
52 |
public class ExtensionType extends org.gvsig.andami.plugins.config.generate.SkinExtensionType |
|
53 |
implements java.io.Serializable |
|
54 |
{ |
|
55 |
|
|
56 |
|
|
57 |
//--------------------------/ |
|
58 |
//- Class/Member Variables -/ |
|
59 |
//--------------------------/ |
|
60 |
|
|
61 |
/** |
|
62 |
* Field _priority |
|
63 |
*/ |
|
64 |
private int _priority; |
|
65 |
|
|
66 |
/** |
|
67 |
* keeps track of state for field: _priority |
|
68 |
*/ |
|
69 |
private boolean _has_priority; |
|
70 |
|
|
71 |
/** |
|
72 |
* Field _active |
|
73 |
*/ |
|
74 |
private boolean _active; |
|
75 |
|
|
76 |
/** |
|
77 |
* keeps track of state for field: _active |
|
78 |
*/ |
|
79 |
private boolean _has_active; |
|
80 |
|
|
81 |
/** |
|
82 |
* Field _description |
|
83 |
*/ |
|
84 |
private java.lang.String _description; |
|
85 |
|
|
86 |
/** |
|
87 |
* Field _alwaysvisible |
|
88 |
*/ |
|
89 |
private boolean _alwaysvisible; |
|
90 |
|
|
91 |
/** |
|
92 |
* keeps track of state for field: _alwaysvisible |
|
93 |
*/ |
|
94 |
private boolean _has_alwaysvisible; |
|
95 |
|
|
96 |
|
|
97 |
//----------------/ |
|
98 |
//- Constructors -/ |
|
99 |
//----------------/ |
|
100 |
|
|
101 |
public ExtensionType() { |
|
102 |
super(); |
|
103 |
} //-- com.iver.andami.plugins.config.generate.ExtensionType() |
|
104 |
|
|
105 |
|
|
106 |
//-----------/ |
|
107 |
//- Methods -/ |
|
108 |
//-----------/ |
|
109 |
|
|
110 |
/** |
|
111 |
* Method deleteActive |
|
112 |
*/ |
|
113 |
public void deleteActive() |
|
114 |
{ |
|
115 |
this._has_active= false; |
|
116 |
} //-- void deleteActive() |
|
117 |
|
|
118 |
/** |
|
119 |
* Method deleteAlwaysvisible |
|
120 |
*/ |
|
121 |
public void deleteAlwaysvisible() |
|
122 |
{ |
|
123 |
this._has_alwaysvisible= false; |
|
124 |
} //-- void deleteAlwaysvisible() |
|
125 |
|
|
126 |
/** |
|
127 |
* Method deletePriority |
|
128 |
*/ |
|
129 |
public void deletePriority() |
|
130 |
{ |
|
131 |
this._has_priority= false; |
|
132 |
} //-- void deletePriority() |
|
133 |
|
|
134 |
/** |
|
135 |
* Returns the value of field 'active'. |
|
136 |
* |
|
137 |
* @return the value of field 'active'. |
|
138 |
*/ |
|
139 |
public boolean getActive() |
|
140 |
{ |
|
141 |
return this._active; |
|
142 |
} //-- boolean getActive() |
|
143 |
|
|
144 |
/** |
|
145 |
* Returns the value of field 'alwaysvisible'. |
|
146 |
* |
|
147 |
* @return the value of field 'alwaysvisible'. |
|
148 |
*/ |
|
149 |
public boolean getAlwaysvisible() |
|
150 |
{ |
|
151 |
return this._alwaysvisible; |
|
152 |
} //-- boolean getAlwaysvisible() |
|
153 |
|
|
154 |
/** |
|
155 |
* Returns the value of field 'description'. |
|
156 |
* |
|
157 |
* @return the value of field 'description'. |
|
158 |
*/ |
|
159 |
public java.lang.String getDescription() |
|
160 |
{ |
|
161 |
return this._description; |
|
162 |
} //-- java.lang.String getDescription() |
|
163 |
|
|
164 |
/** |
|
165 |
* Returns the value of field 'priority'. |
|
166 |
* |
|
167 |
* @return the value of field 'priority'. |
|
168 |
*/ |
|
169 |
public int getPriority() |
|
170 |
{ |
|
171 |
return this._priority; |
|
172 |
} //-- int getPriority() |
|
173 |
|
|
174 |
/** |
|
175 |
* Method hasActive |
|
176 |
*/ |
|
177 |
public boolean hasActive() |
|
178 |
{ |
|
179 |
return this._has_active; |
|
180 |
} //-- boolean hasActive() |
|
181 |
|
|
182 |
/** |
|
183 |
* Method hasAlwaysvisible |
|
184 |
*/ |
|
185 |
public boolean hasAlwaysvisible() |
|
186 |
{ |
|
187 |
return this._has_alwaysvisible; |
|
188 |
} //-- boolean hasAlwaysvisible() |
|
189 |
|
|
190 |
/** |
|
191 |
* Method hasPriority |
|
192 |
*/ |
|
193 |
public boolean hasPriority() |
|
194 |
{ |
|
195 |
return this._has_priority; |
|
196 |
} //-- boolean hasPriority() |
|
197 |
|
|
198 |
/** |
|
199 |
* Method isValid |
|
200 |
*/ |
|
201 |
public boolean isValid() |
|
202 |
{ |
|
203 |
try { |
|
204 |
validate(); |
|
205 |
} |
|
206 |
catch (org.exolab.castor.xml.ValidationException vex) { |
|
207 |
return false; |
|
208 |
} |
|
209 |
return true; |
|
210 |
} //-- boolean isValid() |
|
211 |
|
|
212 |
/** |
|
213 |
* Method marshal |
|
214 |
* |
|
215 |
* @param out |
|
216 |
*/ |
|
217 |
public void marshal(java.io.Writer out) |
|
218 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException |
|
219 |
{ |
|
220 |
|
|
221 |
Marshaller.marshal(this, out); |
|
222 |
} //-- void marshal(java.io.Writer) |
|
223 |
|
|
224 |
/** |
|
225 |
* Method marshal |
|
226 |
* |
|
227 |
* @param handler |
Also available in: Unified diff