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.39</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 / +25 lines)
Lines 904-910 Link Here
904
            OutputOptions.getDefault().getColorStandard(),
904
            OutputOptions.getDefault().getColorStandard(),
905
            OutputOptions.getDefault().getColorError(),
905
            OutputOptions.getDefault().getColorError(),
906
            OutputOptions.getDefault().getColorLink(),
906
            OutputOptions.getDefault().getColorLink(),
907
            OutputOptions.getDefault().getColorLinkImportant()
907
            OutputOptions.getDefault().getColorLinkImportant(),
908
            OutputOptions.getDefault().getColorInput(),
908
        };
909
        };
909
    }
910
    }
910
911
Lines 921-931 Link Here
921
        if (info != null) {
922
        if (info != null) {
922
            int lineLength = length(line);
923
            int lineLength = length(line);
923
            if (lineLength > info.getEnd()) {
924
            if (lineLength > info.getEnd()) {
924
                info.addSegment(lineLength, false, null, null, null, false);
925
                // This is an input
926
                info.addSegment(lineLength, OutputKind.IN, null, null, null, false);
925
            }
927
            }
926
            return info;
928
            return info;
927
        } else {
929
        } else {
928
            return new LineInfo(this, length(line));
930
            // The last line can contain input
931
            if (line == getLineCount() - 1) {
932
                LineInfo li = new LineInfo(this);
933
                try {
934
                    li.addSegment(getLine(line).length(), OutputKind.OUT, null, null, null, false);
935
                } catch (IOException e) {
936
                    LOG.log(Level.INFO, null, e);
937
                }
938
                li.addSegment(length(line), OutputKind.IN, null, null, null, false);
939
                return li;
940
            } else {
941
                return new LineInfo(this, length(line));
942
            }
929
        }
943
        }
930
    }
944
    }
931
945
Lines 1071-1077 Link Here
1071
        return lineStartList.toString();
1085
        return lineStartList.toString();
1072
    }
1086
    }
1073
1087
1074
    private int addSegment(CharSequence s, int offset, int lineIdx, int pos, OutputListener l, boolean important, boolean err, Color c, Color b) {
1088
    private int addSegment(CharSequence s, int offset, int lineIdx, int pos, OutputListener l, boolean important, OutputKind outKind, Color c, Color b) {
1075
        int len = length(lineIdx);
1089
        int len = length(lineIdx);
1076
        if (len > 0) {
1090
        if (len > 0) {
1077
            LineInfo info = (LineInfo) linesToInfos.get(lineIdx);
1091
            LineInfo info = (LineInfo) linesToInfos.get(lineIdx);
Lines 1081-1087 Link Here
1081
            }
1095
            }
1082
            int curEnd = info.getEnd();
1096
            int curEnd = info.getEnd();
1083
            if (pos > 0 && pos != curEnd) {
1097
            if (pos > 0 && pos != curEnd) {
1084
                info.addSegment(pos, false, null, null, null, false);
1098
                info.addSegment(pos, OutputKind.OUT, null, null, null, false);
1085
                curEnd = pos;
1099
                curEnd = pos;
1086
            }
1100
            }
1087
            if (l != null) {
1101
            if (l != null) {
Lines 1104-1118 Link Here
1104
                    }
1118
                    }
1105
                }
1119
                }
1106
                if (leadingCnt > 0) {
1120
                if (leadingCnt > 0) {
1107
                    info.addSegment(curEnd + leadingCnt, false, null, null, null, false);
1121
                    info.addSegment(curEnd + leadingCnt, OutputKind.OUT, null, null, null, false);
1108
                }
1122
                }
1109
                info.addSegment(endPos - trailingCnt, err, l, c, b, important);
1123
                info.addSegment(endPos - trailingCnt, outKind, l, c, b, important);
1110
                if (trailingCnt > 0) {
1124
                if (trailingCnt > 0) {
1111
                    info.addSegment(endPos, false, null, null, null, false);
1125
                    info.addSegment(endPos, OutputKind.OUT, null, null, null, false);
1112
                }
1126
                }
1113
                registerLineWithListener(lineIdx, info, important);
1127
                registerLineWithListener(lineIdx, info, important);
1114
            } else {
1128
            } else {
1115
                info.addSegment(len, err, l, c, b, important);
1129
                info.addSegment(len, outKind, l, c, b, important);
1116
                if (important) {
1130
                if (important) {
1117
                    importantLines.add(lineIdx);
1131
                    importantLines.add(lineIdx);
1118
                }
1132
                }
Lines 1121-1127 Link Here
1121
        return len;
1135
        return len;
1122
    }
1136
    }
1123
1137
1124
    void updateLinesInfo(CharSequence s, int startLine, int startPos, OutputListener l, boolean important, boolean err, Color c, Color b) {
1138
    void updateLinesInfo(CharSequence s, int startLine, int startPos, OutputListener l, boolean important, OutputKind outKind, Color c, Color b) {
1125
        int offset = 0;
1139
        int offset = 0;
1126
        /* If it's necessary to translate tabs to spaces, use this.
1140
        /* If it's necessary to translate tabs to spaces, use this.
1127
         * But it seems that it works fine without the translation. Translation breaks character indexes.
1141
         * But it seems that it works fine without the translation. Translation breaks character indexes.
Lines 1155-1161 Link Here
1155
        synchronized (readLock()) {
1169
        synchronized (readLock()) {
1156
            int startLinePos = startPos - getLineStart(startLine);
1170
            int startLinePos = startPos - getLineStart(startLine);
1157
            for (int i = startLine; i < getLineCount(); i++) {
1171
            for (int i = startLine; i < getLineCount(); i++) {
1158
                offset += addSegment(s, offset, i, startLinePos, l, important, err, c, b) + 1;
1172
                offset += addSegment(s, offset, i, startLinePos, l, important, outKind, c, b) + 1;
1159
                startLinePos = 0;
1173
                startLinePos = 0;
1160
            }
1174
            }
1161
        }
1175
        }
(-)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 515-521 Link Here
515
        protected void println(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
515
        protected void println(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
516
            OutWriter out = out();
516
            OutWriter out = out();
517
            if (out != null) {
517
            if (out != null) {
518
                out.print(text, listener, important, color, null, false, true);
518
                out.print(text, listener, important, color, null, OutputKind.OUT, true);
519
            }
519
            }
520
        }
520
        }
521
    }
521
    }
Lines 526-532 Link Here
526
        protected void print(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
526
        protected void print(CharSequence text, OutputListener listener, boolean important, Color color) throws IOException {
527
            OutWriter out = out();
527
            OutWriter out = out();
528
            if (out != null) {
528
            if (out != null) {
529
                out.print(text, listener, important, color, null, false, false);
529
                out.print(text, listener, important, color, null, OutputKind.OUT, false);
530
            }
530
            }
531
        }
531
        }
532
    }
532
    }
(-)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 416-422 Link Here
416
        }
415
        }
417
        
416
        
418
        // XXX will not pick up ANSI sequences broken across write blocks, but this is likely rare
417
        // XXX will not pick up ANSI sequences broken across write blocks, but this is likely rare
419
        if (printANSI(s.subSequence(off, off + len), false, false, false)) {
418
        if (printANSI(s.subSequence(off, off + len), false, OutputKind.OUT, false)) {
420
            return;
419
            return;
421
        }
420
        }
422
        /* XXX causes stack overflow
421
        /* XXX causes stack overflow
Lines 526-537 Link Here
526
    }
525
    }
527
526
528
    public synchronized void println(String s, OutputListener l, boolean important) {
527
    public synchronized void println(String s, OutputListener l, boolean important) {
529
        print(s, l, important, null, null, false, true);
528
        print(s, l, important, null, null, OutputKind.OUT, true);
530
    }
529
    }
531
530
532
    synchronized void print(CharSequence s, OutputListener l, boolean important, Color c, Color b, boolean err, boolean addLS) {
531
    synchronized void print(CharSequence s, OutputListener l, boolean important, Color c, Color b, OutputKind outKind, boolean addLS) {
533
        if (c == null) {
532
        if (c == null) {
534
            if (l == null && printANSI(s, important, err, addLS)) {
533
            if (l == null && printANSI(s, important, outKind, addLS)) {
535
                return;
534
                return;
536
            }
535
            }
537
            c = ansiColor; // carry over from previous line
536
            c = ansiColor; // carry over from previous line
Lines 542-548 Link Here
542
        if (addLS) {
541
        if (addLS) {
543
            printLineEnd();
542
            printLineEnd();
544
        }
543
        }
545
        lines.updateLinesInfo(s, lastLine, lastPos, l, important, err, c, b);
544
        lines.updateLinesInfo(s, lastLine, lastPos, l, important, outKind, c, b);
546
        lines.checkLimits();
545
        lines.checkLimits();
547
    }
546
    }
548
    private Color ansiColor;
547
    private Color ansiColor;
Lines 571-577 Link Here
571
        new Color(0, 255, 255),
570
        new Color(0, 255, 255),
572
        new Color(255, 255, 255),
571
        new Color(255, 255, 255),
573
    };
572
    };
574
    private boolean printANSI(CharSequence s, boolean important, boolean err, boolean addLS) { // #192779
573
    private boolean printANSI(CharSequence s, boolean important, OutputKind outKind, boolean addLS) { // #192779
575
        int len = s.length();
574
        int len = s.length();
576
        boolean hasEscape = false; // fast initial check
575
        boolean hasEscape = false; // fast initial check
577
        for (int i = 0; i < len - 1; i++) {
576
        for (int i = 0; i < len - 1; i++) {
Lines 588-594 Link Here
588
        while (m.find()) {
587
        while (m.find()) {
589
            int esc = m.start();
588
            int esc = m.start();
590
            if (esc > text) {
589
            if (esc > text) {
591
                print(s.subSequence(text, esc), null, important, ansiColor, ansiBackground, err, false);
590
                print(s.subSequence(text, esc), null, important, ansiColor, ansiBackground, outKind, false);
592
            }
591
            }
593
            text = m.end();
592
            text = m.end();
594
            if (!"m".equals(m.group(3))) {                              //NOI18N
593
            if (!"m".equals(m.group(3))) {                              //NOI18N
Lines 649-655 Link Here
649
            return false;
648
            return false;
650
        }
649
        }
651
        if (text < len) { // final segment
650
        if (text < len) { // final segment
652
            print(s.subSequence(text, len), null, important, ansiColor, ansiBackground, err, addLS);
651
            print(s.subSequence(text, len), null, important, ansiColor, ansiBackground, outKind, addLS);
653
        } else if (addLS) { // line ended w/ control seq
652
        } else if (addLS) { // line ended w/ control seq
654
            printLineEnd();
653
            printLineEnd();
655
        }
654
        }
Lines 657-666 Link Here
657
    }
656
    }
658
657
659
    synchronized void print(CharSequence s, LineInfo info, boolean important) {
658
    synchronized void print(CharSequence s, LineInfo info, boolean important) {
660
        int line = lines.getLineCount() - 1;
661
        doWrite(s, 0, s.length());
662
        if (info != null) {
659
        if (info != null) {
660
            int line = lines.getLineCount() - 1;
661
            doWrite(s, 0, s.length());
663
            lines.addLineInfo(line, info, important);
662
            lines.addLineInfo(line, info, important);
663
        } else {
664
            print(s, null, important, null, null, OutputKind.OUT, false);
664
        }
665
        }
665
        lines.checkLimits();
666
        lines.checkLimits();
666
    }
667
    }
(-)a/core.output2/src/org/netbeans/core/output2/OutputKind.java (+54 lines)
Line 0 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
}
(-)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 211-224 Link Here
211
        return new OutputPane(this);
213
        return new OutputPane(this);
212
    }
214
    }
213
215
214
    protected void inputSent(String txt) {
216
    public void inputSent(String txt) {
215
        if (Controller.LOG) Controller.log("Input sent on OutputTab: " + txt);
217
        if (Controller.LOG) Controller.log("Input sent on OutputTab: " + txt);
216
        getOutputPane().lockScroll();
218
        getOutputPane().lockScroll();
217
        NbIO.IOReader in = io.in();
219
        NbIO.IOReader in = io.in();
218
        if (in != null) {
220
        if (in != null) {
219
            if (Controller.LOG) Controller.log("Sending input to " + in);
221
            if (Controller.LOG) Controller.log("Sending input to " + in);
220
            in.pushText(txt + "\n");
222
            in.pushText(txt + "\n");
221
            outWriter.println(txt);
223
            outWriter.print(txt, null, false, null, null, OutputKind.IN, true);
222
        }
224
        }
223
    }
225
    }
224
226
Lines 772-777 Link Here
772
        } else if (OutputOptions.PROP_COLOR_ERROR.equals(pn)) {
774
        } else if (OutputOptions.PROP_COLOR_ERROR.equals(pn)) {
773
            lines.setDefColor(IOColors.OutputType.ERROR,
775
            lines.setDefColor(IOColors.OutputType.ERROR,
774
                    opts.getColorError());
776
                    opts.getColorError());
777
        } else if (OutputOptions.PROP_COLOR_INPUT.equals(pn)) {
778
            lines.setDefColor(IOColors.OutputType.INPUT,
779
                    opts.getColorInput());
775
        } else if (OutputOptions.PROP_COLOR_LINK.equals(pn)) {
780
        } else if (OutputOptions.PROP_COLOR_LINK.equals(pn)) {
776
            lines.setDefColor(IOColors.OutputType.HYPERLINK,
781
            lines.setDefColor(IOColors.OutputType.HYPERLINK,
777
                    opts.getColorLink());
782
                    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="39"/>
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="Folding">
127
    <change id="Folding">
111
      <api name="io"/>
128
      <api name="io"/>
112
      <summary>Adding API to have support for folding of lines</summary>
129
      <summary>Adding API to have support for folding of lines</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.38
3
OpenIDE-Module-Specification-Version: 1.39
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