1 19 20 package org.openide.windows; 21 22 import java.io.InputStreamReader ; 23 import java.io.OutputStreamWriter ; 24 import java.io.Reader ; 25 import org.openide.util.io.NullOutputStream; 26 import org.openide.util.io.NullInputStream; 27 28 44 public interface InputOutput { 45 46 47 48 InputOutput NULL = new InputOutput$Null(); 49 50 54 public OutputWriter getOut(); 55 56 61 public Reader getIn(); 62 63 68 public OutputWriter getErr(); 69 70 73 public void closeInputOutput(); 74 75 81 public boolean isClosed(); 82 83 87 public void setOutputVisible(boolean value); 88 89 93 public void setErrVisible(boolean value); 94 95 98 public void setInputVisible(boolean value); 99 100 103 public void select (); 104 105 109 public boolean isErrSeparated(); 110 111 116 public void setErrSeparated(boolean value); 117 118 122 public boolean isFocusTaken(); 123 124 130 public void setFocusTaken(boolean value); 131 132 137 public Reader flushReader(); 138 139 140 Reader nullReader = new InputStreamReader (new NullInputStream()); 141 142 143 OutputWriter nullWriter = new InputOutput$NullOutputWriter(); 144 145 } 146 147 final class InputOutput$Null extends Object implements InputOutput { 148 public InputOutput$Null () { 149 } 150 151 public OutputWriter getOut() { 152 return nullWriter; 153 } 154 public Reader getIn() { 155 return nullReader; 156 } 157 public OutputWriter getErr() { 158 return nullWriter; 159 } 160 public void closeInputOutput() { 161 } 162 public boolean isClosed() { 163 return true; 164 } 165 public void setOutputVisible(boolean value) { 166 } 167 public void setErrVisible(boolean value) { 168 } 169 public void setInputVisible(boolean value) { 170 } 171 public void select () { 172 } 173 public boolean isErrSeparated() { 174 return false; 175 } 176 public void setErrSeparated(boolean value) { 177 } 178 public boolean isFocusTaken() { 179 return false; 180 } 181 public void setFocusTaken(boolean value) { 182 } 183 public Reader flushReader() { 184 return nullReader; 185 } 186 } 187 188 final class InputOutput$NullOutputWriter extends OutputWriter { 189 InputOutput$NullOutputWriter() { 190 super(new OutputStreamWriter (new NullOutputStream())); 191 } 192 public void reset() { 193 } 194 public void println(String s, OutputListener l) { 195 } 196 } 197 198 | Popular Tags |