1 19 20 package org.openide.actions; 21 22 import org.openide.filesystems.*; 23 import org.openide.loaders.*; 24 import org.openide.util.actions.CookieAction; 25 import org.openide.nodes.Node; 26 import org.openide.util.HelpCtx; 27 import org.openide.util.NbBundle; 28 29 33 public final class FileSystemRefreshAction extends CookieAction { 34 35 protected Class <?>[] cookieClasses () { 36 return new Class <?>[] {DataFolder.class}; 37 } 38 39 protected void performAction (Node[] nodes) { 40 for (Node n : nodes) { 41 DataFolder df = n.getCookie(DataFolder.class); 42 if (df != null) { 43 FileObject fo = df.getPrimaryFile (); 44 fo.refresh (); 45 } 46 } 47 } 48 49 protected boolean asynchronous() { 50 return false; 51 } 52 53 protected int mode () { 54 return MODE_ALL; 55 } 56 57 public String getName () { 58 return NbBundle.getBundle(DataObject.class).getString("LAB_Refresh"); 59 } 60 61 public HelpCtx getHelpCtx () { 62 return new HelpCtx (FileSystemRefreshAction.class); 63 } 64 65 } 66 | Popular Tags |