Statistics
| Revision:

root / tags / v2_0_0_Build_2050 / libraries / libCorePlugin / src / org / gvsig / coreplugin / StatusBar.java @ 38668

History | View | Annotate | Download (2.91 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22
package org.gvsig.coreplugin;
23

    
24
import javax.swing.JOptionPane;
25

    
26
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

    
32
/**
33
 * Plugin que escucha las notificaciones que recive la aplicaci?n y las muestra
34
 * en la barra de estado
35
 */
36
public class StatusBar extends Extension implements NotificationListener {
37

    
38
    /**
39
     * @see com.iver.mdiApp.IExtension#initialize()
40
     */
41
    public void initialize() {
42
        NotificationManager.addNotificationListener(this);
43
    }
44

    
45
    /**
46
     * @see com.iver.mdiApp.NotificationListener#errorEvent(java.lang.String)
47
     */
48
    public void errorEvent(MessageEvent e) {
49
            String msg = e.getMessages()[0];
50
        PluginServices.getMainFrame().getStatusBar().message(msg, JOptionPane.ERROR_MESSAGE);
51
    }
52

    
53
    /**
54
     * @see com.iver.mdiApp.NotificationListener#warningEvent(java.lang.String)
55
     */
56
    public void warningEvent(MessageEvent e) {
57
        PluginServices.getMainFrame().getStatusBar()
58
            .setWarningText(e.getMessages()[0]);
59
    }
60

    
61
    /**
62
     * @see com.iver.mdiApp.NotificationListener#infoEvent(java.lang.String)
63
     */
64
    public void infoEvent(MessageEvent e) {
65
        PluginServices.getMainFrame().getStatusBar()
66
            .setInfoText(e.getMessages()[0]);
67
    }
68

    
69
    /*
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

    
77
    }
78

    
79
    /*
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

    
89
    /*
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

    
99
}