1 19 20 package org.netbeans.core.execution; 21 22 import java.io.Reader ; 23 import java.io.Writer ; 24 25 import org.openide.windows.InputOutput; 26 27 33 class TaskIO { 34 35 36 static final String VOID = "noname"; 38 39 Writer out; 40 41 Writer err; 42 43 Reader in; 44 45 46 InputOutput inout; 47 48 49 private String name; 50 51 52 boolean foreign; 53 54 TaskIO () { 55 name = VOID; 56 } 57 58 62 TaskIO (InputOutput inout) { 63 this(inout, VOID); 64 } 65 66 70 TaskIO (InputOutput inout, String name) { 71 this.inout = inout; 72 this.name = name; 73 } 74 75 80 TaskIO (InputOutput inout, String name, boolean foreign) { 81 this.inout = inout; 82 this.name = name; 83 this.foreign = foreign; 84 } 85 86 87 void initOut () { 88 if (out == null) { 89 out = inout.getOut(); 90 } 91 } 92 93 94 void initErr() { 95 if (err == null) { 96 err = inout.getErr(); 97 } 98 } 99 100 101 void initIn() { 102 if (in == null) { 103 in = inout.getIn(); 104 } 105 } 106 107 110 String getName() { 111 return name; 112 } 113 114 117 InputOutput getInout() { 118 return inout; 119 } 120 } 121 | Popular Tags |