KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > refactoring > ui > tree > XMLRefactoringTreeElement


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-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.refactoring.ui.tree;
21
22 import java.beans.BeanInfo JavaDoc;
23 import java.text.MessageFormat JavaDoc;
24 import java.util.HashMap JavaDoc;
25 import java.util.List JavaDoc;
26 import java.util.Map JavaDoc;
27 import javax.swing.Icon JavaDoc;
28 import javax.swing.ImageIcon JavaDoc;
29
30 import org.netbeans.modules.refactoring.api.RefactoringElement;
31 import org.netbeans.modules.refactoring.spi.ui.TreeElementFactory;
32 import org.netbeans.modules.refactoring.spi.RefactoringElementImplementation;
33 import org.netbeans.modules.refactoring.spi.ui.*;
34 import org.netbeans.modules.xml.nbprefuse.AnalysisConstants;
35 import org.netbeans.modules.xml.refactoring.Usage;
36 import org.netbeans.modules.xml.refactoring.spi.UIHelper;
37 import org.netbeans.modules.xml.refactoring.ui.readers.WhereUsedReader;
38 import org.netbeans.modules.xml.refactoring.ui.util.AnalysisUtilities;
39 import org.netbeans.modules.xml.xam.Component;
40 import org.netbeans.modules.xml.xam.Named;
41 import org.netbeans.modules.xml.xam.Referenceable;
42 import org.openide.nodes.Node;
43 import org.openide.util.NbBundle;
44 import org.openide.util.Utilities;
45
46 /**
47  *
48  * @author Jan Becicka
49  */

50 public class XMLRefactoringTreeElement implements TreeElement {
51     
52     RefactoringElement element;
53     Usage usage;
54     UIHelper uiHelper;
55     Node xmlElementNode;
56        
57     XMLRefactoringTreeElement(RefactoringElement element) {
58         this.element = element;
59         this.usage = (Usage)element.getComposite();
60     }
61     
62     public TreeElement getParent(boolean isLogical) {
63          TreeElement result = null;
64          return TreeElementFactory.getTreeElement(usage.getContainer().getFileObject());
65         
66     }
67                 
68          
69  
70     public Icon JavaDoc getIcon() {
71         //TEMP fix; return dummy icon for BPEL nodes
72
return new ImageIcon JavaDoc(
73             Utilities.loadImage(
74             "org/netbeans/modules/refactoring/api/resources/"+
75             "findusages.png"));
76         
77     }
78
79     public String JavaDoc getText(boolean isLogical) {
80         return "Dummy string for BPEL node";
81         
82        
83        
84     }
85
86     public Object JavaDoc getUserObject() {
87         //return usage;
88
return element;
89     }
90 }
91
Popular Tags