Revision 41282 trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.coreplugin.app/org.gvsig.coreplugin.app.mainplugin/src/main/java/org/gvsig/coreplugin/Consola.java
Consola.java | ||
---|---|---|
10 | 10 |
* |
11 | 11 |
* This program is distributed in the hope that it will be useful, |
12 | 12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
14 | 14 |
* GNU General Public License for more details. |
15 | 15 |
* |
16 | 16 |
* You should have received a copy of the GNU General Public License |
17 | 17 |
* along with this program; if not, write to the Free Software |
18 | 18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
19 |
* MA 02110-1301, USA.
|
|
19 |
* MA 02110-1301, USA. |
|
20 | 20 |
* |
21 | 21 |
* For any additional information, do not hesitate to contact us |
22 | 22 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
... | ... | |
25 | 25 |
|
26 | 26 |
import org.gvsig.andami.IconThemeHelper; |
27 | 27 |
import org.gvsig.andami.PluginServices; |
28 |
import org.gvsig.andami.PluginsLocator; |
|
29 |
import org.gvsig.andami.PluginsManager; |
|
28 | 30 |
import org.gvsig.andami.messages.NotificationManager; |
29 | 31 |
import org.gvsig.andami.plugins.Extension; |
32 |
import org.gvsig.tools.dynobject.DynObject; |
|
30 | 33 |
|
31 |
|
|
32 | 34 |
/** |
33 | 35 |
* Extensi?n que registra un frame en la aplicaci?n que recibe los eventos de |
34 | 36 |
* la consola de la aplicaci?n y los muestra en el frame |
35 | 37 |
*/ |
36 | 38 |
public class Consola extends Extension { |
37 |
static PluginServices ps; |
|
39 |
|
|
40 |
//static PluginServices ps; |
|
38 | 41 |
public static ConsolaFrame consolaFrame; |
39 | 42 |
public static NotificationDialogNew notificationDialogNew; |
40 | 43 |
public static NotificationDialog notificationDialog; |
... | ... | |
43 | 46 |
* @see com.iver.mdiApp.IExtension#initialize() |
44 | 47 |
*/ |
45 | 48 |
public void initialize() { |
46 |
IconThemeHelper.registerIcon("action", "show-console", this); |
|
47 |
|
|
48 |
ps = PluginServices.getPluginServices(this); |
|
49 |
consolaFrame = new ConsolaFrame(); |
|
50 |
NotificationManager.addNotificationListener(consolaFrame); |
|
49 |
IconThemeHelper.registerIcon("action", "show-console", this); |
|
51 | 50 |
|
52 |
notificationDialogNew = new NotificationDialogNew();
|
|
53 |
NotificationManager.addNotificationListener(notificationDialogNew );
|
|
51 |
PluginsManager pluginsManager = PluginsLocator.getManager();
|
|
52 |
PluginServices plugin = pluginsManager.getPlugin(this.getClass());
|
|
54 | 53 |
|
55 |
// notificationDialog= new NotificationDialog();
|
|
56 |
// NotificationManager.addNotificationListener(notificationDialog);
|
|
54 |
consolaFrame = new ConsolaFrame();
|
|
55 |
NotificationManager.addNotificationListener(consolaFrame);
|
|
57 | 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 |
} |
|
58 | 63 |
} |
59 | 64 |
|
60 |
/* (non-Javadoc)
|
|
61 |
* @see com.iver.andami.plugins.Extension#execute(java.lang.String)
|
|
62 |
*/
|
|
63 |
public void execute(String actionCommand) {
|
|
64 |
if( "show-console".equalsIgnoreCase(actionCommand) ) {
|
|
65 |
consolaFrame.setSize(400, 325);
|
|
66 |
consolaFrame.setVisible(true);
|
|
67 |
PluginServices.getMDIManager().addWindow(consolaFrame);
|
|
68 |
}
|
|
69 |
}
|
|
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 |
}
|
|
70 | 75 |
|
71 |
/* (non-Javadoc)
|
|
72 |
* @see com.iver.andami.plugins.Extension#isEnabled()
|
|
73 |
*/
|
|
74 |
public boolean isEnabled() {
|
|
75 |
return true;
|
|
76 |
}
|
|
76 |
/* (non-Javadoc)
|
|
77 |
* @see com.iver.andami.plugins.Extension#isEnabled()
|
|
78 |
*/
|
|
79 |
public boolean isEnabled() {
|
|
80 |
return true;
|
|
81 |
}
|
|
77 | 82 |
|
78 |
/* (non-Javadoc)
|
|
79 |
* @see com.iver.andami.plugins.Extension#isVisible()
|
|
80 |
*/
|
|
81 |
public boolean isVisible() {
|
|
82 |
return true;
|
|
83 |
}
|
|
83 |
/* (non-Javadoc)
|
|
84 |
* @see com.iver.andami.plugins.Extension#isVisible()
|
|
85 |
*/
|
|
86 |
public boolean isVisible() {
|
|
87 |
return true;
|
|
88 |
}
|
|
84 | 89 |
} |
Also available in: Unified diff