001: package hero.client.manager;
002:
003: /*
004: *
005: * Menubar.java -
006: * Copyright (C) 2002 Ecoo Team
007: * valdes@loria.fr
008: *
009: *
010: * This program is free software; you can redistribute it and/or
011: * modify it under the terms of the GNU Lesser General Public License
012: * as published by the Free Software Foundation; either version 2
013: * of the License, or (at your option) any later version.
014: *
015: * This program is distributed in the hope that it will be useful,
016: * but WITHOUT ANY WARRANTY; without even the implied warranty of
017: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
018: * GNU Lesser General Public License for more details.
019: *
020: * You should have received a copy of the GNU Lesser General Public License
021: * along with this program; if not, write to the Free Software
022: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
023: */
024:
025: import java.awt.event.ActionEvent;
026: import java.awt.event.ActionListener;
027: import java.awt.Color;
028:
029: import javax.swing.ImageIcon;
030: import javax.swing.JMenu;
031: import javax.swing.JMenuBar;
032: import javax.swing.JMenuItem;
033:
034: public class Menubar extends JMenuBar {
035:
036: static java.util.ResourceBundle resource = java.util.ResourceBundle
037: .getBundle("resources.Traduction")/*#BundleType=List*/;
038:
039: public Menubar(final Manager m) {
040: ClassLoader cl = m.getClass().getClassLoader();
041:
042: JMenu menu;
043: JMenuItem mi;
044:
045: menu = new JMenu(resource.getString("menubar.manager"));
046: menu.setBackground(new Color(153, 153, 255));
047: add(menu);
048:
049: // New
050: mi = new JMenuItem(new ImageIcon(cl
051: .getResource("images/new.png")));
052: mi.setText(resource.getString("menubar.newproj"));
053: mi.setBackground(new Color(153, 153, 255));
054: mi.addActionListener(new ActionListener() {
055: public void actionPerformed(ActionEvent e) {
056: m.NewProject();
057: }
058: });
059: menu.add(mi);
060:
061: // Clone
062: mi = new JMenuItem(new ImageIcon(cl
063: .getResource("images/Copy.gif")));
064: mi.setText(resource.getString("menubar.cloneproj"));
065: mi.setBackground(new Color(153, 153, 255));
066: mi.addActionListener(new ActionListener() {
067: public void actionPerformed(ActionEvent e) {
068: m.CloneProject();
069: }
070: });
071: menu.add(mi);
072:
073: // Instantiate
074: mi = new JMenuItem(new ImageIcon(cl
075: .getResource("images/Copy.gif")));
076: mi.setText(resource.getString("menubar.instproj"));
077: mi.setBackground(new Color(153, 153, 255));
078: mi.addActionListener(new ActionListener() {
079: public void actionPerformed(ActionEvent e) {
080: m.InstantiateProject();
081: }
082: });
083: menu.add(mi);
084:
085: menu.addSeparator();
086:
087: mi = new JMenuItem(resource.getString("menubar.exit"));
088: mi.setIcon(new ImageIcon(cl.getResource("images/exit.png")));
089: mi.setBackground(new Color(153, 153, 255));
090: mi.addActionListener(new ActionListener() {
091: public void actionPerformed(ActionEvent e) {
092: try {
093: // JMSServices jms = JMSServices.getInstance();
094: // jms.closeConnection();
095: System.exit(0);
096: } catch (Exception ex) {
097: }
098: }
099: });
100: menu.add(mi);
101: }
102: }
|