1 19 20 package org.netbeans.modules.xml.schema.core.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.modules.xml.schema.core.SchemaDataLoader; 28 import org.netbeans.modules.xml.schema.core.SchemaDataObject; 29 import org.openide.loaders.DataObject; 30 import org.openide.util.HelpCtx; 31 import org.openide.util.HelpCtx; 32 import org.openide.util.NbBundle; 33 import org.openide.util.Utilities; 34 import org.openide.windows.TopComponent; 35 36 40 public class SchemaABEViewMultiViewDesc extends Object 41 implements MultiViewDescription, Serializable { 42 43 private static final long serialVersionUID = -3221821700664562839L; 44 public static final String PREFERRED_ID = "xml-schema-abeview"; 45 private SchemaDataObject schemaDataObject; 46 47 51 public SchemaABEViewMultiViewDesc() { 52 super(); 53 } 54 55 56 60 public SchemaABEViewMultiViewDesc(SchemaDataObject schemaDataObject) { 61 this.schemaDataObject = schemaDataObject; 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 Utilities.loadImage(SchemaDataObject.SCHEMA_ICON_BASE_WITH_EXT); 89 } 90 91 92 96 public org.openide.util.HelpCtx getHelpCtx() { 97 return new HelpCtx(SchemaABEViewMultiViewDesc.class); 98 } 99 100 101 105 public String getDisplayName() { 106 return NbBundle.getMessage(SchemaColumnViewMultiViewDesc.class, 107 "LBL_ABE_View_name"); 108 } 109 110 111 115 public org.netbeans.core.spi.multiview.MultiViewElement createElement() { 116 return new SchemaABEViewMultiViewElement(schemaDataObject); 117 } 118 119 120 124 public void writeExternal(ObjectOutput out) throws IOException { 125 out.writeObject(schemaDataObject); 126 } 127 128 129 133 public void readExternal(ObjectInput in) 134 throws IOException , ClassNotFoundException 135 { 136 Object firstObject = in.readObject(); 137 if (firstObject instanceof SchemaDataObject) 138 schemaDataObject = (SchemaDataObject) firstObject; 139 } 140 } 141 | Popular Tags |