1 19 20 package org.netbeans.modules.xml.wsdl.ui.netbeans.module; 21 22 import java.io.IOException ; 23 import java.io.ObjectInput ; 24 import java.io.ObjectOutput ; 25 import java.io.Serializable ; 26 27 import org.netbeans.core.spi.multiview.MultiViewDescription; 28 import org.netbeans.core.spi.multiview.MultiViewElement; 29 import org.openide.util.HelpCtx; 30 import org.openide.util.NbBundle; 31 import org.openide.util.Utilities; 32 import org.openide.windows.TopComponent; 33 34 38 public class WSDLTreeViewMultiViewDesc extends Object 39 implements MultiViewDescription, Serializable { 40 41 42 45 private static final long serialVersionUID = 2580263536201519563L; 46 public static final String PREFERRED_ID = "wsdl-treeview"; 47 private WSDLDataObject wsdlDataObject; 48 49 53 public WSDLTreeViewMultiViewDesc() { 54 super(); 55 } 56 57 58 62 public WSDLTreeViewMultiViewDesc(WSDLDataObject wsdlDataObject) { 63 this.wsdlDataObject = wsdlDataObject; 64 } 65 66 67 71 public String preferredID() { 72 return PREFERRED_ID; 73 } 74 75 76 80 public int getPersistenceType() { 81 return TopComponent.PERSISTENCE_NEVER; 82 } 83 84 85 89 public java.awt.Image getIcon() { 90 return Utilities.loadImage(WSDLDataObject.WSDL_ICON_BASE_WITH_EXT); 91 } 92 93 94 public HelpCtx getHelpCtx() { 95 return new HelpCtx(WSDLTreeViewMultiViewDesc.class); 96 } 97 98 99 103 public String getDisplayName() { 104 return NbBundle.getMessage(WSDLTreeViewMultiViewDesc.class, 105 "LBL_designView_name"); 106 } 107 108 109 113 public MultiViewElement createElement() { 114 return new WSDLTreeViewMultiViewElement(wsdlDataObject); 115 } 116 117 118 122 public void writeExternal(ObjectOutput out) throws IOException { 123 out.writeObject(wsdlDataObject); 124 } 125 126 127 131 public void readExternal(ObjectInput in) 132 throws IOException , ClassNotFoundException 133 { 134 Object firstObject = in.readObject(); 135 if (firstObject instanceof WSDLDataObject) 136 wsdlDataObject = (WSDLDataObject) firstObject; 137 } 138 } 139 | Popular Tags |