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

(-)maven/src/org/netbeans/modules/maven/execute/AbstractOutputHandler.java (-4 / +8 lines)
Lines 301-320 Link Here
301
        }
301
        }
302
        if (!visitor.isLineSkipped()) {
302
        if (!visitor.isLineSkipped()) {
303
            String line = visitor.getLine() == null ? input : visitor.getLine();
303
            String line = visitor.getLine() == null ? input : visitor.getLine();
304
            OutputColors outputColors = new OutputColors();
304
            if (visitor.getColor() == null && visitor.getOutputListener() == null) {
305
            if (visitor.getColor() == null && visitor.getOutputListener() == null) {
305
                switch (level) {
306
                switch (level) {
306
                case DEBUG:
307
                case DEBUG:
307
                    visitor.setColor(Color.GRAY);
308
                    visitor.setColor(outputColors.getDebugColor());
308
                    break;
309
                    break;
309
                case WARNING:
310
                case WARNING:
310
                    visitor.setColor(Color.ORANGE.darker());
311
                    visitor.setColor(outputColors.getWarningColor());
311
                    break;
312
                    break;
312
                case ERROR:
313
                case ERROR:
313
                    visitor.setColor(Color.RED);
314
                    visitor.setColor(outputColors.getErrorColor());
314
                    break;
315
                    break;
315
                case FATAL:
316
                case FATAL:
316
                    visitor.setColor(Color.MAGENTA);
317
                    visitor.setColor(outputColors.getFatalColor());
317
                    break;
318
                    break;
319
                case INFO:
320
                    visitor.setColor(outputColors.getInfoColor());
321
                    break;
318
                }
322
                }
319
            }
323
            }
320
            try {
324
            try {
(-)maven/src/org/netbeans/modules/maven/execute/MavenCommandLineExecutor.java (-1 / +2 lines)
Lines 461-469 Link Here
461
    }
461
    }
462
462
463
    private static void printGray(InputOutput io, String text) {
463
    private static void printGray(InputOutput io, String text) {
464
        OutputColors outputColors = new OutputColors();
464
        if (IOColorLines.isSupported(io)) {
465
        if (IOColorLines.isSupported(io)) {
465
            try {
466
            try {
466
                IOColorLines.println(io, text, Color.GRAY);
467
                IOColorLines.println(io, text, outputColors.getSubduedTextColor());
467
            } catch (IOException ex) {
468
            } catch (IOException ex) {
468
                Exceptions.printStackTrace(ex);
469
                Exceptions.printStackTrace(ex);
469
            }
470
            }
(-)maven/src/org/netbeans/modules/maven/execute/OutputColors.java (+142 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.modules.maven.execute;
43
44
import java.awt.Color;
45
import javax.swing.UIManager;
46
47
/**
48
 *
49
 * @author venkat
50
 */
51
public class OutputColors {
52
    
53
    private Color debugColor;
54
    private Color infoColor;
55
    private Color warningColor;
56
    private Color errorColor;
57
    private Color fatalColor;
58
    private Color subduedTextColor;
59
60
    public OutputColors() {
61
        debugColor = (Color) UIManager.getColor("nb.output.debug.foreground");
62
        if(debugColor == null){
63
            debugColor = Color.GRAY;
64
        }
65
        
66
        infoColor = (Color) UIManager.getColor("nb.output.info.foreground");
67
        if(infoColor == null){
68
            infoColor = Color.BLACK;
69
        }
70
        
71
        warningColor = (Color) UIManager.getColor("nb.output.warning.foreground");
72
        if(warningColor == null){
73
            warningColor = Color.ORANGE.darker();
74
        }
75
        
76
        errorColor = (Color) UIManager.getColor("nb.output.error.foreground");
77
        if(errorColor == null){
78
            errorColor = Color.RED;
79
        }
80
        
81
        debugColor = (Color) UIManager.getColor("nb.output.fatal.foreground");
82
        if(debugColor == null){
83
            debugColor = Color.MAGENTA;
84
        }
85
        
86
        subduedTextColor = (Color) UIManager.getColor("nb.output.subduedText.foreground");
87
        if(subduedTextColor == null){
88
            subduedTextColor = Color.GRAY;
89
        }
90
        
91
    }        
92
93
    public Color getDebugColor() {
94
        return debugColor;
95
    }
96
97
    public void setDebugColor(Color debugColor) {
98
        this.debugColor = debugColor;
99
    }
100
101
    public Color getInfoColor() {
102
        return infoColor;
103
    }
104
105
    public void setInfoColor(Color infoColor) {
106
        this.infoColor = infoColor;
107
    }
108
109
    public Color getWarningColor() {
110
        return warningColor;
111
    }
112
113
    public void setWarningColor(Color warningColor) {
114
        this.warningColor = warningColor;
115
    }
116
117
    public Color getErrorColor() {
118
        return errorColor;
119
    }
120
121
    public void setErrorColor(Color errorColor) {
122
        this.errorColor = errorColor;
123
    }
124
125
    public Color getFatalColor() {
126
        return fatalColor;
127
    }
128
129
    public void setFatalColor(Color fatalColor) {
130
        this.fatalColor = fatalColor;
131
    }       
132
133
    public Color getSubduedTextColor() {
134
        return subduedTextColor;
135
    }
136
137
    public void setSubduedTextColor(Color subduedTextColor) {
138
        this.subduedTextColor = subduedTextColor;
139
    }
140
    
141
    
142
}
(-)maven/src/org/netbeans/modules/maven/output/GlobalOutputProcessor.java (-1 / +3 lines)
Lines 53-58 Link Here
53
import org.netbeans.modules.maven.api.execute.RunConfig;
53
import org.netbeans.modules.maven.api.execute.RunConfig;
54
import org.netbeans.modules.maven.api.output.OutputProcessor;
54
import org.netbeans.modules.maven.api.output.OutputProcessor;
55
import org.netbeans.modules.maven.api.output.OutputVisitor;
55
import org.netbeans.modules.maven.api.output.OutputVisitor;
56
import org.netbeans.modules.maven.execute.OutputColors;
56
import org.netbeans.modules.maven.options.MavenOptionController;
57
import org.netbeans.modules.maven.options.MavenOptionController;
57
import static org.netbeans.modules.maven.output.Bundle.*;
58
import static org.netbeans.modules.maven.output.Bundle.*;
58
import org.netbeans.modules.options.java.api.JavaOptions;
59
import org.netbeans.modules.options.java.api.JavaOptions;
Lines 209-215 Link Here
209
//            visitor.setLine(sequenceId);
210
//            visitor.setLine(sequenceId);
210
        } else {
211
        } else {
211
            visitor.setLine("[" + sequenceId.substring("mojo-execute#".length()) + "]"); //NOI18N
212
            visitor.setLine("[" + sequenceId.substring("mojo-execute#".length()) + "]"); //NOI18N
212
            visitor.setColor(Color.GRAY);
213
            OutputColors outputColors = new OutputColors();
214
            visitor.setColor(outputColors.getSubduedTextColor());
213
        }
215
        }
214
    }
216
    }
215
217

Return to bug 225439