1 19 package org.netbeans.modules.j2ee.websphere6.dd.loaders.webext; 20 21 import org.netbeans.modules.j2ee.websphere6.dd.loaders.WSMultiViewDataObject; 22 import org.netbeans.modules.j2ee.websphere6.dd.beans.WSWebExt; 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 43 public class WSWebExtDataObject extends WSMultiViewDataObject { 44 45 46 public WSWebExtDataObject(FileObject pf, WSWebExtDataLoader loader) throws DataObjectExistsException, IOException { 47 super(pf, loader); 48 } 49 50 public DDXmi getDD() throws java.io.IOException { 51 if (ddBaseBean==null) { 52 ddBaseBean = new WSWebExt(FileUtil.toFile(getPrimaryFile()),false); 53 } 54 return (WSWebExt)ddBaseBean; 55 } 56 public WSWebExt getWebExt() throws java.io.IOException { 57 return (WSWebExt)getDD(); 58 } 59 60 protected DDXmi createDDXmiFromDataCache() { 61 return new WSWebExt(getInputStream(), false); 62 } 63 64 65 protected Node createNodeDelegate() { 66 return new WSWebExtDataNode(this); 67 } 68 69 protected DesignMultiViewDesc[] getMultiViewDesc() { 70 designView = new DesignView(this); 71 return new DesignMultiViewDesc[]{designView}; 72 } 73 74 75 76 public WSWebExtToolBarMVElement getWETB() { 77 return ((DesignView)designView).getWETB(); 78 } 79 80 protected class DesignView extends WSDesignView { 81 private WSWebExtToolBarMVElement wetb; 82 private static final long serialVersionUID=7209502130942350230L; 83 DesignView(WSWebExtDataObject dObj) { 84 super(dObj); 85 } 86 87 public org.netbeans.core.spi.multiview.MultiViewElement createElement() { 88 WSWebExtDataObject dObj = (WSWebExtDataObject)getDataObject(); 89 wetb=new WSWebExtToolBarMVElement(dObj); 90 return wetb; 91 } 92 93 public String preferredID() { 94 return "webext_multiview_design"; 95 } 96 public WSWebExtToolBarMVElement getWETB() { 97 return wetb; 98 99 } 100 public java.awt.Image getIcon() { 101 return org.openide.util.Utilities.loadImage("org/netbeans/modules/j2ee/websphere6/dd/resources/ws6.gif"); } 103 } 104 105 108 109 public void showElement(Object element) { 110 Object target=null; 111 openView(0); 115 target=element; 116 if (target!=null) { 118 final Object key=target; 119 org.netbeans.modules.xml.multiview.Utils.runInAwtDispatchThread(new Runnable () { 120 public void run() { 121 getActiveMultiViewElement0().getSectionView().openPanel(key); 122 } 123 }); 124 } 125 } 126 127 } 128 | Popular Tags |