1 19 20 package org.netbeans.core.actions; 21 22 import org.openide.awt.HtmlBrowser; 23 import org.openide.windows.*; 24 import org.openide.util.HelpCtx; 25 import org.openide.util.NbBundle; 26 import org.openide.util.actions.CallableSystemAction; 27 28 import org.openide.util.Exceptions; 29 30 35 public class HTMLViewAction extends CallableSystemAction { 36 37 public HTMLViewAction() { 38 putValue("noIconInMenu", Boolean.TRUE); } 40 41 protected String iconResource () { 42 return "org/netbeans/core/resources/actions/htmlView.gif"; } 44 45 public void performAction() { 46 org.openide.awt.StatusDisplayer.getDefault().setStatusText( 47 NbBundle.getBundle(HTMLViewAction.class).getString("CTL_OpeningBrowser")); 48 try { 49 HtmlBrowser.URLDisplayer.getDefault().showURL( 50 new java.net.URL (HtmlBrowser.getHomePage () 51 )); 52 } catch (java.net.MalformedURLException e) { 53 String home = HtmlBrowser.getHomePage (); 54 if (!home.startsWith ("http://")) { home = "http://" + home; } 57 try { 58 HtmlBrowser.URLDisplayer.getDefault().showURL( 59 new java.net.URL (home)); 60 } catch (java.net.MalformedURLException e1) { 61 Exceptions.printStackTrace(e1); 62 } 63 } 64 } 65 66 protected boolean asynchronous() { 67 return false; 68 } 69 70 public String getName() { 71 return NbBundle.getBundle(HTMLViewAction.class).getString("HTMLView"); 72 } 73 74 public HelpCtx getHelpCtx() { 75 return new HelpCtx(HTMLViewAction.class); 76 } 77 78 } 79 | Popular Tags |