1 19 20 package org.netbeans.modules.versioning.system.cvss.ui.actions.tag; 21 22 import org.netbeans.modules.versioning.system.cvss.CvsVersioningSystem; 23 import org.netbeans.modules.versioning.system.cvss.FileStatusCache; 24 import org.netbeans.modules.versioning.system.cvss.ExecutorSupport; 25 import org.netbeans.modules.versioning.system.cvss.ClientRuntime; 26 import org.netbeans.lib.cvsclient.command.GlobalOptions; 27 import org.netbeans.lib.cvsclient.command.DefaultFileInfoContainer; 28 import org.netbeans.lib.cvsclient.command.Command; 29 import org.netbeans.lib.cvsclient.command.tag.TagCommand; 30 import org.openide.ErrorManager; 31 import org.openide.util.NbBundle; 32 33 import java.util.*; 34 import java.io.File ; 35 import java.io.IOException ; 36 37 42 public class TagExecutor extends ExecutorSupport { 43 44 55 public static TagExecutor [] splitCommand(TagCommand cmd, CvsVersioningSystem cvs, GlobalOptions options) { 56 Command [] cmds = new org.netbeans.lib.cvsclient.command.Command[0]; 57 if (cmd.getDisplayName() == null) cmd.setDisplayName(NbBundle.getMessage(TagExecutor.class, "MSG_TagExecutor_CmdDisplayName")); 58 try { 59 cmds = prepareBasicCommand(cmd); 60 } catch (IOException e) { 61 ErrorManager.getDefault().notify(e); 62 return null; 63 } 64 TagExecutor [] executors = new TagExecutor[cmds.length]; 65 for (int i = 0; i < cmds.length; i++) { 66 Command command = cmds[i]; 67 executors[i] = new TagExecutor(cvs, (TagCommand) command, options); 68 } 69 return executors; 70 } 71 72 private TagExecutor(CvsVersioningSystem cvs, TagCommand cmd, GlobalOptions options) { 73 super(cvs, cmd, options); 74 } 75 76 protected void commandFinished(ClientRuntime.Result result) { 77 78 Set parents = new HashSet(); 79 for (Iterator i = toRefresh.iterator(); i.hasNext();) { 80 DefaultFileInfoContainer info = (DefaultFileInfoContainer) i.next(); 81 File file = info.getFile(); 82 cache.refreshCached(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); 83 parents.add(file.getParentFile()); 84 } 85 toRefresh.clear(); 86 87 for (Iterator i = parents.iterator(); i.hasNext();) { 88 File dir = (File ) i.next(); 89 cache.refreshCached(dir, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); 90 } 91 } 92 } 93 | Popular Tags |