svn-gvsig-desktop / 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 @ 44172
History | View | Annotate | Download (3.61 KB)
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 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 |
*
|
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 |
*
|
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.
|
19 |
*
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
22 |
*/
|
23 |
package org.gvsig.geodb; |
24 |
|
25 |
import org.gvsig.about.AboutManager; |
26 |
import org.gvsig.about.AboutParticipant; |
27 |
import org.gvsig.andami.IconThemeHelper; |
28 |
import org.gvsig.andami.PluginsLocator; |
29 |
import org.gvsig.andami.PluginsManager; |
30 |
import org.gvsig.andami.plugins.Extension; |
31 |
import org.gvsig.app.ApplicationLocator; |
32 |
import org.gvsig.app.ApplicationManager; |
33 |
import org.gvsig.app.extension.AddLayer; |
34 |
import org.gvsig.fmap.dal.DALLocator; |
35 |
import org.gvsig.fmap.dal.DataManager; |
36 |
import org.gvsig.geodb.vectorialdb.wizard.WizardDB; |
37 |
import org.gvsig.geodb.vectorialdb.wizard.WizardVectorialDB; |
38 |
import org.gvsig.tools.dynobject.DynObject; |
39 |
import org.gvsig.fmap.dal.DataServerExplorerPool; |
40 |
|
41 |
/**
|
42 |
* This extension adds the export-to-oracle button.
|
43 |
*
|
44 |
* @author jldominguez
|
45 |
*
|
46 |
*/
|
47 |
public class ExtDB_Spatial extends Extension { |
48 |
|
49 |
public void initialize() { |
50 |
IconThemeHelper.registerIcon("geodb", "geodb-connection-add", this); |
51 |
IconThemeHelper.registerIcon("geodb", "geodb-advanced-properties", this); |
52 |
IconThemeHelper.registerIcon("geodb", "geodb-get-view-extent", this); |
53 |
|
54 |
DataManager dataManager = DALLocator.getDataManager(); |
55 |
PluginsManager manager = PluginsLocator.getManager(); |
56 |
DynObject pluginProperties = manager.getPlugin(ExtDB_Spatial.class).getPluginProperties(); |
57 |
if( pluginProperties.getDynValue("explorersPool")==null ) { |
58 |
pluginProperties.setDynValue("explorersPool", dataManager.getDataServerExplorerPool());
|
59 |
} else {
|
60 |
dataManager.setDataServerExplorerPool((DataServerExplorerPool)pluginProperties.getDynValue("explorersPool"));
|
61 |
} |
62 |
|
63 |
} |
64 |
|
65 |
public void execute(String actionCommand) { |
66 |
//do nothing
|
67 |
} |
68 |
|
69 |
public boolean isEnabled() { |
70 |
return isVisible();
|
71 |
|
72 |
// return true;
|
73 |
} |
74 |
|
75 |
public boolean isVisible() { |
76 |
return false; |
77 |
} |
78 |
|
79 |
@Override
|
80 |
public void postInitialize() { |
81 |
super.postInitialize();
|
82 |
addAboutInfo(); |
83 |
|
84 |
ApplicationLocator.getManager().registerAddTableWizard("DB",
|
85 |
"DB Tables", WizardDB.class);
|
86 |
AddLayer.addWizard(WizardVectorialDB.class); |
87 |
} |
88 |
|
89 |
private void addAboutInfo() { |
90 |
ApplicationManager application = ApplicationLocator.getManager(); |
91 |
|
92 |
// AboutManager about = application.getAbout();
|
93 |
// about.addDeveloper("PRODEVELOP", getClass().getClassLoader()
|
94 |
// .getResource("about/prodevelop.html"), 2);
|
95 |
//
|
96 |
// AboutParticipant participant = about.getDeveloper("PRODEVELOP");
|
97 |
// participant.addContribution(
|
98 |
// "GeoDB",
|
99 |
// "Soporte para pool de conexiones con BBDD",
|
100 |
// 2006, 1, 1,
|
101 |
// 2007, 12, 31
|
102 |
// );
|
103 |
} |
104 |
|
105 |
} |