This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 43332
Collapse All | Expand All

(-)core/output2/src/org/netbeans/core/output2/NbIO.java (-2 / +13 lines)
Lines 34-40 Link Here
34
 *
34
 *
35
 * @author  Tim Boudreau
35
 * @author  Tim Boudreau
36
 */
36
 */
37
class NbIO implements CallbackInputOutput {
37
class NbIO implements org.openide.io.InputOutput {
38
38
39
    private Boolean focusTaken = null;
39
    private Boolean focusTaken = null;
40
    private Boolean closed = null;
40
    private Boolean closed = null;
Lines 186-192 Link Here
186
    }
186
    }
187
    
187
    
188
    private boolean wasReset = false;
188
    private boolean wasReset = false;
189
    public void reset() {
189
    public void doReset() {
190
        if (Controller.log) Controller.log (this + ": reset");
190
        if (Controller.log) Controller.log (this + ": reset");
191
        closed = null;
191
        closed = null;
192
        boolean wasReset = true;
192
        boolean wasReset = true;
Lines 198-203 Link Here
198
            in.reuse();
198
            in.reuse();
199
        }
199
        }
200
        post (this, IOEvent.CMD_RESET, true);
200
        post (this, IOEvent.CMD_RESET, true);
201
    }
202
    
203
    public void reset() {
204
        if (out != null) {
205
            try {
206
                out.reset();
207
            } catch (IOException ioe) {
208
                ErrorManager.getDefault().notify(ioe);
209
                out = null;
210
            }
211
        }
201
    }
212
    }
202
    
213
    
203
    private static void post (NbIO io, int command, boolean val) {
214
    private static void post (NbIO io, int command, boolean val) {
(-)core/output2/src/org/netbeans/core/output2/NbWriter.java (-1 / +1 lines)
Lines 71-77 Link Here
71
            if (err != null) {
71
            if (err != null) {
72
                err.setWrapped((OutWriter) out);
72
                err.setWrapped((OutWriter) out);
73
            }
73
            }
74
            owner.reset();
74
            owner.doReset();
75
        }
75
        }
76
    }
76
    }
77
77
(-)core/output2/src/org/netbeans/core/output2/OutputTab.java (-1 / +13 lines)
Lines 19-24 Link Here
19
import javax.swing.*;
19
import javax.swing.*;
20
import javax.swing.text.Document;
20
import javax.swing.text.Document;
21
import java.awt.*;
21
import java.awt.*;
22
import org.openide.windows.OutputListener;
22
23
23
/**
24
/**
24
 * A component representing one tab in the output window.
25
 * A component representing one tab in the output window.
Lines 168-174 Link Here
168
            for (int i=0; i < lines.length; i++) {
169
            for (int i=0; i < lines.length; i++) {
169
                try {
170
                try {
170
                    String s = out.getLines().getLine(lines[i]);
171
                    String s = out.getLines().getLine(lines[i]);
171
                    if (s.indexOf("[deprecation]") == -1 && s.indexOf("warning") == -1 && s.indexOf("stopped") == -1) {
172
                    if (isImportantListener (out.getLines().getListenerForLine(lines[i]), s)) {
172
                        result = lines[i];
173
                        result = lines[i];
173
                        if (Controller.log) Controller.log ("Line to navigate to" +
174
                        if (Controller.log) Controller.log ("Line to navigate to" +
174
                            "is line " + lines[i] + ": " + s);
175
                            "is line " + lines[i] + ": " + s);
Lines 183-188 Link Here
183
            }
184
            }
184
        }
185
        }
185
        return result;
186
        return result;
187
    }
188
    
189
    private boolean isImportantListener (OutputListener l, String s) {
190
        if (l instanceof org.openide.io.OutputListener) {
191
            org.openide.io.OutputListener ol = (org.openide.io.OutputListener) l;
192
            return ol.isImportant();
193
        } else {
194
            //Compatibility with 4.0 - delete?
195
            return s.indexOf("[deprecation]") == -1 && //NOI18N
196
                s.indexOf("warning") == -1 && s.indexOf("stopped") == -1; //NOI18N
197
        }
186
    }
198
    }
187
    
199
    
188
    public String toString() {
200
    public String toString() {
(-)core/output2/test/unit/src/org/netbeans/core/output2/OutputWindowTest.java (-1 / +1 lines)
Lines 306-312 Link Here
306
        }
306
        }
307
307
308
        //This time we test it using reset(), not programmatically invoking the GUI call to do the same
308
        //This time we test it using reset(), not programmatically invoking the GUI call to do the same
309
        io.reset();
309
        io.doReset();
310
        sleep();
310
        sleep();
311
        sleep();
311
        sleep();
312
312
(-)openide/io/src/org/openide/windows/InputOutput.java (-1 / +6 lines)
Lines 35-40 Link Here
35
 * 
35
 * 
36
 * @see OutputWriter
36
 * @see OutputWriter
37
 * @author   Ian Formanek, Jaroslav Tulach, Petr Hamernik, Ales Novak, Jan Jancura
37
 * @author   Ian Formanek, Jaroslav Tulach, Petr Hamernik, Ales Novak, Jan Jancura
38
 * @deprecated - use the extension interface org.openide.io.InputOutput instead
38
 */
39
 */
39
public interface InputOutput {
40
public interface InputOutput {
40
41
Lines 119-125 Link Here
119
    /** Set whether the output window should take focus when anything is written to it.
120
    /** Set whether the output window should take focus when anything is written to it.
120
    * <strong>Note that this really means the output window will steal keyboard
121
    * <strong>Note that this really means the output window will steal keyboard
121
    * focus whenever a line of output is written.  This is generally an extremely
122
    * focus whenever a line of output is written.  This is generally an extremely
122
    * bad idea and strongly recommended against by most UI guidelines.</strong> 
123
    * bad idea and strongly recommended against by most UI guidelines.</strong>
124
    *
125
    * @deprecated - there are more polite ways to request user attention than
126
    *  stealing keyboard focus - this is almost always wrong from a usability
127
    *  perspective
123
    * @return <code>true</code> to take focus
128
    * @return <code>true</code> to take focus
124
    */
129
    */
125
    public void setFocusTaken(boolean value);
130
    public void setFocusTaken(boolean value);
(-)openide/io/src/org/openide/windows/OutputWriter.java (-11 / +3 lines)
Lines 45-63 Link Here
45
    public abstract void println(String s, OutputListener l) throws IOException;
45
    public abstract void println(String s, OutputListener l) throws IOException;
46
46
47
    /** Clear the output pane.
47
    /** Clear the output pane.
48
    * <b>Note on the current implementation (core/output2):</b> After calling
49
    * this method, do not try to use the instance of OutputWriter it was called
50
    * on again - call <code>IOProvider.getDefault().getIO(name, false).getOut()</code> to 
51
    * fetch the new writer created as a result of this call.  Generally it is
52
    * preferable not to hold references to either OutputWriter or InputOutput,
53
    * but rather to fetch them as needed from <code>IOProvider.getDefault()</code>.  This
54
    * avoids memory leaks and ensures that the instance you're calling is 
55
    * always the one that is actually represented in the UI.
56
    * <p>
57
    * Expect this method to be deprecated in a future release and an 
58
    * equivalent created in <code>InputOutput</code>.
59
    * 
48
    * 
60
    * @throws IOException if there is a problem
49
    * @throws IOException if there is a problem
50
    * @deprecated - ambiguous what it means to reset the stderr but not the stdout.
51
    *  use org.openide.io.InputOutput.reset() (org.openide.IO.inputOutput, not
52
    * org.openide.WINDOWS.InputOutput).
61
    */
53
    */
62
    public abstract void reset() throws IOException;
54
    public abstract void reset() throws IOException;
63
}
55
}

Return to bug 43332