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.bpel.mapper.multiview;
20:
21: import java.awt.Image;
22: import java.io.Serializable;
23: import org.netbeans.core.spi.multiview.MultiViewDescription;
24: import org.netbeans.core.spi.multiview.MultiViewElement;
25: import org.netbeans.core.spi.multiview.MultiViewFactory;
26: import org.netbeans.modules.bpel.core.BPELDataObject;
27: import org.netbeans.modules.bpel.editors.api.BpelEditorConstants;
28: import org.openide.util.HelpCtx;
29: import org.openide.util.NbBundle;
30: import org.openide.util.Utilities;
31: import org.openide.windows.TopComponent;
32:
33: /**
34: *
35: * @author Vitaly Bychkov
36: * @version 1.0
37: */
38: public class BpelMapperMultiviewElementDesc implements
39: MultiViewDescription, Serializable {
40:
41: private static final long serialVersionUID = 1L;
42:
43: /** unique ID of <code>TopComponent</code> (singleton) */
44: public static final String GROUP_ID = "bpel_mapper_tcgroup"; //NOI18N
45:
46: private BPELDataObject myDataObject;
47:
48: public BpelMapperMultiviewElementDesc(BPELDataObject dObj) {
49: myDataObject = dObj;
50: }
51:
52: public int getPersistenceType() {
53: return TopComponent.PERSISTENCE_ONLY_OPENED;
54: }
55:
56: public String getDisplayName() {
57: return NbBundle.getMessage(
58: BpelMapperMultiviewElementDesc.class,
59: "LBL_BpelMapperMultiview_DisplayName"); // NOI18N
60: }
61:
62: public Image getIcon() {
63: return Utilities
64: .loadImage(
65: "org/netbeans/modules/bpel/mapper/resources/mapper.png",//NOI18N
66: true);
67: }
68:
69: public HelpCtx getHelpCtx() {
70: return new HelpCtx(getClass());
71: }
72:
73: public String preferredID() {
74: return BpelEditorConstants.BPEL_MAPPERMV_PREFFERED_ID;
75: }
76:
77: public MultiViewElement createElement() {
78: return new BpelMapperMultiviewElement(myDataObject);
79: // return MultiViewFactory.BLANK_ELEMENT;
80: }
81:
82: }
|