1 /*2 * The contents of this file are subject to the terms of the Common Development3 * and Distribution License (the License). You may not use this file except in4 * compliance with the License.5 *6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html7 * or http://www.netbeans.org/cddl.txt.8 *9 * When distributing Covered Code, include this CDDL Header Notice in each file10 * and include the License file at http://www.netbeans.org/cddl.txt.11 * If applicable, add the following below the CDDL Header, with the fields12 * 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 Original16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun17 * Microsystems, Inc. All Rights Reserved.18 */19 20 package org.netbeans.modules.xml.refactoring.ui.tree;21 22 import java.beans.BeanInfo ;23 import java.text.MessageFormat ;24 import java.util.HashMap ;25 import java.util.List ;26 import java.util.Map ;27 import javax.swing.Icon ;28 import javax.swing.ImageIcon ;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 Becicka49 */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 getIcon() {71 //TEMP fix; return dummy icon for BPEL nodes72 return new ImageIcon (73 Utilities.loadImage(74 "org/netbeans/modules/refactoring/api/resources/"+75 "findusages.png"));76 77 }78 79 public String getText(boolean isLogical) {80 return "Dummy string for BPEL node";81 82 83 84 }85 86 public Object getUserObject() {87 //return usage;88 return element;89 }90 }91