1 26 27 package org.objectweb.openccm.packaging; 28 29 import org.objectweb.apollon.gui.ApollonFrame; 30 31 37 public class CCMMenuBar 38 implements java.awt.event.ActionListener 39 { 40 46 47 private ApollonFrame frame_; 48 49 55 public 56 CCMMenuBar(ApollonFrame frame) 57 { 58 this.frame_ = frame; 59 60 javax.swing.JMenu archive_menu = new javax.swing.JMenu ("CCM"); 61 62 javax.swing.JMenuItem openitem = new javax.swing.JMenuItem ("Open Archive..."); 63 openitem.setActionCommand("Open"); 64 openitem.addActionListener(this); 65 archive_menu.add(openitem); 66 67 this.frame_.getJMenuBar().add(archive_menu); 68 } 69 70 74 public void 75 actionPerformed(java.awt.event.ActionEvent e) 76 { 77 78 if (e.getActionCommand().equals("Open")) 79 { 80 java.io.File file=null; 82 javax.swing.JFileChooser dialogBox 83 = new javax.swing.JFileChooser ( 84 System.getProperty("user.dir") 85 ); 86 int returnVal = dialogBox.showOpenDialog(new javax.swing.JPanel ()); 87 88 if (returnVal == javax.swing.JFileChooser.APPROVE_OPTION) 89 { 90 file = dialogBox.getSelectedFile().getAbsoluteFile(); 91 } 92 else 93 return; 94 95 FileOperations.open_file(file,frame_); 96 } 97 } 98 } 99 | Popular Tags |