1 26 27 package org.objectweb.openccm.packaging; 28 29 import org.objectweb.openccm.descriptor.corbacomponent.beans.CorbacomponentBean; 30 import org.objectweb.openccm.descriptor.corbacomponent.beans.CorbacomponentBeanImpl; 31 32 36 public class DescriptorEditActionListener 37 implements org.objectweb.util.browser.api.MenuItem 38 { 39 44 public int 45 getStatus(org.objectweb.util.browser.api.TreeView treeView) 46 { 47 return org.objectweb.util.browser.api.MenuItem.ENABLED_STATUS; 48 } 49 50 public void 51 actionPerformed (org.objectweb.util.browser.api.MenuItemTreeView the_event) 52 { 53 org.objectweb.util.browser.core.common.DynamicTree calling_tree 55 = (org.objectweb.util.browser.core.common.DynamicTree) 56 the_event.getTree(); 57 58 org.objectweb.apollon.gui.ApollonFrame calling_frame 60 = (org.objectweb.apollon.gui.ApollonFrame) 61 calling_tree.getRootPane().getParent(); 62 63 org.objectweb.openccm.descriptor.softpkg.beans.DescriptorBean ccd_file 65 = (org.objectweb.openccm.descriptor.softpkg.beans.DescriptorBean) 66 the_event.getSelectedObject(); 67 68 java.io.File corbacomponent 69 = new java.io.File (ccd_file.getFileinarchive().getName()); 70 71 if (!corbacomponent.exists()) 73 { 74 CorbacomponentBean ccd_instance 75 = new CorbacomponentBeanImpl(); 76 77 ccd_instance.setDocType("corbacomponent","","dtd/corbacomponent.dtd"); 78 79 try { 80 ccd_instance.marshalBean( 81 new java.io.File (ccd_file.getFileinarchive().getName()) 82 ); 83 } catch (Exception exception) { 84 exception.printStackTrace(); 85 } 86 } 87 else 88 { 89 } 91 92 FileOperations.open_file( 93 new java.io.File (ccd_file.getFileinarchive().getName()) 94 , calling_frame 95 ); 96 } 97 } 98 | Popular Tags |