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 @ 44533
History | View | Annotate | Download (3.01 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.andami.IconThemeHelper; |
26 |
import org.gvsig.andami.PluginsLocator; |
27 |
import org.gvsig.andami.PluginsManager; |
28 |
import org.gvsig.andami.plugins.Extension; |
29 |
import org.gvsig.app.ApplicationLocator; |
30 |
import org.gvsig.app.ApplicationManager; |
31 |
import org.gvsig.app.extension.AddLayer; |
32 |
import org.gvsig.fmap.dal.DALLocator; |
33 |
import org.gvsig.fmap.dal.DataManager; |
34 |
import org.gvsig.tools.dynobject.DynObject; |
35 |
import org.gvsig.fmap.dal.DataServerExplorerPool; |
36 |
|
37 |
/**
|
38 |
* This extension adds the export-to-oracle button.
|
39 |
*
|
40 |
* @author jldominguez
|
41 |
*
|
42 |
*/
|
43 |
public class ExtDB_Spatial extends Extension { |
44 |
|
45 |
@Override
|
46 |
public void initialize() { |
47 |
IconThemeHelper.registerIcon("geodb", "geodb-connection-add", this); |
48 |
IconThemeHelper.registerIcon("geodb", "geodb-advanced-properties", this); |
49 |
IconThemeHelper.registerIcon("geodb", "geodb-get-view-extent", this); |
50 |
|
51 |
DataManager dataManager = DALLocator.getDataManager(); |
52 |
PluginsManager manager = PluginsLocator.getManager(); |
53 |
DynObject pluginProperties = manager.getPlugin(ExtDB_Spatial.class).getPluginProperties(); |
54 |
if( pluginProperties.getDynValue("explorersPool")==null ) { |
55 |
pluginProperties.setDynValue("explorersPool", dataManager.getDataServerExplorerPool());
|
56 |
} else {
|
57 |
dataManager.setDataServerExplorerPool((DataServerExplorerPool)pluginProperties.getDynValue("explorersPool"));
|
58 |
} |
59 |
|
60 |
} |
61 |
|
62 |
@Override
|
63 |
public void execute(String actionCommand) { |
64 |
//do nothing
|
65 |
} |
66 |
|
67 |
@Override
|
68 |
public boolean isEnabled() { |
69 |
return isVisible();
|
70 |
} |
71 |
|
72 |
@Override
|
73 |
public boolean isVisible() { |
74 |
return false; |
75 |
} |
76 |
|
77 |
@Override
|
78 |
public void postInitialize() { |
79 |
super.postInitialize();
|
80 |
|
81 |
// ApplicationLocator.getManager().registerAddTableWizard("DB","DB Tables", WizardDB.class);
|
82 |
// AddLayer.addWizard(WizardVectorialDB.class);
|
83 |
|
84 |
ApplicationLocator.getManager().registerAddTableWizard("DB","DB Tables", WizardDBTabular.class); |
85 |
AddLayer.addWizard(WizardDBVectorial.class); |
86 |
|
87 |
} |
88 |
|
89 |
} |