Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libCorePlugin / src / org / gvsig / coreplugin / StatusBar.java @ 38608

History | View | Annotate | Download (2.91 KB)

1 37842 cordinyana
/* gvSIG. Geographic Information System of the Valencian Government
2 1104 fjp
 *
3 37842 cordinyana
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
5
 *
6 1104 fjp
 * 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 2
9
 * of the License, or (at your option) any later version.
10 37842 cordinyana
 *
11 1104 fjp
 * 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 37842 cordinyana
 *
16 1104 fjp
 * 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 37842 cordinyana
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21 1104 fjp
 */
22 29630 jpiera
package org.gvsig.coreplugin;
23 592 fernando
24 38564 jjdelcerro
import javax.swing.JOptionPane;
25
26 29630 jpiera
import org.gvsig.andami.PluginServices;
27
import org.gvsig.andami.messages.MessageEvent;
28
import org.gvsig.andami.messages.NotificationListener;
29
import org.gvsig.andami.messages.NotificationManager;
30
import org.gvsig.andami.plugins.Extension;
31 592 fernando
32
/**
33
 * Plugin que escucha las notificaciones que recive la aplicaci?n y las muestra
34
 * en la barra de estado
35
 */
36 5005 jorpiell
public class StatusBar extends Extension implements NotificationListener {
37 37842 cordinyana
38 592 fernando
    /**
39 5005 jorpiell
     * @see com.iver.mdiApp.IExtension#initialize()
40 592 fernando
     */
41 5005 jorpiell
    public void initialize() {
42 592 fernando
        NotificationManager.addNotificationListener(this);
43
    }
44
45
    /**
46
     * @see com.iver.mdiApp.NotificationListener#errorEvent(java.lang.String)
47
     */
48
    public void errorEvent(MessageEvent e) {
49 38564 jjdelcerro
            String msg = e.getMessages()[0];
50
        PluginServices.getMainFrame().getStatusBar().message(msg, JOptionPane.ERROR_MESSAGE);
51 592 fernando
    }
52
53
    /**
54
     * @see com.iver.mdiApp.NotificationListener#warningEvent(java.lang.String)
55
     */
56
    public void warningEvent(MessageEvent e) {
57 37842 cordinyana
        PluginServices.getMainFrame().getStatusBar()
58
            .setWarningText(e.getMessages()[0]);
59 592 fernando
    }
60
61
    /**
62
     * @see com.iver.mdiApp.NotificationListener#infoEvent(java.lang.String)
63
     */
64
    public void infoEvent(MessageEvent e) {
65 37842 cordinyana
        PluginServices.getMainFrame().getStatusBar()
66
            .setInfoText(e.getMessages()[0]);
67 592 fernando
    }
68
69 37842 cordinyana
    /*
70
     * (non-Javadoc)
71
     *
72
     * @see com.iver.andami.plugins.Extension#execute(java.lang.String)
73
     */
74
    public void execute(String actionCommand) {
75
        // TODO Auto-generated method stub
76 15926 vcaballero
77 37842 cordinyana
    }
78 592 fernando
79 37842 cordinyana
    /*
80
     * (non-Javadoc)
81
     *
82
     * @see com.iver.andami.plugins.Extension#isEnabled()
83
     */
84
    public boolean isEnabled() {
85
        // TODO Auto-generated method stub
86
        return false;
87
    }
88 592 fernando
89 37842 cordinyana
    /*
90
     * (non-Javadoc)
91
     *
92
     * @see com.iver.andami.plugins.Extension#isVisible()
93
     */
94
    public boolean isVisible() {
95
        // TODO Auto-generated method stub
96
        return false;
97
    }
98 592 fernando
99
}