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 228480
Collapse All | Expand All

(-)a/core.output2/nbproject/project.xml (-1 / +1 lines)
Lines 111-117 Link Here
111
                    <build-prerequisite/>
111
                    <build-prerequisite/>
112
                    <compile-dependency/>
112
                    <compile-dependency/>
113
                    <run-dependency>
113
                    <run-dependency>
114
                        <specification-version>1.33</specification-version>
114
                        <specification-version>1.38</specification-version>
115
                    </run-dependency>
115
                    </run-dependency>
116
                </dependency>
116
                </dependency>
117
                <dependency>
117
                <dependency>
(-)a/core.output2/src/org/netbeans/core/output2/AbstractLines.java (-11 / +14 lines)
Lines 845-851 Link Here
845
            OutputOptions.getDefault().getColorStandard(),
845
            OutputOptions.getDefault().getColorStandard(),
846
            OutputOptions.getDefault().getColorError(),
846
            OutputOptions.getDefault().getColorError(),
847
            OutputOptions.getDefault().getColorLink(),
847
            OutputOptions.getDefault().getColorLink(),
848
            OutputOptions.getDefault().getColorLinkImportant()
848
            OutputOptions.getDefault().getColorLinkImportant(),
849
            OutputOptions.getDefault().getColorInput(),
849
        };
850
        };
850
    }
851
    }
851
852
Lines 862-872 Link Here
862
        if (info != null) {
863
        if (info != null) {
863
            int lineLength = length(line);
864
            int lineLength = length(line);
864
            if (lineLength > info.getEnd()) {
865
            if (lineLength > info.getEnd()) {
865
                info.addSegment(lineLength, false, null, null, null, false);
866
                // This is an input
867
                info.addSegment(lineLength, OutputKind.IN, null, null, null, false);
866
            }
868
            }
867
            return info;
869
            return info;
868
        } else {
870
        } else {
869
            return new LineInfo(this, length(line));
871
            // This is an input by default
872
            return new LineInfo(this, length(line), OutputKind.IN, null, null, null, false);
870
        }
873
        }
871
    }
874
    }
872
875
Lines 1012-1018 Link Here
1012
        return lineStartList.toString();
1015
        return lineStartList.toString();
1013
    }
1016
    }
1014
1017
1015
    private int addSegment(CharSequence s, int offset, int lineIdx, int pos, OutputListener l, boolean important, boolean err, Color c, Color b) {
1018
    private int addSegment(CharSequence s, int offset, int lineIdx, int pos, OutputListener l, boolean important, OutputKind outKind, Color c, Color b) {
1016
        int len = length(lineIdx);
1019
        int len = length(lineIdx);
1017
        if (len > 0) {
1020
        if (len > 0) {
1018
            LineInfo info = (LineInfo) linesToInfos.get(lineIdx);
1021
            LineInfo info = (LineInfo) linesToInfos.get(lineIdx);
Lines 1022-1028 Link Here
1022
            }
1025
            }
1023
            int curEnd = info.getEnd();
1026
            int curEnd = info.getEnd();
1024
            if (pos > 0 && pos != curEnd) {
1027
            if (pos > 0 && pos != curEnd) {
1025
                info.addSegment(pos, false, null, null, null, false);
1028
                info.addSegment(pos, OutputKind.OUT, null, null, null, false);
1026
                curEnd = pos;
1029
                curEnd = pos;
1027
            }
1030
            }
1028
            if (l != null) {
1031
            if (l != null) {
Lines 1045-1059 Link Here
1045
                    }
1048
                    }
1046
                }
1049
                }
1047
                if (leadingCnt > 0) {
1050
                if (leadingCnt > 0) {
1048
                    info.addSegment(curEnd + leadingCnt, false, null, null, null, false);
1051
                    info.addSegment(curEnd + leadingCnt, OutputKind.OUT, null, null, null, false);
1049
                }
1052
                }
1050
                info.addSegment(endPos - trailingCnt, err, l, c, b, important);
1053
                info.addSegment(endPos - trailingCnt, outKind, l, c, b, important);
1051
                if (trailingCnt > 0) {
1054
                if (trailingCnt > 0) {
1052
                    info.addSegment(endPos, false, null, null, null, false);
1055
                    info.addSegment(endPos, OutputKind.OUT, null, null, null, false);
1053
                }
1056
                }
1054
                registerLineWithListener(lineIdx, info, important);
1057
                registerLineWithListener(lineIdx, info, important);
1055
            } else {
1058
            } else {
1056
                info.addSegment(len, err, l, c, b, important);
1059
                info.addSegment(len, outKind, l, c, b, important);
1057
                if (important) {
1060
                if (important) {
1058
                    importantLines.add(lineIdx);
1061
                    importantLines.add(lineIdx);
1059
                }
1062
                }
Lines 1062-1068 Link Here
1062
        return len;
1065
        return len;
1063
    }
1066
    }
1064
1067
1065
    void updateLinesInfo(CharSequence s, int startLine, int startPos, OutputListener l, boolean important, boolean err, Color c, Color b) {
1068
    void updateLinesInfo(CharSequence s, int startLine, int startPos, OutputListener l, boolean important, OutputKind outKind, Color c, Color b) {
1066
        int offset = 0;
1069
        int offset = 0;
1067
        /* If it's necessary to translate tabs to spaces, use this.
1070
        /* If it's necessary to translate tabs to spaces, use this.
1068
         * But it seems that it works fine without the translation. Translation breaks character indexes.
1071
         * But it seems that it works fine without the translation. Translation breaks character indexes.
Lines 1095-1101 Link Here
1095
         */
1098
         */
1096
        int startLinePos = startPos - getLineStart(startLine);
1099
        int startLinePos = startPos - getLineStart(startLine);
1097
        for (int i = startLine; i < getLineCount(); i++) {
1100
        for (int i = startLine; i < getLineCount(); i++) {
1098
            offset += addSegment(s, offset, i, startLinePos, l, important, err, c, b) + 1;
1101
            offset += addSegment(s, offset, i, startLinePos, l, important, outKind, c, b) + 1;
1099
            startLinePos = 0;
1102
            startLinePos = 0;
1100
        }
1103
        }
1101
    }
1104
    }
(-)a/core.output2/src/org/netbeans/core/output2/ErrWriter.java (-2 / +2 lines)
Lines 78-84 Link Here
78
    @Override
78
    @Override
79
    public void println(String s, OutputListener l, boolean important) throws java.io.IOException {
79
    public void println(String s, OutputListener l, boolean important) throws java.io.IOException {
80
        closed = false;
80
        closed = false;
81
        wrapped.print(s, l, important, null, null, true, true);
81
        wrapped.print(s, l, important, null, null, OutputKind.ERR, true);
82
    }
82
    }
83
83
84
    public void reset() throws IOException {
84
    public void reset() throws IOException {
Lines 208-213 Link Here
208
208
209
    private void print(CharSequence s, boolean addLineSep) {
209
    private void print(CharSequence s, boolean addLineSep) {
210
        closed = false;
210
        closed = false;
211
        wrapped.print(s, null, false, null, null, true, addLineSep);
211
        wrapped.print(s, null, false, null, null, OutputKind.ERR, addLineSep);
212
    }
212
    }
213
}
213
}
(-)a/core.output2/src/org/netbeans/core/output2/LineInfo.java (-60 / +30 lines)
Lines 63-85 Link Here
63
    }
63
    }
64
64
65
    LineInfo(Lines parent, int end) {
65
    LineInfo(Lines parent, int end) {
66
        this(parent, end, false, null, null, null, false);
66
        this(parent, end, OutputKind.OUT, null, null, null, false);
67
    }
67
    }
68
68
69
    LineInfo(Lines parent, int end, boolean err, OutputListener l, Color c, Color b, boolean important) {
69
    LineInfo(Lines parent, int end, OutputKind outKind, OutputListener l, Color c, Color b, boolean important) {
70
        this.parent = parent;
70
        this.parent = parent;
71
        addSegment(end, err, l, c, b, important);
71
        addSegment(end, outKind, l, c, b, important);
72
    }
72
    }
73
73
74
    int getEnd() {
74
    int getEnd() {
75
        return segments.isEmpty() ? 0 : segments.get(segments.size() - 1).getEnd();
75
        return segments.isEmpty() ? 0 : segments.get(segments.size() - 1).getEnd();
76
    }
76
    }
77
77
78
    void addSegment(int end, boolean err, OutputListener l, Color c, Color b, boolean important) {
78
    void addSegment(int end, OutputKind outKind, OutputListener l, Color c, Color b, boolean important) {
79
        Segment s = null;
79
        Segment s = null;
80
        if (!segments.isEmpty()) {
80
        if (!segments.isEmpty()) {
81
            s = segments.get(segments.size() - 1);
81
            s = segments.get(segments.size() - 1);
82
            if (s.isErr() == err && s.getListener() == l && hasColors(s, c, b)) {
82
            if (s.getKind() == outKind && s.getListener() == l && hasColors(s, c, b)) {
83
                // the same type of segment, prolong last one
83
                // the same type of segment, prolong last one
84
                s.end = end;
84
                s.end = end;
85
                return;
85
                return;
Lines 88-97 Link Here
88
        boolean isColor = c != null || b != null;
88
        boolean isColor = c != null || b != null;
89
        if (l != null) {
89
        if (l != null) {
90
            s = isColor ? new ColorListenerSegment(end, l, important, c, b) : new ListenerSegment(end, l, important);
90
            s = isColor ? new ColorListenerSegment(end, l, important, c, b) : new ListenerSegment(end, l, important);
91
        } else if (err) {
92
            s = isColor ? new ColorErrSegment(end, c, b) : new ErrSegment(end);
93
        } else {
91
        } else {
94
            s = isColor ? new ColorSegment(end, c, b) : new Segment(end);
92
            s = isColor ? new ColorSegment(end, outKind, c, b) : new Segment(end, outKind);
95
        }
93
        }
96
        segments.add(s);
94
        segments.add(s);
97
    }
95
    }
Lines 191-200 Link Here
191
189
192
    public class Segment {
190
    public class Segment {
193
191
194
        int end;
192
        private int end;
193
        private OutputKind outputKind;
195
194
196
        public Segment(int end) {
195
        Segment(int end, OutputKind outputKind) {
197
            this.end = end;
196
            this.end = end;
197
            this.outputKind = outputKind;
198
        }
198
        }
199
199
200
        int getEnd() {
200
        int getEnd() {
Lines 205-216 Link Here
205
            return null;
205
            return null;
206
        }
206
        }
207
207
208
        boolean isErr() {
208
        OutputKind getKind() {
209
            return false;
209
            return outputKind;
210
        }
210
        }
211
211
212
        Color getColor() {
212
        Color getColor() {
213
            return parent.getDefColor(IOColors.OutputType.OUTPUT);
213
            IOColors.OutputType type;
214
            switch (outputKind) {
215
                case OUT:
216
                    type = IOColors.OutputType.OUTPUT;
217
                    break;
218
                case ERR:
219
                    type = IOColors.OutputType.ERROR;
220
                    break;
221
                case IN:
222
                    type = IOColors.OutputType.INPUT;
223
                    break;
224
                default:
225
                    type = IOColors.OutputType.OUTPUT;
226
            }
227
            return parent.getDefColor(type);
214
        }
228
        }
215
229
216
        Color getCustomColor() {
230
        Color getCustomColor() {
Lines 227-278 Link Here
227
        final Color color;
241
        final Color color;
228
        final Color background;
242
        final Color background;
229
243
230
        public ColorSegment(int end, Color color, Color background) {
244
        public ColorSegment(int end, OutputKind outputKind, Color color, Color background) {
231
            super(end);
245
            super(end, outputKind);
232
            this.color = color == null ? super.getColor() : color;
233
            this.background = background;
234
        }
235
236
        @Override
237
        Color getColor() {
238
            return color;
239
        }
240
241
        @Override
242
        Color getCustomColor() {
243
            return color;
244
        }
245
246
        @Override
247
        Color getCustomBackground() {
248
            return background;
249
        }
250
    }
251
252
    private class ErrSegment extends Segment {
253
254
        public ErrSegment(int end) {
255
            super(end);
256
        }
257
258
        @Override
259
        boolean isErr() {
260
            return true;
261
        }
262
263
        @Override
264
        Color getColor() {
265
            return parent.getDefColor(IOColors.OutputType.ERROR);
266
        }
267
    }
268
269
    private class ColorErrSegment extends ErrSegment {
270
271
        final Color color;
272
        final Color background;
273
274
        public ColorErrSegment(int end, Color color, Color background) {
275
            super(end);
276
            this.color = color == null ? super.getColor() : color;
246
            this.color = color == null ? super.getColor() : color;
277
            this.background = background;
247
            this.background = background;
278
        }
248
        }
Lines 299-305 Link Here
299
        final boolean important;
269
        final boolean important;
300
270
301
        public ListenerSegment(int end, OutputListener l, boolean important) {
271
        public ListenerSegment(int end, OutputListener l, boolean important) {
302
            super(end);
272
            super(end, OutputKind.OUT);
303
            this.listener = l;
273
            this.listener = l;
304
            this.important = important;
274
            this.important = important;
305
        }
275
        }
(-)a/core.output2/src/org/netbeans/core/output2/NbIO.java (-2 / +2 lines)
Lines 512-518 Link Here
512
        protected void println(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
512
        protected void println(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
513
            OutWriter out = out();
513
            OutWriter out = out();
514
            if (out != null) {
514
            if (out != null) {
515
                out.print(text, listener, important, color, null, false, true);
515
                out.print(text, listener, important, color, null, OutputKind.OUT, true);
516
            }
516
            }
517
        }
517
        }
518
    }
518
    }
Lines 523-529 Link Here
523
        protected void print(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
523
        protected void print(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
524
            OutWriter out = out();
524
            OutWriter out = out();
525
            if (out != null) {
525
            if (out != null) {
526
                out.print(text, listener, important, color, null, false, false);
526
                out.print(text, listener, important, color, null, OutputKind.OUT, false);
527
            }
527
            }
528
        }
528
        }
529
    }
529
    }
(-)a/core.output2/src/org/netbeans/core/output2/OutWriter.java (-12 / +13 lines)
Lines 340-347 Link Here
340
340
341
    @Override
341
    @Override
342
    public synchronized void println(String s) {
342
    public synchronized void println(String s) {
343
        doWrite(s, 0, s.length());
343
        print(s, null, false, null, null, OutputKind.OUT, true);
344
        println();
345
    }
344
    }
346
345
347
    @Override
346
    @Override
Lines 414-420 Link Here
414
        }
413
        }
415
        
414
        
416
        // XXX will not pick up ANSI sequences broken across write blocks, but this is likely rare
415
        // XXX will not pick up ANSI sequences broken across write blocks, but this is likely rare
417
        if (printANSI(s.subSequence(off, off + len), false, false, false)) {
416
        if (printANSI(s.subSequence(off, off + len), false, OutputKind.OUT, false)) {
418
            return;
417
            return;
419
        }
418
        }
420
        /* XXX causes stack overflow
419
        /* XXX causes stack overflow
Lines 516-527 Link Here
516
    }
515
    }
517
516
518
    public synchronized void println(String s, OutputListener l, boolean important) {
517
    public synchronized void println(String s, OutputListener l, boolean important) {
519
        print(s, l, important, null, null, false, true);
518
        print(s, l, important, null, null, OutputKind.OUT, true);
520
    }
519
    }
521
520
522
    synchronized void print(CharSequence s, OutputListener l, boolean important, Color c, Color b, boolean err, boolean addLS) {
521
    synchronized void print(CharSequence s, OutputListener l, boolean important, Color c, Color b, OutputKind outKind, boolean addLS) {
523
        if (c == null) {
522
        if (c == null) {
524
            if (l == null && printANSI(s, important, err, addLS)) {
523
            if (l == null && printANSI(s, important, outKind, addLS)) {
525
                return;
524
                return;
526
            }
525
            }
527
            c = ansiColor; // carry over from previous line
526
            c = ansiColor; // carry over from previous line
Lines 532-538 Link Here
532
        if (addLS) {
531
        if (addLS) {
533
            println();
532
            println();
534
        }
533
        }
535
        lines.updateLinesInfo(s, lastLine, lastPos, l, important, err, c, b);
534
        lines.updateLinesInfo(s, lastLine, lastPos, l, important, outKind, c, b);
536
    }
535
    }
537
    private Color ansiColor;
536
    private Color ansiColor;
538
    private Color ansiBackground;
537
    private Color ansiBackground;
Lines 560-566 Link Here
560
        new Color(0, 255, 255),
559
        new Color(0, 255, 255),
561
        new Color(255, 255, 255),
560
        new Color(255, 255, 255),
562
    };
561
    };
563
    private boolean printANSI(CharSequence s, boolean important, boolean err, boolean addLS) { // #192779
562
    private boolean printANSI(CharSequence s, boolean important, OutputKind outKind, boolean addLS) { // #192779
564
        int len = s.length();
563
        int len = s.length();
565
        boolean hasEscape = false; // fast initial check
564
        boolean hasEscape = false; // fast initial check
566
        for (int i = 0; i < len - 1; i++) {
565
        for (int i = 0; i < len - 1; i++) {
Lines 577-583 Link Here
577
        while (m.find()) {
576
        while (m.find()) {
578
            int esc = m.start();
577
            int esc = m.start();
579
            if (esc > text) {
578
            if (esc > text) {
580
                print(s.subSequence(text, esc), null, important, ansiColor, ansiBackground, err, false);
579
                print(s.subSequence(text, esc), null, important, ansiColor, ansiBackground, outKind, false);
581
            }
580
            }
582
            text = m.end();
581
            text = m.end();
583
            if (!"m".equals(m.group(3))) {                              //NOI18N
582
            if (!"m".equals(m.group(3))) {                              //NOI18N
Lines 638-644 Link Here
638
            return false;
637
            return false;
639
        }
638
        }
640
        if (text < len) { // final segment
639
        if (text < len) { // final segment
641
            print(s.subSequence(text, len), null, important, ansiColor, ansiBackground, err, addLS);
640
            print(s.subSequence(text, len), null, important, ansiColor, ansiBackground, outKind, addLS);
642
        } else if (addLS) { // line ended w/ control seq
641
        } else if (addLS) { // line ended w/ control seq
643
            println();
642
            println();
644
        }
643
        }
Lines 646-655 Link Here
646
    }
645
    }
647
646
648
    synchronized void print(CharSequence s, LineInfo info, boolean important) {
647
    synchronized void print(CharSequence s, LineInfo info, boolean important) {
649
        int line = lines.getLineCount() - 1;
650
        doWrite(s, 0, s.length());
651
        if (info != null) {
648
        if (info != null) {
649
            int line = lines.getLineCount() - 1;
650
            doWrite(s, 0, s.length());
652
            lines.addLineInfo(line, info, important);
651
            lines.addLineInfo(line, info, important);
652
        } else {
653
            print(s, null, important, null, null, OutputKind.OUT, false);
653
        }
654
        }
654
    }
655
    }
655
656
(-)0cbde52c1fc3 (+55 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2013 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2013 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.core.output2;
43
44
/**
45
 * The kind of output.
46
 * 
47
 * @author Martin Entlicher
48
 */
49
enum OutputKind {
50
    
51
    OUT,
52
    ERR,
53
    IN
54
    
55
}
(-)a/core.output2/src/org/netbeans/core/output2/OutputTab.java (-2 / +7 lines)
Lines 139-144 Link Here
139
                    opts.getColorStandard());
139
                    opts.getColorStandard());
140
            lines.setDefColor(IOColors.OutputType.ERROR,
140
            lines.setDefColor(IOColors.OutputType.ERROR,
141
                    opts.getColorError());
141
                    opts.getColorError());
142
            lines.setDefColor(IOColors.OutputType.INPUT,
143
                    opts.getColorInput());
142
            lines.setDefColor(IOColors.OutputType.HYPERLINK,
144
            lines.setDefColor(IOColors.OutputType.HYPERLINK,
143
                    opts.getColorLink());
145
                    opts.getColorLink());
144
            lines.setDefColor(IOColors.OutputType.HYPERLINK_IMPORTANT,
146
            lines.setDefColor(IOColors.OutputType.HYPERLINK_IMPORTANT,
Lines 210-223 Link Here
210
        return new OutputPane(this);
212
        return new OutputPane(this);
211
    }
213
    }
212
214
213
    protected void inputSent(String txt) {
215
    public void inputSent(String txt) {
214
        if (Controller.LOG) Controller.log("Input sent on OutputTab: " + txt);
216
        if (Controller.LOG) Controller.log("Input sent on OutputTab: " + txt);
215
        getOutputPane().lockScroll();
217
        getOutputPane().lockScroll();
216
        NbIO.IOReader in = io.in();
218
        NbIO.IOReader in = io.in();
217
        if (in != null) {
219
        if (in != null) {
218
            if (Controller.LOG) Controller.log("Sending input to " + in);
220
            if (Controller.LOG) Controller.log("Sending input to " + in);
219
            in.pushText(txt + "\n");
221
            in.pushText(txt + "\n");
220
            outWriter.println(txt);
222
            outWriter.print(txt, null, false, null, null, OutputKind.IN, true);
221
        }
223
        }
222
    }
224
    }
223
225
Lines 771-776 Link Here
771
        } else if (OutputOptions.PROP_COLOR_ERROR.equals(pn)) {
773
        } else if (OutputOptions.PROP_COLOR_ERROR.equals(pn)) {
772
            lines.setDefColor(IOColors.OutputType.ERROR,
774
            lines.setDefColor(IOColors.OutputType.ERROR,
773
                    opts.getColorError());
775
                    opts.getColorError());
776
        } else if (OutputOptions.PROP_COLOR_INPUT.equals(pn)) {
777
            lines.setDefColor(IOColors.OutputType.INPUT,
778
                    opts.getColorInput());
774
        } else if (OutputOptions.PROP_COLOR_LINK.equals(pn)) {
779
        } else if (OutputOptions.PROP_COLOR_LINK.equals(pn)) {
775
            lines.setDefColor(IOColors.OutputType.HYPERLINK,
780
            lines.setDefColor(IOColors.OutputType.HYPERLINK,
776
                    opts.getColorLink());
781
                    opts.getColorLink());
(-)a/core.output2/src/org/netbeans/core/output2/options/Bundle.properties (+2 lines)
Lines 20-22 Link Here
20
OutputSettingsPanel.cmbImportantLinkColor.toolTipText=Select important link foreground color
20
OutputSettingsPanel.cmbImportantLinkColor.toolTipText=Select important link foreground color
21
OutputSettingsPanel.cmbLinkStyle.toolTipText=Select link style
21
OutputSettingsPanel.cmbLinkStyle.toolTipText=Select link style
22
OutputSettingsPanel.lblUnwrappedOnly.text=(Does not apply to wrapped text)
22
OutputSettingsPanel.lblUnwrappedOnly.text=(Does not apply to wrapped text)
23
OutputSettingsPanel.lblInputColor.text=&Input Color
24
OutputSettingsPanel.cmbInputColor.toolTipText=Select input text foreground color
(-)a/core.output2/src/org/netbeans/core/output2/options/OutputOptions.java (+33 lines)
Lines 82-87 Link Here
82
    private static final String PROP_FONT_STYLE = "font.style";         //NOI18N
82
    private static final String PROP_FONT_STYLE = "font.style";         //NOI18N
83
    public static final String PROP_COLOR_STANDARD = "color.standard";  //NOI18N
83
    public static final String PROP_COLOR_STANDARD = "color.standard";  //NOI18N
84
    public static final String PROP_COLOR_ERROR = "color.error";        //NOI18N
84
    public static final String PROP_COLOR_ERROR = "color.error";        //NOI18N
85
    public static final String PROP_COLOR_INPUT = "color.input";        //NOI18N
85
    public static final String PROP_COLOR_LINK = "color.link";          //NOI18N
86
    public static final String PROP_COLOR_LINK = "color.link";          //NOI18N
86
    public static final String PROP_COLOR_LINK_IMPORTANT =
87
    public static final String PROP_COLOR_LINK_IMPORTANT =
87
            "color.link.important";                                     //NOI18N
88
            "color.link.important";                                     //NOI18N
Lines 97-102 Link Here
97
    private Font fontWrapped = null; // font for wrapped mode
98
    private Font fontWrapped = null; // font for wrapped mode
98
    private Color colorStandard;
99
    private Color colorStandard;
99
    private Color colorError;
100
    private Color colorError;
101
    private Color colorInput;
100
    private Color colorLink;
102
    private Color colorLink;
101
    private Color colorLinkImportant;
103
    private Color colorLinkImportant;
102
    private Color colorBackground;
104
    private Color colorBackground;
Lines 143-148 Link Here
143
        int rgbError = preferences.getInt(PREFIX + PROP_COLOR_ERROR,
145
        int rgbError = preferences.getInt(PREFIX + PROP_COLOR_ERROR,
144
                getDefaultColorError().getRGB());
146
                getDefaultColorError().getRGB());
145
        diskData.setColorError(new Color(rgbError));
147
        diskData.setColorError(new Color(rgbError));
148
        int rgbInput = preferences.getInt(PREFIX + PROP_COLOR_INPUT,
149
                getDefaultColorInput().getRGB());
150
        diskData.setColorInput(new Color(rgbInput));
146
        int rgbBackground = preferences.getInt(PREFIX + PROP_COLOR_BACKGROUND,
151
        int rgbBackground = preferences.getInt(PREFIX + PROP_COLOR_BACKGROUND,
147
                getDefaultColorBackground().getRGB());
152
                getDefaultColorBackground().getRGB());
148
        diskData.setColorBackground(new Color(rgbBackground));
153
        diskData.setColorBackground(new Color(rgbBackground));
Lines 178-183 Link Here
178
                getColorStandard().getRGB());
183
                getColorStandard().getRGB());
179
        preferences.putInt(PREFIX + PROP_COLOR_ERROR,
184
        preferences.putInt(PREFIX + PROP_COLOR_ERROR,
180
                getColorError().getRGB());
185
                getColorError().getRGB());
186
        preferences.putInt(PREFIX + PROP_COLOR_INPUT,
187
                getColorInput().getRGB());
181
        preferences.putInt(PREFIX + PROP_COLOR_BACKGROUND,
188
        preferences.putInt(PREFIX + PROP_COLOR_BACKGROUND,
182
                getColorBackground().getRGB());
189
                getColorBackground().getRGB());
183
        preferences.putInt(PREFIX + PROP_COLOR_LINK,
190
        preferences.putInt(PREFIX + PROP_COLOR_LINK,
Lines 200-205 Link Here
200
    private void setDefaultColors() {
207
    private void setDefaultColors() {
201
        setColorStandard(getDefaultColorStandard());
208
        setColorStandard(getDefaultColorStandard());
202
        setColorError(getDefaultColorError());
209
        setColorError(getDefaultColorError());
210
        setColorInput(getDefaultColorInput());
203
        setColorLink(getDefaultColorLink());
211
        setColorLink(getDefaultColorLink());
204
        setColorLinkImportant(getDefaultColorLinkImportant());
212
        setColorLinkImportant(getDefaultColorLinkImportant());
205
        setColorBackground(getDefaultColorBackground());
213
        setColorBackground(getDefaultColorBackground());
Lines 250-255 Link Here
250
        return colorError;
258
        return colorError;
251
    }
259
    }
252
260
261
    public Color getColorInput() {
262
        return colorInput;
263
    }
264
253
    public Color getColorLink() {
265
    public Color getColorLink() {
254
        return colorLink;
266
        return colorLink;
255
    }
267
    }
Lines 358-363 Link Here
358
        }
370
        }
359
    }
371
    }
360
372
373
    public void setColorInput(Color colorInput) {
374
        Parameters.notNull("colorError", colorInput);                   //NOI18N
375
        if (!colorInput.equals(this.colorInput)) {
376
            Color oldColorInput = this.colorInput;
377
            this.colorInput = colorInput;
378
            pcs.firePropertyChange(PROP_COLOR_INPUT, oldColorInput, colorInput);
379
        }
380
    }
381
361
    public void setColorLink(Color colorLink) {
382
    public void setColorLink(Color colorLink) {
362
        Parameters.notNull("colorLink", colorLink);                     //NOI18N
383
        Parameters.notNull("colorLink", colorLink);                     //NOI18N
363
        if (!colorLink.equals(this.colorLink)) {
384
        if (!colorLink.equals(this.colorLink)) {
Lines 423-428 Link Here
423
        copy.fontWrapped = fontWrapped;
444
        copy.fontWrapped = fontWrapped;
424
        copy.colorStandard = this.colorStandard;
445
        copy.colorStandard = this.colorStandard;
425
        copy.colorError = this.colorError;
446
        copy.colorError = this.colorError;
447
        copy.colorInput = this.colorInput;
426
        copy.colorBackground = this.colorBackground;
448
        copy.colorBackground = this.colorBackground;
427
        copy.colorLink = this.colorLink;
449
        copy.colorLink = this.colorLink;
428
        copy.colorLinkImportant = this.colorLinkImportant;
450
        copy.colorLinkImportant = this.colorLinkImportant;
Lines 454-459 Link Here
454
        this.setFontForWrappedMode(outputOptions.getFontForWrappedMode());
476
        this.setFontForWrappedMode(outputOptions.getFontForWrappedMode());
455
        this.setColorStandard(outputOptions.getColorStandard());
477
        this.setColorStandard(outputOptions.getColorStandard());
456
        this.setColorError(outputOptions.getColorError());
478
        this.setColorError(outputOptions.getColorError());
479
        this.setColorInput(outputOptions.getColorInput());
457
        this.setColorLink(outputOptions.getColorLink());
480
        this.setColorLink(outputOptions.getColorLink());
458
        this.setColorLinkImportant(outputOptions.getColorLinkImportant());
481
        this.setColorLinkImportant(outputOptions.getColorLinkImportant());
459
        this.setColorBackground(outputOptions.getColorBackground());
482
        this.setColorBackground(outputOptions.getColorBackground());
Lines 493-498 Link Here
493
        return err;
516
        return err;
494
    }
517
    }
495
518
519
    static Color getDefaultColorInput() {
520
        Color input = UIManager.getColor("nb.output.input");            //NOI18N
521
        if (input == null) {
522
            input = getDefaultColorStandard();
523
        }
524
        return input;
525
    }
526
496
    static Color getDefaultColorLink() {
527
    static Color getDefaultColorLink() {
497
        Color hyperlink = UIManager.getColor(
528
        Color hyperlink = UIManager.getColor(
498
                "nb.output.link.foreground");                           //NOI18N
529
                "nb.output.link.foreground");                           //NOI18N
Lines 518-523 Link Here
518
                return getColorStandard();
549
                return getColorStandard();
519
            case ERROR:
550
            case ERROR:
520
                return getColorError();
551
                return getColorError();
552
            case INPUT:
553
                return getColorInput();
521
            case HYPERLINK:
554
            case HYPERLINK:
522
                return getColorLink();
555
                return getColorLink();
523
            case HYPERLINK_IMPORTANT:
556
            case HYPERLINK_IMPORTANT:
(-)a/core.output2/src/org/netbeans/core/output2/options/OutputSettingsPanel.form (-4 / +34 lines)
Lines 25-31 Link Here
25
                          <Component id="jPanel2" max="32767" attributes="0"/>
25
                          <Component id="jPanel2" max="32767" attributes="0"/>
26
                          <Group type="102" alignment="1" attributes="0">
26
                          <Group type="102" alignment="1" attributes="0">
27
                              <Component id="lblTitle" min="-2" max="-2" attributes="0"/>
27
                              <Component id="lblTitle" min="-2" max="-2" attributes="0"/>
28
                              <EmptySpace pref="103" max="32767" attributes="0"/>
28
                              <EmptySpace max="32767" attributes="0"/>
29
                              <Component id="btnRestore" min="-2" max="-2" attributes="0"/>
29
                              <Component id="btnRestore" min="-2" max="-2" attributes="0"/>
30
                          </Group>
30
                          </Group>
31
                      </Group>
31
                      </Group>
Lines 46-52 Link Here
46
              <EmptySpace max="-2" attributes="0"/>
46
              <EmptySpace max="-2" attributes="0"/>
47
              <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
47
              <Component id="jPanel2" min="-2" max="-2" attributes="0"/>
48
              <EmptySpace max="-2" attributes="0"/>
48
              <EmptySpace max="-2" attributes="0"/>
49
              <Component id="previewPanel" pref="81" max="32767" attributes="0"/>
49
              <Component id="previewPanel" pref="51" max="32767" attributes="0"/>
50
              <EmptySpace max="-2" attributes="0"/>
50
              <EmptySpace max="-2" attributes="0"/>
51
          </Group>
51
          </Group>
52
      </Group>
52
      </Group>
Lines 76-81 Link Here
76
                      <Component id="lblFontSize" alignment="0" min="-2" max="-2" attributes="0"/>
76
                      <Component id="lblFontSize" alignment="0" min="-2" max="-2" attributes="0"/>
77
                      <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
77
                      <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
78
                      <Component id="lblLinkStyle" alignment="0" min="-2" max="-2" attributes="0"/>
78
                      <Component id="lblLinkStyle" alignment="0" min="-2" max="-2" attributes="0"/>
79
                      <Component id="lblInputColor" alignment="0" min="-2" max="-2" attributes="0"/>
79
                  </Group>
80
                  </Group>
80
                  <EmptySpace type="separate" max="-2" attributes="0"/>
81
                  <EmptySpace type="separate" max="-2" attributes="0"/>
81
                  <Group type="103" groupAlignment="0" attributes="0">
82
                  <Group type="103" groupAlignment="0" attributes="0">
Lines 84-97 Link Here
84
                          <EmptySpace max="-2" attributes="0"/>
85
                          <EmptySpace max="-2" attributes="0"/>
85
                          <Component id="btnSelectFont" min="-2" max="-2" attributes="0"/>
86
                          <Component id="btnSelectFont" min="-2" max="-2" attributes="0"/>
86
                      </Group>
87
                      </Group>
87
                      <Component id="lblUnwrappedOnly" alignment="0" min="-2" max="-2" attributes="0"/>
88
                      <Component id="lblUnwrappedOnly" alignment="0" max="32767" attributes="0"/>
88
                      <Component id="spnFontSize" alignment="0" min="-2" pref="71" max="-2" attributes="0"/>
89
                      <Group type="102" alignment="0" attributes="0">
90
                          <Component id="spnFontSize" min="-2" pref="71" max="-2" attributes="0"/>
91
                          <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
92
                      </Group>
89
                      <Component id="cmbBackgroundColor" alignment="0" max="32767" attributes="0"/>
93
                      <Component id="cmbBackgroundColor" alignment="0" max="32767" attributes="0"/>
90
                      <Component id="cmbStandardColor" alignment="0" max="32767" attributes="0"/>
94
                      <Component id="cmbStandardColor" alignment="0" max="32767" attributes="0"/>
91
                      <Component id="cmbErrorColor" alignment="0" max="32767" attributes="0"/>
95
                      <Component id="cmbErrorColor" alignment="0" max="32767" attributes="0"/>
92
                      <Component id="cmbLinkColor" alignment="0" max="32767" attributes="0"/>
96
                      <Component id="cmbLinkColor" alignment="0" max="32767" attributes="0"/>
93
                      <Component id="cmbImportantLinkColor" alignment="0" max="32767" attributes="0"/>
97
                      <Component id="cmbImportantLinkColor" alignment="0" max="32767" attributes="0"/>
94
                      <Component id="cmbLinkStyle" alignment="0" max="32767" attributes="0"/>
98
                      <Component id="cmbLinkStyle" alignment="0" max="32767" attributes="0"/>
99
                      <Component id="cmbInputColor" max="32767" attributes="0"/>
95
                  </Group>
100
                  </Group>
96
                  <EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
101
                  <EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
97
              </Group>
102
              </Group>
Lines 130-135 Link Here
130
                  </Group>
135
                  </Group>
131
                  <EmptySpace max="-2" attributes="0"/>
136
                  <EmptySpace max="-2" attributes="0"/>
132
                  <Group type="103" groupAlignment="3" attributes="0">
137
                  <Group type="103" groupAlignment="3" attributes="0">
138
                      <Component id="lblInputColor" alignment="3" min="-2" max="-2" attributes="0"/>
139
                      <Component id="cmbInputColor" alignment="3" min="-2" max="-2" attributes="0"/>
140
                  </Group>
141
                  <EmptySpace max="-2" attributes="0"/>
142
                  <Group type="103" groupAlignment="3" attributes="0">
133
                      <Component id="lblLinkColor" alignment="3" min="-2" max="-2" attributes="0"/>
143
                      <Component id="lblLinkColor" alignment="3" min="-2" max="-2" attributes="0"/>
134
                      <Component id="cmbLinkColor" alignment="3" min="-2" max="-2" attributes="0"/>
144
                      <Component id="cmbLinkColor" alignment="3" min="-2" max="-2" attributes="0"/>
135
                  </Group>
145
                  </Group>
Lines 363-368 Link Here
363
            </Property>
373
            </Property>
364
          </Properties>
374
          </Properties>
365
        </Component>
375
        </Component>
376
        <Component class="javax.swing.JLabel" name="lblInputColor">
377
          <Properties>
378
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
379
              <ResourceString bundle="org/netbeans/core/output2/options/Bundle.properties" key="OutputSettingsPanel.lblInputColor.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
380
            </Property>
381
          </Properties>
382
        </Component>
383
        <Component class="javax.swing.JComboBox" name="cmbInputColor">
384
          <Properties>
385
            <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
386
              <ResourceString bundle="org/netbeans/core/output2/options/Bundle.properties" key="OutputSettingsPanel.cmbInputColor.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
387
            </Property>
388
          </Properties>
389
          <Events>
390
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmbInputColorActionPerformed"/>
391
          </Events>
392
          <AuxValues>
393
            <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new ColorComboBox()"/>
394
          </AuxValues>
395
        </Component>
366
      </SubComponents>
396
      </SubComponents>
367
    </Container>
397
    </Container>
368
    <Container class="javax.swing.JPanel" name="previewPanel">
398
    <Container class="javax.swing.JPanel" name="previewPanel">
(-)a/core.output2/src/org/netbeans/core/output2/options/OutputSettingsPanel.java (-7 / +52 lines)
Lines 49-56 Link Here
49
import java.beans.PropertyEditor;
49
import java.beans.PropertyEditor;
50
import java.beans.PropertyEditorManager;
50
import java.beans.PropertyEditorManager;
51
import java.io.IOException;
51
import java.io.IOException;
52
import java.io.Reader;
52
import javax.swing.Action;
53
import javax.swing.Action;
53
import javax.swing.JComboBox;
54
import javax.swing.JComboBox;
55
import javax.swing.SwingUtilities;
54
import org.netbeans.api.options.OptionsDisplayer;
56
import org.netbeans.api.options.OptionsDisplayer;
55
import org.netbeans.core.output2.Controller;
57
import org.netbeans.core.output2.Controller;
56
import org.netbeans.core.output2.NbIOProvider;
58
import org.netbeans.core.output2.NbIOProvider;
Lines 119-124 Link Here
119
        cmbImportantLinkColor = new ColorComboBox();
121
        cmbImportantLinkColor = new ColorComboBox();
120
        jLabel1 = new javax.swing.JLabel();
122
        jLabel1 = new javax.swing.JLabel();
121
        lblUnwrappedOnly = new javax.swing.JLabel();
123
        lblUnwrappedOnly = new javax.swing.JLabel();
124
        lblInputColor = new javax.swing.JLabel();
125
        cmbInputColor = new ColorComboBox();
122
        previewPanel = new javax.swing.JPanel();
126
        previewPanel = new javax.swing.JPanel();
123
        btnRestore = new javax.swing.JButton();
127
        btnRestore = new javax.swing.JButton();
124
128
Lines 212-217 Link Here
212
216
213
        org.openide.awt.Mnemonics.setLocalizedText(lblUnwrappedOnly, org.openide.util.NbBundle.getMessage(OutputSettingsPanel.class, "OutputSettingsPanel.lblUnwrappedOnly.text")); // NOI18N
217
        org.openide.awt.Mnemonics.setLocalizedText(lblUnwrappedOnly, org.openide.util.NbBundle.getMessage(OutputSettingsPanel.class, "OutputSettingsPanel.lblUnwrappedOnly.text")); // NOI18N
214
218
219
        org.openide.awt.Mnemonics.setLocalizedText(lblInputColor, org.openide.util.NbBundle.getMessage(OutputSettingsPanel.class, "OutputSettingsPanel.lblInputColor.text")); // NOI18N
220
221
        cmbInputColor.setToolTipText(org.openide.util.NbBundle.getMessage(OutputSettingsPanel.class, "OutputSettingsPanel.cmbInputColor.toolTipText")); // NOI18N
222
        cmbInputColor.addActionListener(new java.awt.event.ActionListener() {
223
            public void actionPerformed(java.awt.event.ActionEvent evt) {
224
                cmbInputColorActionPerformed(evt);
225
            }
226
        });
227
215
        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
228
        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
216
        jPanel2.setLayout(jPanel2Layout);
229
        jPanel2.setLayout(jPanel2Layout);
217
        jPanel2Layout.setHorizontalGroup(
230
        jPanel2Layout.setHorizontalGroup(
Lines 226-246 Link Here
226
                    .addComponent(lblBackgroundColor)
239
                    .addComponent(lblBackgroundColor)
227
                    .addComponent(lblFontSize)
240
                    .addComponent(lblFontSize)
228
                    .addComponent(jLabel1)
241
                    .addComponent(jLabel1)
229
                    .addComponent(lblLinkStyle))
242
                    .addComponent(lblLinkStyle)
243
                    .addComponent(lblInputColor))
230
                .addGap(18, 18, 18)
244
                .addGap(18, 18, 18)
231
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
245
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
232
                    .addGroup(jPanel2Layout.createSequentialGroup()
246
                    .addGroup(jPanel2Layout.createSequentialGroup()
233
                        .addComponent(fldFontFamily)
247
                        .addComponent(fldFontFamily)
234
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
248
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
235
                        .addComponent(btnSelectFont))
249
                        .addComponent(btnSelectFont))
236
                    .addComponent(lblUnwrappedOnly)
250
                    .addComponent(lblUnwrappedOnly, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
237
                    .addComponent(spnFontSize, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
251
                    .addGroup(jPanel2Layout.createSequentialGroup()
252
                        .addComponent(spnFontSize, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
253
                        .addGap(0, 0, Short.MAX_VALUE))
238
                    .addComponent(cmbBackgroundColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
254
                    .addComponent(cmbBackgroundColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
239
                    .addComponent(cmbStandardColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
255
                    .addComponent(cmbStandardColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
240
                    .addComponent(cmbErrorColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
256
                    .addComponent(cmbErrorColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
241
                    .addComponent(cmbLinkColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
257
                    .addComponent(cmbLinkColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
242
                    .addComponent(cmbImportantLinkColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
258
                    .addComponent(cmbImportantLinkColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
243
                    .addComponent(cmbLinkStyle, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
259
                    .addComponent(cmbLinkStyle, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
260
                    .addComponent(cmbInputColor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
244
                .addGap(1, 1, 1))
261
                .addGap(1, 1, 1))
245
        );
262
        );
246
        jPanel2Layout.setVerticalGroup(
263
        jPanel2Layout.setVerticalGroup(
Lines 271-276 Link Here
271
                    .addComponent(lblErrorColor))
288
                    .addComponent(lblErrorColor))
272
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
289
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
273
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
290
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
291
                    .addComponent(lblInputColor)
292
                    .addComponent(cmbInputColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
293
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
294
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
274
                    .addComponent(lblLinkColor)
295
                    .addComponent(lblLinkColor)
275
                    .addComponent(cmbLinkColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
296
                    .addComponent(cmbLinkColor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
276
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
297
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
Lines 308-314 Link Here
308
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
329
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
309
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
330
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
310
                                .addComponent(lblTitle)
331
                                .addComponent(lblTitle)
311
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 103, Short.MAX_VALUE)
332
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
312
                                .addComponent(btnRestore)))
333
                                .addComponent(btnRestore)))
313
                        .addContainerGap())))
334
                        .addContainerGap())))
314
        );
335
        );
Lines 322-328 Link Here
322
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
343
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
323
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
344
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
324
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
345
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
325
                .addComponent(previewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)
346
                .addComponent(previewPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
326
                .addContainerGap())
347
                .addContainerGap())
327
        );
348
        );
328
    }// </editor-fold>//GEN-END:initComponents
349
    }// </editor-fold>//GEN-END:initComponents
Lines 401-406 Link Here
401
        outputOptions.setLinkStyle(linkStyleModel.getLinkStyle());
422
        outputOptions.setLinkStyle(linkStyleModel.getLinkStyle());
402
    }//GEN-LAST:event_cmbLinkStyleActionPerformed
423
    }//GEN-LAST:event_cmbLinkStyleActionPerformed
403
424
425
    private void cmbInputColorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmbInputColorActionPerformed
426
        Color input = ((ColorComboBox) cmbInputColor).getSelectedColor();
427
        if (input != null) {
428
            outputOptions.setColorInput(input);
429
        }
430
    }//GEN-LAST:event_cmbInputColorActionPerformed
431
404
    void load() {
432
    void load() {
405
        if (previewInputOutput == null) {
433
        if (previewInputOutput == null) {
406
            initPreview();
434
            initPreview();
Lines 439-444 Link Here
439
    private javax.swing.JComboBox cmbBackgroundColor;
467
    private javax.swing.JComboBox cmbBackgroundColor;
440
    private javax.swing.JComboBox cmbErrorColor;
468
    private javax.swing.JComboBox cmbErrorColor;
441
    private javax.swing.JComboBox cmbImportantLinkColor;
469
    private javax.swing.JComboBox cmbImportantLinkColor;
470
    private javax.swing.JComboBox cmbInputColor;
442
    private javax.swing.JComboBox cmbLinkColor;
471
    private javax.swing.JComboBox cmbLinkColor;
443
    private javax.swing.JComboBox cmbLinkStyle;
472
    private javax.swing.JComboBox cmbLinkStyle;
444
    private javax.swing.JComboBox cmbStandardColor;
473
    private javax.swing.JComboBox cmbStandardColor;
Lines 449-454 Link Here
449
    private javax.swing.JLabel lblErrorColor;
478
    private javax.swing.JLabel lblErrorColor;
450
    private javax.swing.JLabel lblFontFamily;
479
    private javax.swing.JLabel lblFontFamily;
451
    private javax.swing.JLabel lblFontSize;
480
    private javax.swing.JLabel lblFontSize;
481
    private javax.swing.JLabel lblInputColor;
452
    private javax.swing.JLabel lblLinkColor;
482
    private javax.swing.JLabel lblLinkColor;
453
    private javax.swing.JLabel lblLinkStyle;
483
    private javax.swing.JLabel lblLinkStyle;
454
    private javax.swing.JLabel lblStandardColor;
484
    private javax.swing.JLabel lblStandardColor;
Lines 462-467 Link Here
462
        previewInputOutput = initPreviewInputOutput();
492
        previewInputOutput = initPreviewInputOutput();
463
        outputOptions = ((Lookup.Provider) previewInputOutput).
493
        outputOptions = ((Lookup.Provider) previewInputOutput).
464
                getLookup().lookup(OutputOptions.class);
494
                getLookup().lookup(OutputOptions.class);
495
        final Reader in = previewInputOutput.getIn();
496
        previewInputOutput.setInputVisible(true); // Instead of reading from in.
465
        previewInputOutput.getOut().println("Standard Output");         //NOI18N
497
        previewInputOutput.getOut().println("Standard Output");         //NOI18N
466
        previewInputOutput.getErr().println("Error Output");            //NOI18N
498
        previewInputOutput.getErr().println("Error Output");            //NOI18N
467
        OutputListener ol = new OutputListenerImpl();
499
        OutputListener ol = new OutputListenerImpl();
Lines 471-477 Link Here
471
            previewInputOutput.getOut().println();
503
            previewInputOutput.getOut().println();
472
            IOColorPrint.print(previewInputOutput, "Important Link", //NOI18N
504
            IOColorPrint.print(previewInputOutput, "Important Link", //NOI18N
473
                    ol, true, null);
505
                    ol, true, null);
474
            previewInputOutput.getOut().print(" ");                     //NOI18N
506
            previewInputOutput.getOut().println();
475
        } catch (IOException ex) {
507
        } catch (IOException ex) {
476
            ex.printStackTrace(previewInputOutput.getErr());
508
            ex.printStackTrace(previewInputOutput.getErr());
477
        }
509
        }
Lines 484-489 Link Here
484
                updateControlsByModel();
516
                updateControlsByModel();
485
            }
517
            }
486
        });
518
        });
519
        SwingUtilities.invokeLater(new Runnable() {
520
            @Override
521
            public void run() {
522
                Component component = previewPanel.getComponent(0);
523
                if (component instanceof AbstractOutputTab) {
524
                    ((AbstractOutputTab) component).inputSent("Input from keyboard");
525
                }
526
                try {
527
                    in.close();
528
                } catch (IOException ex) {}
529
            }
530
        });
487
    }
531
    }
488
532
489
    private InputOutput initPreviewInputOutput() throws NullPointerException {
533
    private InputOutput initPreviewInputOutput() throws NullPointerException {
Lines 503-508 Link Here
503
        spnFontSize.setValue(outputOptions.getFont().getSize());
547
        spnFontSize.setValue(outputOptions.getFont().getSize());
504
        selectColor(cmbStandardColor, outputOptions.getColorStandard());
548
        selectColor(cmbStandardColor, outputOptions.getColorStandard());
505
        selectColor(cmbErrorColor, outputOptions.getColorError());
549
        selectColor(cmbErrorColor, outputOptions.getColorError());
550
        selectColor(cmbInputColor, outputOptions.getColorInput());
506
        selectColor(cmbBackgroundColor, outputOptions.getColorBackground());
551
        selectColor(cmbBackgroundColor, outputOptions.getColorBackground());
507
        selectColor(cmbLinkColor, outputOptions.getColorLink());
552
        selectColor(cmbLinkColor, outputOptions.getColorLink());
508
        selectColor(cmbImportantLinkColor,
553
        selectColor(cmbImportantLinkColor,
(-)a/core.output2/src/org/netbeans/core/output2/ui/AbstractOutputTab.java (-1 / +1 lines)
Lines 149-155 Link Here
149
149
150
    protected abstract AbstractOutputPane createOutputPane();
150
    protected abstract AbstractOutputPane createOutputPane();
151
    
151
    
152
    protected abstract void inputSent (String txt);
152
    public abstract void inputSent (String txt);
153
153
154
    /**
154
    /**
155
     * Accessed reflectively from org.netbeans.jellytools.OutputTabOperator.
155
     * Accessed reflectively from org.netbeans.jellytools.OutputTabOperator.
(-)a/core.output2/test/unit/src/org/netbeans/core/output2/IOExtensionsTest.java (+2 lines)
Lines 108-113 Link Here
108
    public void testSetDefColors() throws IOException {
108
    public void testSetDefColors() throws IOException {
109
        IOColors.setColor(io, IOColors.OutputType.OUTPUT, Color.GRAY);
109
        IOColors.setColor(io, IOColors.OutputType.OUTPUT, Color.GRAY);
110
        IOColors.setColor(io, IOColors.OutputType.ERROR, Color.PINK);
110
        IOColors.setColor(io, IOColors.OutputType.ERROR, Color.PINK);
111
        IOColors.setColor(io, IOColors.OutputType.INPUT, Color.BLUE);
111
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK, Color.MAGENTA);
112
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK, Color.MAGENTA);
112
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK_IMPORTANT, Color.GREEN);
113
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK_IMPORTANT, Color.GREEN);
113
        io.getOut().println("Test out");
114
        io.getOut().println("Test out");
Lines 116-121 Link Here
116
        io.getOut().println("Test important hyperlink", new L(), true);
117
        io.getOut().println("Test important hyperlink", new L(), true);
117
        IOColors.setColor(io, IOColors.OutputType.OUTPUT, Color.BLACK);
118
        IOColors.setColor(io, IOColors.OutputType.OUTPUT, Color.BLACK);
118
        IOColors.setColor(io, IOColors.OutputType.ERROR, Color.RED);
119
        IOColors.setColor(io, IOColors.OutputType.ERROR, Color.RED);
120
        IOColors.setColor(io, IOColors.OutputType.INPUT, Color.BLACK);
119
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK, Color.BLUE);
121
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK, Color.BLUE);
120
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK_IMPORTANT, Color.MAGENTA);
122
        IOColors.setColor(io, IOColors.OutputType.HYPERLINK_IMPORTANT, Color.MAGENTA);
121
    }
123
    }
(-)a/openide.io/apichanges.xml (+17 lines)
Lines 107-112 Link Here
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
107
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
108
109
<changes>
109
<changes>
110
    <change id="coloredInput">
111
      <api name="io"/>
112
      <summary>Added IOColors.OutputType.INPUT to be able to specify a color of input text.</summary>
113
      <version major="1" minor="38"/>
114
      <date day="18" month="4" year="2013"/>
115
      <author login="mentlicher"/>
116
      <compatibility addition="yes" binary="compatible" semantic="compatible" />
117
      <description>
118
          <p>
119
              Added enum element <code>IOColors.OutputType.INPUT</code>
120
              that can be passed to get/setColor methods to set a color of the
121
              input text.
122
          </p>
123
      </description>
124
      <class package="org.openide.windows" name="IOColors"/>
125
      <issue number="228480" />
126
    </change>
110
    <change id="getIO-4-params">
127
    <change id="getIO-4-params">
111
      <api name="io"/>
128
      <api name="io"/>
112
      <summary>Added IOProvider.getIO variant that takes all 4 possible parameters.</summary>
129
      <summary>Added IOProvider.getIO variant that takes all 4 possible parameters.</summary>
(-)a/openide.io/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.io
2
OpenIDE-Module: org.openide.io
3
OpenIDE-Module-Specification-Version: 1.37
3
OpenIDE-Module-Specification-Version: 1.38
4
OpenIDE-Module-Localizing-Bundle: org/openide/io/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/openide/io/Bundle.properties
5
OpenIDE-Module-Recommends: org.openide.windows.IOProvider, org.openide.windows.IOContainer$Provider
5
OpenIDE-Module-Recommends: org.openide.windows.IOProvider, org.openide.windows.IOContainer$Provider
6
AutoUpdate-Essential-Module: true
6
AutoUpdate-Essential-Module: true
(-)a/openide.io/src/org/openide/windows/IOColors.java (-2 / +3 lines)
Lines 88-95 Link Here
88
        HYPERLINK,
88
        HYPERLINK,
89
        /** important hyperlink */
89
        /** important hyperlink */
90
        HYPERLINK_IMPORTANT,
90
        HYPERLINK_IMPORTANT,
91
        /** input, could be supported in future */
91
        /** input text
92
        // INPUT,
92
         * @since 1.38 */
93
        INPUT,
93
    }
94
    }
94
95
95
    /**
96
    /**

Return to bug 228480