Revision 41427
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.geodb.app/org.gvsig.geodb.app.mainplugin/src/main/java/org/gvsig/geodb/ExtDB_Spatial.java | ||
---|---|---|
3 | 3 |
* |
4 | 4 |
* Copyright (C) 2007-2013 gvSIG Association. |
5 | 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.
|
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
|
9 |
* version. |
|
10 | 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.
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
14 |
* details. |
|
15 | 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. |
|
16 |
* You should have received a copy of the GNU General Public License along with |
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51 |
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
20 | 19 |
* |
21 |
* For any additional information, do not hesitate to contact us |
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
|
21 |
* gvsig.com, or visit our website www.gvsig.com. |
|
23 | 22 |
*/ |
24 | 23 |
package org.gvsig.geodb; |
25 | 24 |
|
25 |
import java.util.Iterator; |
|
26 |
import java.util.Map; |
|
27 |
import org.apache.commons.collections.map.HashedMap; |
|
26 | 28 |
import org.gvsig.about.AboutManager; |
27 | 29 |
import org.gvsig.about.AboutParticipant; |
28 | 30 |
import org.gvsig.andami.IconThemeHelper; |
31 |
import org.gvsig.andami.PluginsLocator; |
|
32 |
import org.gvsig.andami.PluginsManager; |
|
29 | 33 |
import org.gvsig.andami.plugins.Extension; |
30 | 34 |
import org.gvsig.app.ApplicationLocator; |
31 | 35 |
import org.gvsig.app.ApplicationManager; |
32 | 36 |
import org.gvsig.app.extension.AddLayer; |
37 |
import org.gvsig.fmap.dal.serverexplorer.db.DBServerExplorerParameters; |
|
38 |
import org.gvsig.geodb.vectorialdb.wizard.MyExplorer; |
|
33 | 39 |
import org.gvsig.geodb.vectorialdb.wizard.WizardDB; |
34 | 40 |
import org.gvsig.geodb.vectorialdb.wizard.WizardVectorialDB; |
41 |
import org.gvsig.tools.dynobject.DynObject; |
|
35 | 42 |
|
36 |
|
|
37 |
|
|
38 | 43 |
/** |
39 | 44 |
* This extension adds the export-to-oracle button. |
40 | 45 |
* |
... | ... | |
43 | 48 |
*/ |
44 | 49 |
public class ExtDB_Spatial extends Extension { |
45 | 50 |
|
46 |
public void initialize() {
|
|
51 |
public void initialize() {
|
|
47 | 52 |
IconThemeHelper.registerIcon("geodb", "geodb-connection-add", this); |
48 | 53 |
IconThemeHelper.registerIcon("geodb", "geodb-advanced-properties", this); |
49 | 54 |
IconThemeHelper.registerIcon("geodb", "geodb-get-view-extent", this); |
... | ... | |
59 | 64 |
// return true; |
60 | 65 |
} |
61 | 66 |
|
62 |
/** |
|
63 |
* Is visible when there is one vector layer selected |
|
64 |
*/ |
|
67 |
public Map<DBServerExplorerParameters, String> getUserConnections() { |
|
68 |
PluginsManager manager = PluginsLocator.getManager(); |
|
69 |
DynObject values = manager.getPlugin(ExtDB_Spatial.class).getPluginProperties(); |
|
70 |
Map connections = (Map) values.getDynValue("db_connections"); |
|
71 |
if (connections == null) { |
|
72 |
connections = new HashedMap(); |
|
73 |
values.setDynValue("db_connections", connections); |
|
74 |
} |
|
75 |
return connections; |
|
76 |
} |
|
77 |
|
|
65 | 78 |
public boolean isVisible() { |
66 | 79 |
return false; |
67 | 80 |
} |
68 | 81 |
|
69 |
@Override
|
|
70 |
public void postInitialize() {
|
|
71 |
super.postInitialize();
|
|
72 |
addAboutInfo();
|
|
82 |
@Override
|
|
83 |
public void postInitialize() {
|
|
84 |
super.postInitialize();
|
|
85 |
addAboutInfo();
|
|
73 | 86 |
|
74 |
ApplicationLocator.getManager().registerAddTableWizard("DB", |
|
75 |
"DB Tables", WizardDB.class); |
|
76 |
AddLayer.addWizard(WizardVectorialDB.class); |
|
77 |
} |
|
78 |
|
|
79 |
private void addAboutInfo() { |
|
80 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
81 |
|
|
82 |
AboutManager about = application.getAbout(); |
|
83 |
about.addDeveloper("PRODEVELOP", getClass().getClassLoader() |
|
84 |
.getResource("about/prodevelop.html"), 2); |
|
87 |
ApplicationLocator.getManager().registerAddTableWizard("DB", |
|
88 |
"DB Tables", WizardDB.class); |
|
89 |
AddLayer.addWizard(WizardVectorialDB.class); |
|
90 |
} |
|
85 | 91 |
|
86 |
AboutParticipant participant = about.getDeveloper("PRODEVELOP"); |
|
87 |
participant.addContribution( |
|
88 |
"GeoDB", |
|
89 |
"Soporte para pool de conexiones con BBDD", |
|
90 |
2006,1,1, |
|
91 |
2007,12,31 |
|
92 |
); |
|
93 |
} |
|
92 |
private void addAboutInfo() { |
|
93 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
94 | 94 |
|
95 |
AboutManager about = application.getAbout(); |
|
96 |
about.addDeveloper("PRODEVELOP", getClass().getClassLoader() |
|
97 |
.getResource("about/prodevelop.html"), 2); |
|
98 |
|
|
99 |
AboutParticipant participant = about.getDeveloper("PRODEVELOP"); |
|
100 |
participant.addContribution( |
|
101 |
"GeoDB", |
|
102 |
"Soporte para pool de conexiones con BBDD", |
|
103 |
2006, 1, 1, |
|
104 |
2007, 12, 31 |
|
105 |
); |
|
106 |
} |
|
107 |
|
|
95 | 108 |
} |
Also available in: Unified diff