1 19 20 package org.netbeans.modules.xml.xam.ui.actions; 21 22 import org.netbeans.modules.xml.xam.Component; 23 import org.netbeans.modules.xml.xam.ui.XAMUtils; 24 import org.netbeans.modules.xml.xam.ui.cookies.ViewComponentCookie; 25 import org.openide.nodes.Node; 26 import org.openide.util.HelpCtx; 27 import org.openide.util.NbBundle; 28 29 35 public abstract class GotoType { 36 37 44 protected Component getComponent(Node node) { 45 return XAMUtils.getComponent(node); 46 } 47 48 53 public HelpCtx getHelpCtx() { 54 return HelpCtx.DEFAULT_HELP; 55 } 56 57 64 public String getName() { 65 return NbBundle.getMessage(GotoType.class, "LBL_GoTo"); 66 } 67 68 73 protected abstract ViewComponentCookie.View getView(); 74 75 80 public void show(Node node) { 81 Component comp = getComponent(node); 82 ViewComponentCookie.View view = getView(); 83 ViewComponentCookie cookie = XAMUtils.getViewCookie(comp, view); 84 if (cookie != null) { 85 cookie.view(view, comp); 86 } 87 } 88 } 89 | Popular Tags |