KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > explorer > menu > AbstractMenuAction


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2003 INRIA - USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Jerome Moroy.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26 package org.objectweb.openccm.explorer.menu;
27
28 /** The administration console's imports */
29 import org.objectweb.fractal.api.Component;
30 import org.objectweb.fractal.api.NoSuchInterfaceException;
31 import org.objectweb.openccm.explorer.CORBA.ConsoleFactory;
32 import org.objectweb.util.explorer.api.Tree;
33 import org.objectweb.util.explorer.swing.api.Explorer;
34
35 /** The java API's imports */
36 import javax.swing.AbstractAction JavaDoc;
37 import javax.swing.ImageIcon JavaDoc;
38
39 /**
40  * This class defines the constructor of a menu action
41  *
42  * @author <a HREF="mailto:Jerome.Moroy@lifl.fr">Jerome Moroy</a>
43  *
44  * @version 0.1
45  */

46 public abstract class AbstractMenuAction
47               extends AbstractAction JavaDoc
48 {
49
50     protected Component tree_;
51     protected Tree treeItf_ = null;
52     protected Explorer explorerItf_ = null;
53     
54     /**
55      * Abstract constructor
56      */

57     protected AbstractMenuAction(String JavaDoc nom, ImageIcon JavaDoc image, String JavaDoc desc, Integer JavaDoc mnemonic, Component tree) {
58         super(nom, image);
59         putValue(SHORT_DESCRIPTION, desc);
60         putValue(MNEMONIC_KEY, mnemonic);
61         tree_ = tree;
62         if(tree_!=null){
63             try {
64                 treeItf_ = (Tree)tree_.getFcInterface(Tree.TREE);
65                 explorerItf_ = (Explorer)tree_.getFcInterface(Explorer.EXPLORER);
66             } catch (NoSuchInterfaceException e) {
67                 ConsoleFactory.getDebugConsole().add(e.getMessage());
68             }
69         }
70     }
71
72     public abstract void actionPerformed(java.awt.event.ActionEvent JavaDoc ae);
73
74 }
75
Popular Tags