1 19 package org.netbeans.modules.j2ee.websphere6.dd.loaders.ejbext; 20 21 import org.netbeans.modules.j2ee.websphere6.dd.loaders.WSMultiViewDataObject; 22 import org.netbeans.modules.j2ee.websphere6.dd.beans.WSEjbExt; 23 import org.netbeans.modules.j2ee.websphere6.dd.beans.DDXmi; 24 import org.netbeans.modules.xml.multiview.*; 25 import org.netbeans.modules.schema2beans.*; 26 import org.netbeans.spi.xml.cookies.*; 27 import org.openide.filesystems.FileUtil; 28 import org.openide.filesystems.FileObject; 29 import org.openide.loaders.DataObjectExistsException; 30 import org.openide.loaders.MultiDataObject; 31 import org.openide.nodes.CookieSet; 32 import org.openide.nodes.Node; 33 import org.openide.text.DataEditorSupport; 34 import org.openide.ErrorManager; 35 import java.nio.channels.FileLock ; 36 import java.io.StringWriter ; 37 import java.io.Writer ; 38 import java.io.IOException ; 39 import javax.xml.parsers.*; 40 41 42 public class WSEjbExtDataObject extends WSMultiViewDataObject { 43 44 public WSEjbExtDataObject(FileObject pf, WSEjbExtDataLoader loader) throws DataObjectExistsException, IOException { 45 super(pf, loader); 46 } 47 48 public DDXmi getDD() throws java.io.IOException { 49 if (ddBaseBean==null) { 50 ddBaseBean = new WSEjbExt(FileUtil.toFile(getPrimaryFile()),false); 51 } 52 return (WSEjbExt)ddBaseBean; 53 } 54 public WSEjbExt getEjbExt() throws java.io.IOException { 55 return (WSEjbExt)getDD(); 56 } 57 58 protected DDXmi createDDXmiFromDataCache() { 59 return new WSEjbExt(getInputStream(), false); 60 } 61 62 63 protected Node createNodeDelegate() { 64 return new WSEjbExtDataNode(this); 65 } 66 67 protected DesignMultiViewDesc[] getMultiViewDesc() { 68 designView = new DesignView(this); 69 return new DesignMultiViewDesc[]{designView}; 70 } 71 72 73 74 public WSEjbExtToolBarMVElement getEETB() { 75 return ((DesignView)designView).getEETB(); 76 } 77 78 protected class DesignView extends WSDesignView { 79 private WSEjbExtToolBarMVElement eetb; 80 private static final long serialVersionUID=7209502130942350230L; 81 DesignView(WSEjbExtDataObject dObj) { 82 super(dObj); 83 } 84 85 public org.netbeans.core.spi.multiview.MultiViewElement createElement() { 86 WSEjbExtDataObject dObj = (WSEjbExtDataObject)getDataObject(); 87 eetb=new WSEjbExtToolBarMVElement(dObj); 88 return eetb; 89 } 90 91 public String preferredID() { 92 return "ejbext_multiview_design"; 93 } 94 public WSEjbExtToolBarMVElement getEETB() { 95 return eetb; 96 97 } 98 public java.awt.Image getIcon() { 99 return org.openide.util.Utilities.loadImage("org/netbeans/modules/j2ee/websphere6/dd/resources/ws4.gif"); } 101 } 102 103 106 107 public void showElement(Object element) { 108 Object target=null; 109 openView(0); 113 target=element; 114 if (target!=null) { 116 final Object key=target; 117 org.netbeans.modules.xml.multiview.Utils.runInAwtDispatchThread(new Runnable () { 118 public void run() { 119 getActiveMultiViewElement0().getSectionView().openPanel(key); 120 } 121 }); 122 } 123 } 124 125 } 126 | Popular Tags |