1 19 package org.netbeans.modules.xml.catalog; 20 21 import org.openide.nodes.Node; 22 import org.openide.util.HelpCtx; 23 import org.openide.util.actions.CookieAction; 24 import org.openide.awt.StatusDisplayer; 25 26 31 final class RefreshAction extends CookieAction { 32 33 34 private static final long serialVersionUID =4798470042774935554L; 35 36 protected void performAction (Node[] nodes) { 37 if (nodes == null) return; 38 try { 39 for (int i = 0; i<nodes.length; i++) { 40 String msg = Util.THIS.getString("MSG_refreshing", nodes[i].getDisplayName()); 41 StatusDisplayer.getDefault().setStatusText(msg); 42 Refreshable cake = (Refreshable) nodes[i].getCookie(Refreshable.class); 43 cake.refresh(); 44 } 45 } finally { 46 String msg = Util.THIS.getString("MSG_refreshed"); 47 StatusDisplayer.getDefault().setStatusText(msg); 48 } 49 } 50 51 public String getName () { 52 return Util.THIS.getString ("LBL_Action"); 53 } 54 55 protected String iconResource () { 56 return null; 57 } 58 59 public HelpCtx getHelpCtx () { 60 return new HelpCtx(getClass()); 61 } 62 63 protected Class [] cookieClasses() { 64 return new Class [] {Refreshable.class}; 65 } 66 67 protected int mode() { 68 return CookieAction.MODE_ALL; 69 } 70 71 protected boolean asynchronous() { 72 return false; 73 } 74 75 } 76 | Popular Tags |