gvsig-projects-pool / org.gvsig.vcsgis / trunk / org.gvsig.vcsgis / org.gvsig.vcsgis.app / org.gvsig.vcsgis.app.server / src / main / java / org / gvsig / vcsgis / app / server / VCSGisServerExtension.java @ 2824
History | View | Annotate | Download (2.58 KB)
1 |
/*
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2020 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, see <https://www.gnu.org/licenses/>.
|
18 |
*
|
19 |
* For any additional information, do not hesitate to contact us
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
21 |
*/
|
22 |
package org.gvsig.vcsgis.app.server; |
23 |
|
24 |
import org.gvsig.andami.IconThemeHelper; |
25 |
import org.gvsig.andami.plugins.Extension; |
26 |
import org.gvsig.tools.ToolsLocator; |
27 |
import org.gvsig.tools.i18n.I18nManager; |
28 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
29 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
30 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager_v2; |
31 |
|
32 |
/**
|
33 |
*
|
34 |
* @author gvSIG Team
|
35 |
*/
|
36 |
public class VCSGisServerExtension extends Extension { |
37 |
|
38 |
private VCSGisServerPanel serverPanel = null; |
39 |
|
40 |
@Override
|
41 |
public void initialize() { |
42 |
IconThemeHelper.registerIcon("action", "tools-vcsgis-show-server", this); |
43 |
IconThemeHelper.registerIcon("action", "tools-vcsgis-server-restart", this); |
44 |
IconThemeHelper.registerIcon("action", "tools-vcsgis-server-stop", this); |
45 |
} |
46 |
|
47 |
@Override
|
48 |
public void postInitialize() { |
49 |
super.postInitialize();
|
50 |
} |
51 |
|
52 |
|
53 |
@Override
|
54 |
public boolean isEnabled() { |
55 |
return true; |
56 |
} |
57 |
|
58 |
@Override
|
59 |
public boolean isVisible() { |
60 |
return true; |
61 |
} |
62 |
|
63 |
@Override
|
64 |
public void execute(String actionCommand) { |
65 |
|
66 |
switch (actionCommand) {
|
67 |
case "tools-vcsgis-show-server": |
68 |
this.showServer();
|
69 |
break;
|
70 |
} |
71 |
} |
72 |
|
73 |
private void showServer() { |
74 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
75 |
WindowManager_v2 winManager = (WindowManager_v2) ToolsSwingLocator.getWindowManager(); |
76 |
|
77 |
if( this.serverPanel == null ) { |
78 |
this.serverPanel = new VCSGisServerPanel(); |
79 |
} |
80 |
winManager.showWindow( |
81 |
serverPanel.asJComponent(), |
82 |
"VCSGis Server",
|
83 |
WindowManager.MODE.WINDOW |
84 |
); |
85 |
} |
86 |
} |