1 19 20 package org.netbeans.modules.j2ee.weblogic9.ui.nodes; 21 22 23 import java.net.URL ; 24 import org.openide.nodes.Node; 25 import org.openide.util.HelpCtx; 26 import org.openide.util.NbBundle; 27 import org.openide.util.actions.CookieAction; 28 import org.openide.awt.HtmlBrowser.URLDisplayer; 29 30 34 public class ShowAdminToolAction extends CookieAction { 35 36 protected Class [] cookieClasses() { 37 return new Class [] {}; 38 } 39 40 protected int mode() { 41 return MODE_EXACTLY_ONE; 42 } 44 45 protected void performAction(Node[] nodes) { 46 if( (nodes == null) || (nodes.length < 1) ) 47 return ; 48 WLManagerNode node = (WLManagerNode)nodes[0].getLookup().lookup(WLManagerNode.class); 49 if(node != null){ 50 try{ 51 URLDisplayer.getDefault().showURL(new URL (node.getAdminURL())); } 53 catch (Exception e){ 54 return; } 56 } 57 } 58 59 60 61 62 public String getName() { 63 return NbBundle.getMessage(ShowAdminToolAction.class, "LBL_ShowAdminGUIAction"); 64 } 65 66 public HelpCtx getHelpCtx() { 67 return null; } 71 72 protected boolean enable(Node[] nodes) { 73 return true; 74 } 75 76 protected boolean asynchronous() { 77 return false; 78 } 79 80 81 } 82 | Popular Tags |