gvsig-projects-pool / org.gvsig.winmgr / trunk / org.gvsig.winmgr.app / org.gvsig.winmgr.app.mainplugin / src / main / java / org / gvsig / coreplugin / Consola.java @ 682
History | View | Annotate | Download (3.15 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
|
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.coreplugin; |
25 |
|
26 |
import org.gvsig.andami.IconThemeHelper; |
27 |
import org.gvsig.andami.PluginServices; |
28 |
import org.gvsig.andami.PluginsLocator; |
29 |
import org.gvsig.andami.PluginsManager; |
30 |
import org.gvsig.andami.messages.NotificationManager; |
31 |
import org.gvsig.andami.plugins.Extension; |
32 |
import org.gvsig.tools.dynobject.DynObject; |
33 |
|
34 |
/**
|
35 |
* Extensi?n que registra un frame en la aplicaci?n que recibe los eventos de
|
36 |
* la consola de la aplicaci?n y los muestra en el frame
|
37 |
*/
|
38 |
public class Consola extends Extension { |
39 |
|
40 |
//static PluginServices ps;
|
41 |
public static ConsolaFrame consolaFrame; |
42 |
public static NotificationDialogNew notificationDialogNew; |
43 |
public static NotificationDialog notificationDialog; |
44 |
|
45 |
/**
|
46 |
* @see com.iver.mdiApp.IExtension#initialize()
|
47 |
*/
|
48 |
public void initialize() { |
49 |
IconThemeHelper.registerIcon("action", "show-console", this); |
50 |
|
51 |
PluginsManager pluginsManager = PluginsLocator.getManager(); |
52 |
PluginServices plugin = pluginsManager.getPlugin(this.getClass());
|
53 |
|
54 |
consolaFrame = new ConsolaFrame();
|
55 |
NotificationManager.addNotificationListener(consolaFrame); |
56 |
|
57 |
DynObject pluginProperties = plugin.getPluginProperties(); |
58 |
Boolean showNotificationsInConsole = (Boolean) pluginProperties.getDynValue("showNotificationsInConsole"); |
59 |
if ( showNotificationsInConsole == null || showNotificationsInConsole.booleanValue() ) { |
60 |
notificationDialogNew = new NotificationDialogNew();
|
61 |
NotificationManager.addNotificationListener(notificationDialogNew); |
62 |
} |
63 |
} |
64 |
|
65 |
/* (non-Javadoc)
|
66 |
* @see com.iver.andami.plugins.Extension#execute(java.lang.String)
|
67 |
*/
|
68 |
public void execute(String actionCommand) { |
69 |
if ( "show-console".equalsIgnoreCase(actionCommand) ) { |
70 |
consolaFrame.setSize(400, 325); |
71 |
consolaFrame.setVisible(true);
|
72 |
PluginServices.getMDIManager().addWindow(consolaFrame); |
73 |
} |
74 |
} |
75 |
|
76 |
/* (non-Javadoc)
|
77 |
* @see com.iver.andami.plugins.Extension#isEnabled()
|
78 |
*/
|
79 |
public boolean isEnabled() { |
80 |
return true; |
81 |
} |
82 |
|
83 |
/* (non-Javadoc)
|
84 |
* @see com.iver.andami.plugins.Extension#isVisible()
|
85 |
*/
|
86 |
public boolean isVisible() { |
87 |
return true; |
88 |
} |
89 |
} |