svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.plugin / org.gvsig.coreplugin.app / org.gvsig.coreplugin.app.mainplugin / src / main / java / org / gvsig / coreplugin / StatusBar.java @ 40558
History | View | Annotate | Download (2.95 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 javax.swing.JOptionPane; |
27 |
|
28 |
import org.gvsig.andami.PluginServices; |
29 |
import org.gvsig.andami.messages.MessageEvent; |
30 |
import org.gvsig.andami.messages.NotificationListener; |
31 |
import org.gvsig.andami.messages.NotificationManager; |
32 |
import org.gvsig.andami.plugins.Extension; |
33 |
|
34 |
/**
|
35 |
* Plugin que escucha las notificaciones que recive la aplicaci?n y las muestra
|
36 |
* en la barra de estado
|
37 |
*/
|
38 |
public class StatusBar extends Extension implements NotificationListener { |
39 |
|
40 |
/**
|
41 |
* @see com.iver.mdiApp.IExtension#initialize()
|
42 |
*/
|
43 |
public void initialize() { |
44 |
NotificationManager.addNotificationListener(this);
|
45 |
} |
46 |
|
47 |
/**
|
48 |
* @see com.iver.mdiApp.NotificationListener#errorEvent(java.lang.String)
|
49 |
*/
|
50 |
public void errorEvent(MessageEvent e) { |
51 |
String msg = e.getMessages()[0]; |
52 |
PluginServices.getMainFrame().getStatusBar().message(msg, JOptionPane.ERROR_MESSAGE);
|
53 |
} |
54 |
|
55 |
/**
|
56 |
* @see com.iver.mdiApp.NotificationListener#warningEvent(java.lang.String)
|
57 |
*/
|
58 |
public void warningEvent(MessageEvent e) { |
59 |
PluginServices.getMainFrame().getStatusBar() |
60 |
.setWarningText(e.getMessages()[0]);
|
61 |
} |
62 |
|
63 |
/**
|
64 |
* @see com.iver.mdiApp.NotificationListener#infoEvent(java.lang.String)
|
65 |
*/
|
66 |
public void infoEvent(MessageEvent e) { |
67 |
PluginServices.getMainFrame().getStatusBar() |
68 |
.setInfoText(e.getMessages()[0]);
|
69 |
} |
70 |
|
71 |
/*
|
72 |
* (non-Javadoc)
|
73 |
*
|
74 |
* @see com.iver.andami.plugins.Extension#execute(java.lang.String)
|
75 |
*/
|
76 |
public void execute(String actionCommand) { |
77 |
// TODO Auto-generated method stub
|
78 |
|
79 |
} |
80 |
|
81 |
/*
|
82 |
* (non-Javadoc)
|
83 |
*
|
84 |
* @see com.iver.andami.plugins.Extension#isEnabled()
|
85 |
*/
|
86 |
public boolean isEnabled() { |
87 |
// TODO Auto-generated method stub
|
88 |
return false; |
89 |
} |
90 |
|
91 |
/*
|
92 |
* (non-Javadoc)
|
93 |
*
|
94 |
* @see com.iver.andami.plugins.Extension#isVisible()
|
95 |
*/
|
96 |
public boolean isVisible() { |
97 |
// TODO Auto-generated method stub
|
98 |
return false; |
99 |
} |
100 |
|
101 |
} |