1 19 20 package org.netbeans.modules.websvc.design.multiview; 21 22 import java.io.IOException ; 23 import java.io.ObjectInput ; 24 import java.io.ObjectOutput ; 25 import java.io.Serializable ; 26 import org.netbeans.core.spi.multiview.MultiViewDescription; 27 import org.netbeans.core.spi.multiview.MultiViewElement; 28 import org.openide.util.HelpCtx; 29 import org.openide.util.NbBundle; 30 import org.openide.windows.TopComponent; 31 32 36 public class DesignMultiViewDesc extends Object 37 implements MultiViewDescription, Serializable { 38 39 private static final long serialVersionUID = -3221821700664562837L; 40 43 public static final String PREFERRED_ID = "webservice-designview"; 44 private MultiViewSupport mvSupport; 45 46 50 public DesignMultiViewDesc() { 51 super(); 52 } 53 54 55 60 public DesignMultiViewDesc(MultiViewSupport mvSupport) { 61 this.mvSupport = mvSupport; 62 } 63 64 65 69 public String preferredID() { 70 return PREFERRED_ID; 71 } 72 73 74 78 public int getPersistenceType() { 79 return TopComponent.PERSISTENCE_NEVER; 80 } 81 82 83 87 public java.awt.Image getIcon() { 88 return MultiViewSupport.SERVICE_BADGE; 89 } 90 91 92 96 public HelpCtx getHelpCtx() { 97 return new HelpCtx(DesignMultiViewDesc.class); 98 } 99 100 101 105 public String getDisplayName() { 106 return NbBundle.getMessage(DesignMultiViewDesc.class, 107 "LBL_designView_name"); 108 } 109 110 111 115 public MultiViewElement createElement() { 116 return new DesignMultiViewElement(mvSupport); 117 } 118 119 120 126 public void writeExternal(ObjectOutput out) throws IOException { 127 out.writeObject(mvSupport); 128 } 129 130 131 138 public void readExternal(ObjectInput in) 139 throws IOException , ClassNotFoundException { 140 Object firstObject = in.readObject(); 141 if (firstObject instanceof MultiViewSupport) 142 mvSupport = (MultiViewSupport) firstObject; 143 } 144 } 145 | Popular Tags |