01: /*
02: * The contents of this file are subject to the terms of the Common Development
03: * and Distribution License (the License). You may not use this file except in
04: * compliance with the License.
05: *
06: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
07: * or http://www.netbeans.org/cddl.txt.
08: *
09: * When distributing Covered Code, include this CDDL Header Notice in each file
10: * and include the License file at http://www.netbeans.org/cddl.txt.
11: * If applicable, add the following below the CDDL Header, with the fields
12: * enclosed by brackets [] replaced by your own identifying information:
13: * "Portions Copyrighted [year] [name of copyright owner]"
14: *
15: * The Original Software is NetBeans. The Initial Developer of the Original
16: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17: * Microsystems, Inc. All Rights Reserved.
18: */
19: package org.netbeans.modules.xslt.tmap.multiview.designer;
20:
21: import java.awt.Image;
22: import java.beans.BeanInfo;
23: import java.io.Serializable;
24:
25: import org.netbeans.core.spi.multiview.MultiViewDescription;
26: import org.netbeans.core.spi.multiview.MultiViewElement;
27: import org.netbeans.modules.xslt.tmap.TMapDataObject;
28: import org.openide.util.HelpCtx;
29: import org.openide.util.NbBundle;
30: import org.openide.windows.TopComponent;
31:
32: /**
33: *
34: * @author Vitaly Bychkov
35: * @version 1.0
36: *
37: */
38: public class DesignerMultiViewElementDesc implements
39: MultiViewDescription, Serializable {
40:
41: private static final long serialVersionUID = 1L;
42: public static final String PREFERRED_ID = "tmap-designer";
43: private static final String LBL_DESIGN = "LBL_TAB_Design";
44: private TMapDataObject myDataObject;
45:
46: // for deserialization
47: private DesignerMultiViewElementDesc() {
48: super ();
49: }
50:
51: public DesignerMultiViewElementDesc(TMapDataObject dataObject) {
52: myDataObject = dataObject;
53: }
54:
55: public MultiViewElement createElement() {
56: return new DesignerMultiViewElement(myDataObject);
57: }
58:
59: public String getDisplayName() {
60: return NbBundle.getBundle(getClass()).getString(LBL_DESIGN);
61: }
62:
63: public HelpCtx getHelpCtx() {
64: return new HelpCtx("tmap_editor_design_about"); //NOI18N
65: }
66:
67: public Image getIcon() {
68: return myDataObject.getNodeDelegate().getIcon(
69: BeanInfo.ICON_COLOR_16x16);
70:
71: }
72:
73: public int getPersistenceType() {
74: return TopComponent.PERSISTENCE_ONLY_OPENED;
75: }
76:
77: public String preferredID() {
78: return PREFERRED_ID;
79: }
80:
81: }
|