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:
20: package org.netbeans.modules.xslt.tmap.multiview.tree;
21:
22: import java.awt.Image;
23: import java.beans.BeanInfo;
24: import java.io.Serializable;
25:
26: import org.netbeans.core.spi.multiview.MultiViewDescription;
27: import org.netbeans.core.spi.multiview.MultiViewElement;
28: import org.netbeans.modules.xslt.tmap.TMapDataObject;
29: import org.openide.util.HelpCtx;
30: import org.openide.util.NbBundle;
31: import org.openide.windows.TopComponent;
32:
33: /**
34: *
35: * @author Vitaly Bychkov
36: * @version 1.0
37: */
38: public class TreeMultiViewElementDesc implements MultiViewDescription,
39: Serializable {
40:
41: private static final long serialVersionUID = 1L;
42: public static final String PREFERRED_ID = "tmap-tree";
43: private static final String LBL_TREE = "LBL_TAB_Tree";
44: private TMapDataObject myDataObject;
45:
46: // for deserialization
47: private TreeMultiViewElementDesc() {
48: super ();
49: }
50:
51: public TreeMultiViewElementDesc(TMapDataObject dataObject) {
52: myDataObject = dataObject;
53: }
54:
55: public MultiViewElement createElement() {
56: return new TreeMultiViewElement(myDataObject);
57: }
58:
59: public String getDisplayName() {
60: return NbBundle.getBundle(getClass()).getString(LBL_TREE);
61: }
62:
63: public HelpCtx getHelpCtx() {
64: // return new HelpCtx("tmap_editor_tree_about"); //NOI18N
65: return HelpCtx.DEFAULT_HELP;
66: }
67:
68: public Image getIcon() {
69: return myDataObject.getNodeDelegate().getIcon(
70: BeanInfo.ICON_COLOR_16x16);
71:
72: }
73:
74: public int getPersistenceType() {
75: return TopComponent.PERSISTENCE_ONLY_OPENED;
76: }
77:
78: public String preferredID() {
79: return PREFERRED_ID;
80: }
81: }
|