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.NbBundle; 32 import org.openide.util.Utilities; 33 import org.openide.windows.TopComponent; 34 35 39 public class SchemaColumnViewMultiViewDesc extends Object 40 implements MultiViewDescription, Serializable { 41 42 private static final long serialVersionUID = -3221821700664562837L; 43 public static final String PREFERRED_ID = "xml-schema-columnview"; 44 private SchemaDataObject schemaDataObject; 45 46 50 public SchemaColumnViewMultiViewDesc() { 51 super(); 52 } 53 54 55 59 public SchemaColumnViewMultiViewDesc(SchemaDataObject schemaDataObject) { 60 this.schemaDataObject = schemaDataObject; 61 } 62 63 64 68 public String preferredID() { 69 return PREFERRED_ID; 70 } 71 72 73 77 public int getPersistenceType() { 78 return TopComponent.PERSISTENCE_NEVER; 79 } 80 81 82 86 public java.awt.Image getIcon() { 87 return Utilities.loadImage(SchemaDataObject.SCHEMA_ICON_BASE_WITH_EXT); 88 } 89 90 91 95 public org.openide.util.HelpCtx getHelpCtx() { 96 return new HelpCtx(SchemaColumnViewMultiViewDesc.class); 98 } 99 100 101 105 public String getDisplayName() { 106 return NbBundle.getMessage(SchemaColumnViewMultiViewDesc.class, 107 "LBL_columnView_name"); 108 } 109 110 111 115 public org.netbeans.core.spi.multiview.MultiViewElement createElement() { 116 return new SchemaColumnViewMultiViewElement(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 |