1 19 package org.netbeans.modules.ruby.rubyproject.execution; 20 21 import java.io.File ; 22 import java.util.ArrayList ; 23 import java.util.List ; 24 25 import org.openide.filesystems.FileObject; 26 27 28 35 public class ExecutionDescriptor { 36 File pwd; 37 File cmd; 38 boolean inputVisible; 39 String displayName; 40 Runnable postBuildAction; 41 FileLocator fileLocator; 42 String [] args; 43 String additionalArgs; 44 String initialArgs; 45 FileObject fileObject; 46 boolean showProgress = true; 47 boolean showSuspended; 48 List <OutputRecognizer> outputRecognizers = new ArrayList <OutputRecognizer>(); 49 50 51 public ExecutionDescriptor() { 52 } 53 54 public ExecutionDescriptor(final String displayName, final File pwd, final String ... args) { 55 this.displayName = displayName; 56 this.pwd = pwd; 57 this.args = args; 58 assert (pwd != null) && pwd.exists() : pwd; 59 } 60 61 public ExecutionDescriptor cmd(final File cmd) { 62 this.cmd = cmd; 63 assert (cmd != null) && cmd.exists() : cmd; 64 65 return this; 66 } 67 68 public ExecutionDescriptor postBuild(Runnable postBuildAction) { 69 this.postBuildAction = postBuildAction; 70 71 return this; 72 } 73 74 public ExecutionDescriptor fileLocator(FileLocator fileLocator) { 75 this.fileLocator = fileLocator; 76 77 return this; 78 } 79 80 84 public ExecutionDescriptor fileObject(FileObject fileObject) { 85 this.fileObject = fileObject; 86 87 return this; 88 } 89 90 public ExecutionDescriptor addOutputRecognizer(OutputRecognizer recognizer) { 91 outputRecognizers.add(recognizer); 92 93 return this; 94 } 95 96 public ExecutionDescriptor allowInput() { 97 this.inputVisible = true; 98 99 return this; 100 } 101 102 public ExecutionDescriptor showProgress(boolean showProgress) { 103 this.showProgress = showProgress; 104 105 return this; 106 } 107 108 public ExecutionDescriptor showSuspended(boolean showSuspended) { 109 this.showSuspended = showSuspended; 110 111 return this; 112 } 113 114 115 public ExecutionDescriptor additionalArgs(String additionalArgs) { 116 this.additionalArgs = additionalArgs; 117 118 return this; 119 } 120 121 122 public ExecutionDescriptor initialArgs(String initialArgs) { 123 this.initialArgs = initialArgs; 124 125 return this; 126 } 127 } 128 | Popular Tags |