KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > packaging > PropertyfileEditActionListener


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 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): Christophe Contreras
23 Contributor(s): ___________________________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.packaging;
28
29 /**
30  * This is the action class for opening a CPF from a software package descriptor
31  *
32  */

33 public class PropertyfileEditActionListener
34   implements org.objectweb.util.browser.api.MenuItem
35 {
36     /**
37      * Status of the menu item
38      *
39      * @param treeView to obtain the activated node
40      */

41     public int
42     getStatus(org.objectweb.util.browser.api.TreeView treeView)
43     {
44         return org.objectweb.util.browser.api.MenuItem.ENABLED_STATUS;
45     }
46
47     public void
48     actionPerformed (org.objectweb.util.browser.api.MenuItemTreeView the_event)
49     {
50         // gets the calling tree
51
org.objectweb.util.browser.core.common.DynamicTree calling_tree
52          = (org.objectweb.util.browser.core.common.DynamicTree)
53            the_event.getTree();
54
55         //gets the frame
56
org.objectweb.apollon.gui.ApollonFrame calling_frame
57          = (org.objectweb.apollon.gui.ApollonFrame)
58             calling_tree.getRootPane().getParent();
59
60         // gets the calling XML element
61
org.objectweb.openccm.descriptor.softpkg.beans.PropertyfileBean zeus_instance
62          = (org.objectweb.openccm.descriptor.softpkg.beans.PropertyfileBean)
63            the_event.getSelectedObject();
64
65         FileOperations.open_file(
66             new java.io.File JavaDoc(zeus_instance.getFileinarchive().getName())
67             , calling_frame
68             );
69     }
70 }
71
Popular Tags