1 19 20 package org.netbeans.modules.j2ee.ddloaders.multiview; 21 22 import org.netbeans.modules.j2ee.dd.api.ejb.MessageDriven; 23 import org.netbeans.modules.j2ee.ddloaders.multiview.ui.MdbImplementationForm; 24 import org.netbeans.modules.xml.multiview.ui.SectionNodeView; 25 import org.netbeans.modules.xml.multiview.ui.LinkButton; 26 import org.netbeans.modules.xml.multiview.XmlMultiViewDataObject; 27 import org.openide.filesystems.FileObject; 28 29 import javax.swing.*; 30 import java.awt.event.ActionEvent ; 31 import java.awt.event.ActionListener ; 32 33 36 public class MdbImplementationPanel extends MdbImplementationForm { 37 private XmlMultiViewDataObject dataObject; 38 private static final String LINK_BEAN = "linkBean"; 39 private MessageDriven messageDriven; 40 private NonEditableDocument beanClassDocument; 41 42 47 public MdbImplementationPanel(final SectionNodeView sectionNodeView, final MessageDriven messageDriven) { 48 super(sectionNodeView); 49 this.messageDriven = messageDriven; 50 dataObject = sectionNodeView.getDataObject(); 51 beanClassDocument = new NonEditableDocument() { 52 protected String retrieveText() { 53 return messageDriven.getEjbClass(); 54 } 55 }; 56 getBeanClassTextField().setDocument(beanClassDocument); 57 JButton moveClassButton = getMoveClassButton(); 58 moveClassButton.addActionListener(new ActionListener () { 59 public void actionPerformed(ActionEvent e) { 60 } 62 }); 63 JButton renameClassButton = getRenameClassButton(); 64 renameClassButton.addActionListener(new ActionListener () { 65 public void actionPerformed(ActionEvent e) { 66 } 68 }); 69 LinkButton.initLinkButton(getBeanClassLinkButton(), this, null, LINK_BEAN); 70 } 71 72 public void dataModelPropertyChange(Object source, String propertyName, Object oldValue, Object newValue) { 73 scheduleRefreshView(); 74 } 75 76 public void refreshView() { 77 beanClassDocument.init(); 78 } 79 80 public void linkButtonPressed(Object ddBean, String ddProperty) { 81 if(ddProperty == LINK_BEAN) { 82 final FileObject ejbJarFile = dataObject.getPrimaryFile(); 83 } 87 } 88 } 89 | Popular Tags |