001: /*
002: * Sun Public License Notice
003: *
004: * The contents of this file are subject to the Sun Public License
005: * Version 1.0 (the "License"). You may not use this file except in
006: * compliance with the License. A copy of the License is available at
007: * http://www.sun.com/
008: *
009: * The Original Code is NetBeans. The Initial Developer of the Original
010: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
011: * Microsystems, Inc. All Rights Reserved.
012: If you wish your version of this file to be governed by only the CDDL
013: or only the GPL Version 2, indicate your decision by adding
014: "[Contributor] elects to include this software in this distribution
015: under the [CDDL or GPL Version 2] license." If you do not indicate a
016: single choice of license, a recipient has the option to distribute
017: your version of this file under either the CDDL, the GPL Version 2 or
018: to extend the choice of license to its licensees as provided above.
019: However, if you add GPL Version 2 code and therefore, elected the GPL
020: Version 2 license, then the option applies only if the new code is
021: made subject to such option by the copyright holder.
022: If you wish your version of this file to be governed by only the CDDL
023: or only the GPL Version 2, indicate your decision by adding
024: "[Contributor] elects to include this software in this distribution
025: under the [CDDL or GPL Version 2] license." If you do not indicate a
026: single choice of license, a recipient has the option to distribute
027: your version of this file under either the CDDL, the GPL Version 2 or
028: to extend the choice of license to its licensees as provided above.
029: However, if you add GPL Version 2 code and therefore, elected the GPL
030: Version 2 license, then the option applies only if the new code is
031: made subject to such option by the copyright holder.
032: */
033:
034: /*
035: * WSDLTreeViewMultiViewDesc.java
036: *
037: * Created on October 13, 2005, 2:04 PM
038: *
039: * To change this template, choose Tools | Template Manager
040: * and open the template in the editor.
041: */
042: package org.netbeans.modules.etl.ui;
043:
044: import java.io.IOException;
045: import java.io.ObjectInput;
046: import java.io.ObjectOutput;
047: import java.io.Serializable;
048:
049: import net.java.hulp.i18n.Logger;
050: import org.netbeans.core.spi.multiview.MultiViewDescription;
051: import org.netbeans.core.spi.multiview.MultiViewElement;
052: import org.netbeans.modules.etl.logger.Localizer;
053: import org.netbeans.modules.etl.logger.LogUtil;
054: import org.openide.windows.TopComponent;
055:
056: public class ETLEditorViewMultiViewDesc extends Object implements
057: MultiViewDescription, Serializable {
058:
059: private static final long serialVersionUID = 2580263536201519563L;
060: public static final String PREFERRED_ID = "etl-designview";
061: private ETLDataObject etlDataObject;
062: private static transient final Logger mLogger = LogUtil
063: .getLogger(ETLEditorViewMultiViewDesc.class.getName());
064: private static transient final Localizer mLoc = Localizer.get();
065:
066: public ETLEditorViewMultiViewDesc() {
067: super ();
068: }
069:
070: public ETLEditorViewMultiViewDesc(ETLDataObject etlDataObject) {
071: this .etlDataObject = etlDataObject;
072: }
073:
074: public String preferredID() {
075: return PREFERRED_ID;
076: }
077:
078: public int getPersistenceType() {
079: return TopComponent.PERSISTENCE_NEVER;
080: }
081:
082: public java.awt.Image getIcon() {
083: ETLNode node = (ETLNode) etlDataObject.getNodeDelegate();
084: return node.getIcon(0);
085: }
086:
087: public org.openide.util.HelpCtx getHelpCtx() {
088: return org.openide.util.HelpCtx.DEFAULT_HELP;
089: }
090:
091: public String getDisplayName() {
092: String nbBundle1 = mLoc.t("PRSR001: Design");
093: return Localizer.parse(nbBundle1);
094: }
095:
096: public MultiViewElement createElement() {
097: return new ETLEditorViewMultiViewElement(etlDataObject);
098: }
099:
100: public void writeExternal(ObjectOutput out) throws IOException {
101: out.writeObject(etlDataObject);
102: }
103:
104: public void readExternal(ObjectInput in) throws IOException,
105: ClassNotFoundException {
106: Object firstObject = in.readObject();
107: if (firstObject instanceof ETLDataObject) {
108: etlDataObject = (ETLDataObject) firstObject;
109: }
110: }
111: }
|