KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > css > editor > CssCloneableEditor


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * 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 /*
21  * CssCloneableEditor.java
22  *
23  * Created on January 26, 2005, 9:37 PM
24  */

25
26 package org.netbeans.modules.css.editor;
27 import org.netbeans.modules.css.visual.model.CssMetaModel;
28 import org.netbeans.modules.css.visual.model.CssStyleData;
29 import org.openide.loaders.DataObject;
30 import org.openide.nodes.Node;
31 import org.openide.text.CloneableEditor;
32 import org.openide.util.HelpCtx;
33 import org.openide.windows.TopComponent;
34 import org.openide.windows.WindowManager;
35
36 /**
37  * CSS Cloneable Editor TopComponent
38  * @author Winston Prakash
39  * @version 1.0
40  */

41 public class CssCloneableEditor extends CloneableEditor{
42
43     DataObject dataObject = null;
44
45     public CssCloneableEditor() {
46         super();
47     }
48
49     public CssCloneableEditor(CssEditorSupport support) {
50         super(support);
51     }
52
53     public HelpCtx getHelpCtx() {
54         return new HelpCtx("projrave_ui_elements_editors_about_css_editor") ; // NOI18N
55
}
56
57     public void setDataObject(DataObject dObject){
58         if(dataObject == null){
59             dataObject = dObject;
60             CssMetaModel.setDataObject(dataObject);
61         }
62     }
63
64     public void componentOpened(){
65         super.componentOpened();
66         CssMetaModel.setDataObject(dataObject);
67 // TopComponent properties = WindowManager.getDefault().findTopComponent("csspreviewTC"); // NOI18N
68
// if (properties != null) {
69
// properties.open();
70
// properties.requestVisible();
71
// }
72
}
73
74     public void componentActivated(){
75         super.componentActivated();
76         CssMetaModel.setDataObject(dataObject);
77 // TopComponent properties = WindowManager.getDefault().findTopComponent("csspreviewTC"); // NOI18N
78
// if (properties != null) {
79
// properties.requestVisible();
80
// }
81
}
82
83     public void componentClosed(){
84        super.componentClosed();
85        CssMetaModel.removeDataObject(dataObject);
86        dataObject = null;
87     }
88
89     public void setCssStyleData(CssStyleData cssStyleData){
90 // CssSelectorNode cssSelectorNode = new CssSelectorNode(dataObject,cssStyleData);
91
// setActivatedNodes(new Node[]{cssSelectorNode});
92
}
93 }
94
Popular Tags