1 19 20 package org.netbeans.modules.xml.refactoring.actions; 21 22 import javax.swing.JMenuItem ; 23 import org.netbeans.modules.refactoring.spi.ui.UI; 24 import org.netbeans.modules.xml.refactoring.ui.j.spi.ui.WhereUsedQueryUI; 25 import org.netbeans.modules.xml.refactoring.ui.j.ui.RefactoringPanel; 26 import org.netbeans.modules.xml.refactoring.ui.util.AnalysisUtilities; 27 import org.netbeans.modules.xml.refactoring.ui.views.WhereUsedView; 28 import org.netbeans.modules.xml.xam.Component; 29 import org.netbeans.modules.xml.xam.Named; 30 import org.netbeans.modules.xml.xam.Referenceable; 31 import org.openide.filesystems.FileObject; 32 import org.openide.nodes.Node; 33 import org.openide.text.CloneableEditorSupport; 34 import org.openide.util.HelpCtx; 35 import org.openide.util.NbBundle; 36 import org.openide.util.actions.CookieAction; 37 import org.openide.windows.TopComponent; 38 39 43 public class FindUsagesAction extends CookieAction 44 { 45 static final long serialVersionUID = 1L; 46 47 private static final Class [] COOKIE_ARRAY = 48 new Class [] { }; 49 50 54 public FindUsagesAction() { 55 super(); 56 } 57 58 59 63 public String getName() { 64 return NbBundle.getMessage(FindUsagesAction.class, 65 "LBL_FindUsages"); } 67 68 69 73 public HelpCtx getHelpCtx() { 74 return new HelpCtx(getClass()); 75 } 76 77 78 82 protected boolean asynchronous() { 83 return false; 84 } 85 86 87 91 protected boolean enable(Node[] nodes) { 92 if (nodes.length!=1) 93 return false; 94 95 Referenceable ref = getReferenceable(nodes); 96 return ref instanceof Referenceable; 97 } 98 99 100 104 protected void performAction(Node[] nodes) { 105 assert nodes.length==1: 106 "Length of nodes array should be 1"; 107 Referenceable ref = getReferenceable(nodes); 108 assert ref != null:"The node's NamedReferenceable should not be null"; 109 WhereUsedView wuv = new WhereUsedView(ref); 110 WhereUsedQueryUI ui = new WhereUsedQueryUI(wuv, ref); 111 TopComponent activetc = TopComponent.getRegistry().getActivated(); 112 if (activetc instanceof CloneableEditorSupport.Pane) { 113 } else { 115 } 117 } 118 119 protected Referenceable getReferenceable(Node[] nodes) { 120 return AnalysisUtilities.getReferenceable(nodes); 121 } 122 123 protected int mode() { 124 return CookieAction.MODE_EXACTLY_ONE; 125 } 126 127 128 129 protected Class [] cookieClasses() { 130 return COOKIE_ARRAY; 131 } 132 133 134 135 139 protected JMenuItem menuItem; 140 } 141 | Popular Tags |