Index: core/output2/src/org/netbeans/core/output2/NbIO.java
===================================================================
RCS file: /cvs/core/output2/src/org/netbeans/core/output2/NbIO.java,v
--- core/output2/src/org/netbeans/core/output2/NbIO.java 22 Sep 2004 22:22:59 -0000 1.7
+++ core/output2/src/org/netbeans/core/output2/NbIO.java 1 Oct 2004 01:19:42 -0000
@@ -34,7 +34,7 @@
*
* @author Tim Boudreau
*/
-class NbIO implements CallbackInputOutput {
+class NbIO implements org.openide.io.InputOutput {
private Boolean focusTaken = null;
private Boolean closed = null;
@@ -186,7 +186,7 @@
}
private boolean wasReset = false;
- public void reset() {
+ public void doReset() {
if (Controller.log) Controller.log (this + ": reset");
closed = null;
boolean wasReset = true;
@@ -198,6 +198,17 @@
in.reuse();
}
post (this, IOEvent.CMD_RESET, true);
+ }
+
+ public void reset() {
+ if (out != null) {
+ try {
+ out.reset();
+ } catch (IOException ioe) {
+ ErrorManager.getDefault().notify(ioe);
+ out = null;
+ }
+ }
}
private static void post (NbIO io, int command, boolean val) {
Index: core/output2/src/org/netbeans/core/output2/NbWriter.java
===================================================================
RCS file: /cvs/core/output2/src/org/netbeans/core/output2/NbWriter.java,v
--- core/output2/src/org/netbeans/core/output2/NbWriter.java 22 Sep 2004 22:22:59 -0000 1.4
+++ core/output2/src/org/netbeans/core/output2/NbWriter.java 1 Oct 2004 01:19:42 -0000
@@ -71,7 +71,7 @@
if (err != null) {
err.setWrapped((OutWriter) out);
}
- owner.reset();
+ owner.doReset();
}
}
Index: core/output2/src/org/netbeans/core/output2/OutputTab.java
===================================================================
RCS file: /cvs/core/output2/src/org/netbeans/core/output2/OutputTab.java,v
--- core/output2/src/org/netbeans/core/output2/OutputTab.java 23 Sep 2004 01:32:03 -0000 1.8
+++ core/output2/src/org/netbeans/core/output2/OutputTab.java 1 Oct 2004 01:19:43 -0000
@@ -19,6 +19,7 @@
import javax.swing.*;
import javax.swing.text.Document;
import java.awt.*;
+import org.openide.windows.OutputListener;
/**
* A component representing one tab in the output window.
@@ -168,7 +169,7 @@
for (int i=0; i < lines.length; i++) {
try {
String s = out.getLines().getLine(lines[i]);
- if (s.indexOf("[deprecation]") == -1 && s.indexOf("warning") == -1 && s.indexOf("stopped") == -1) {
+ if (isImportantListener (out.getLines().getListenerForLine(lines[i]), s)) {
result = lines[i];
if (Controller.log) Controller.log ("Line to navigate to" +
"is line " + lines[i] + ": " + s);
@@ -183,6 +184,17 @@
}
}
return result;
+ }
+
+ private boolean isImportantListener (OutputListener l, String s) {
+ if (l instanceof org.openide.io.OutputListener) {
+ org.openide.io.OutputListener ol = (org.openide.io.OutputListener) l;
+ return ol.isImportant();
+ } else {
+ //Compatibility with 4.0 - delete?
+ return s.indexOf("[deprecation]") == -1 && //NOI18N
+ s.indexOf("warning") == -1 && s.indexOf("stopped") == -1; //NOI18N
+ }
}
public String toString() {
Index: core/output2/test/unit/src/org/netbeans/core/output2/OutputWindowTest.java
===================================================================
RCS file: /cvs/core/output2/test/unit/src/org/netbeans/core/output2/OutputWindowTest.java,v
--- core/output2/test/unit/src/org/netbeans/core/output2/OutputWindowTest.java 22 Sep 2004 22:23:00 -0000 1.2
+++ core/output2/test/unit/src/org/netbeans/core/output2/OutputWindowTest.java 1 Oct 2004 01:19:43 -0000
@@ -306,7 +306,7 @@
}
//This time we test it using reset(), not programmatically invoking the GUI call to do the same
- io.reset();
+ io.doReset();
sleep();
sleep();
Index: openide/io/src/org/openide/windows/InputOutput.java
===================================================================
RCS file: /cvs/openide/io/src/org/openide/windows/InputOutput.java,v
--- openide/io/src/org/openide/windows/InputOutput.java 4 Aug 2004 00:41:50 -0000 1.7
+++ openide/io/src/org/openide/windows/InputOutput.java 1 Oct 2004 01:20:55 -0000
@@ -35,6 +35,7 @@
*
* @see OutputWriter
* @author Ian Formanek, Jaroslav Tulach, Petr Hamernik, Ales Novak, Jan Jancura
+ * @deprecated - use the extension interface org.openide.io.InputOutput instead
*/
public interface InputOutput {
@@ -119,7 +120,11 @@
/** Set whether the output window should take focus when anything is written to it.
* Note that this really means the output window will steal keyboard
* focus whenever a line of output is written. This is generally an extremely
- * bad idea and strongly recommended against by most UI guidelines.
+ * bad idea and strongly recommended against by most UI guidelines.
+ *
+ * @deprecated - there are more polite ways to request user attention than
+ * stealing keyboard focus - this is almost always wrong from a usability
+ * perspective
* @return true
to take focus
*/
public void setFocusTaken(boolean value);
Index: openide/io/src/org/openide/windows/OutputWriter.java
===================================================================
RCS file: /cvs/openide/io/src/org/openide/windows/OutputWriter.java,v
--- openide/io/src/org/openide/windows/OutputWriter.java 4 Aug 2004 00:41:50 -0000 1.3
+++ openide/io/src/org/openide/windows/OutputWriter.java 1 Oct 2004 01:20:55 -0000
@@ -45,19 +45,11 @@
public abstract void println(String s, OutputListener l) throws IOException;
/** Clear the output pane.
- * Note on the current implementation (core/output2): After calling
- * this method, do not try to use the instance of OutputWriter it was called
- * on again - call IOProvider.getDefault().getIO(name, false).getOut()
to
- * fetch the new writer created as a result of this call. Generally it is
- * preferable not to hold references to either OutputWriter or InputOutput,
- * but rather to fetch them as needed from IOProvider.getDefault()
. This
- * avoids memory leaks and ensures that the instance you're calling is
- * always the one that is actually represented in the UI.
- *
- * Expect this method to be deprecated in a future release and an
- * equivalent created in InputOutput
.
*
* @throws IOException if there is a problem
+ * @deprecated - ambiguous what it means to reset the stderr but not the stdout.
+ * use org.openide.io.InputOutput.reset() (org.openide.IO.inputOutput, not
+ * org.openide.WINDOWS.InputOutput).
*/
public abstract void reset() throws IOException;
}