? src/org/netbeans/core/output2/.DS_Store Index: src/org/netbeans/core/output2/AbstractLines.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/AbstractLines.java,v retrieving revision 1.7 diff -u -r1.7 AbstractLines.java --- src/org/netbeans/core/output2/AbstractLines.java 3 Nov 2004 14:54:37 -0000 1.7 +++ src/org/netbeans/core/output2/AbstractLines.java 11 Nov 2004 07:56:43 -0000 @@ -12,6 +12,8 @@ */ package org.netbeans.core.output2; +import java.util.HashSet; +import java.util.Set; import org.openide.windows.OutputListener; import org.openide.ErrorManager; import org.openide.util.Mutex; @@ -494,10 +496,23 @@ } } - public void addListener (int line, OutputListener l) { + public void addListener (int line, OutputListener l, boolean important) { linesToListeners.put(line, l); + if (important) { + importantLines.add(line); + } } - + + private IntList importantLines = new IntList(10); + + public int firstImportantListenerLine() { + return importantLines.size() == 0 ? -1 : importantLines.get(0); + } + + public boolean isImportantHyperlink(int line) { + return importantLines.contains(line); + } + /** * A minor hook to let unit tests decide if caching is on or off. * @param val Index: src/org/netbeans/core/output2/ErrWriter.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/ErrWriter.java,v retrieving revision 1.4 diff -u -r1.4 ErrWriter.java --- src/org/netbeans/core/output2/ErrWriter.java 24 Aug 2004 13:29:08 -0000 1.4 +++ src/org/netbeans/core/output2/ErrWriter.java 11 Nov 2004 07:56:43 -0000 @@ -46,9 +46,13 @@ } public void println(String s, OutputListener l) throws java.io.IOException { + println(s, l, false); + } + + public void println(String s, OutputListener l, boolean important) throws java.io.IOException { closed = false; synchronized (wrapped) { - wrapped.println (s, l); + wrapped.println (s, l, important); ((AbstractLines) wrapped.getLines()).markErr(); } } Index: src/org/netbeans/core/output2/ExtPlainView.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/ExtPlainView.java,v retrieving revision 1.7 diff -u -r1.7 ExtPlainView.java --- src/org/netbeans/core/output2/ExtPlainView.java 18 Aug 2004 02:59:22 -0000 1.7 +++ src/org/netbeans/core/output2/ExtPlainView.java 11 Nov 2004 07:56:43 -0000 @@ -49,7 +49,7 @@ doc.getText(p0, p1 - p0, s); g.setColor(getColorForLocation(p0, doc, true)); int ret = Utilities.drawTabbedText(s, x, y, g, this, p0); - if (g.getColor() == WrappedTextView.selectedLinkFg) { + if (g.getColor() == WrappedTextView.selectedLinkFg || g.getColor() == WrappedTextView.selectedImportantLinkFg) { //#47263 - start hyperlink underline at first //non-whitespace character underline(g, s, x, p0, y); @@ -70,7 +70,7 @@ doc.getText(p0, p1 - p0, s); g.setColor(getColorForLocation(p0, doc, false)); int ret = Utilities.drawTabbedText(s, x, y, g, this, p0); - if (g.getColor() == WrappedTextView.unselectedLinkFg) { + if (g.getColor() == WrappedTextView.selectedLinkFg || g.getColor() == WrappedTextView.selectedImportantLinkFg) { //#47263 - start hyperlink underline at first //non-whitespace character underline(g, s, x, p0, y); @@ -111,17 +111,24 @@ OutputDocument od = (OutputDocument) d; int line = od.getElementIndex (start); boolean hyperlink = od.getLines().isHyperlink(line); + boolean important = hyperlink ? od.getLines().isImportantHyperlink(line) : false; boolean isErr = od.getLines().isErr(line); + return hyperlink ? - selected ? - WrappedTextView.selectedLinkFg : - WrappedTextView.unselectedLinkFg : - selected ? isErr ? - WrappedTextView.selectedErr : - WrappedTextView.selectedFg : - isErr ? - WrappedTextView.unselectedErr : - WrappedTextView.unselectedFg; + (important ? + (selected ? + WrappedTextView.selectedImportantLinkFg : + WrappedTextView.unselectedImportantLinkFg) : + (selected ? + WrappedTextView.selectedLinkFg : + WrappedTextView.unselectedLinkFg)) : + (selected ? + (isErr ? + WrappedTextView.selectedErr : + WrappedTextView.selectedFg) : + (isErr ? + WrappedTextView.unselectedErr : + WrappedTextView.unselectedFg)); } } Index: src/org/netbeans/core/output2/Lines.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/Lines.java,v retrieving revision 1.2 diff -u -r1.2 Lines.java --- src/org/netbeans/core/output2/Lines.java 24 Aug 2004 19:24:37 -0000 1.2 +++ src/org/netbeans/core/output2/Lines.java 11 Nov 2004 07:56:43 -0000 @@ -73,6 +73,15 @@ * @return A line number, or -1 if there are no listeners */ int firstListenerLine (); + + /** + * Get the index of the first line which has an important listener + * @return A line number, or -1 if there are no important listeners + */ + + int firstImportantListenerLine(); + + boolean isImportantHyperlink(int line); /** * Get the nearest listener to the passed line index Index: src/org/netbeans/core/output2/NbWriter.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/NbWriter.java,v retrieving revision 1.4 diff -u -r1.4 NbWriter.java --- src/org/netbeans/core/output2/NbWriter.java 22 Sep 2004 22:22:59 -0000 1.4 +++ src/org/netbeans/core/output2/NbWriter.java 11 Nov 2004 07:56:43 -0000 @@ -43,6 +43,10 @@ } + public void println(String s, OutputListener l, boolean important) throws IOException { + ((OutWriter) out).println (s, l, important); + } + /** * Replaces the wrapped OutWriter. * Index: src/org/netbeans/core/output2/OutWriter.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/OutWriter.java,v retrieving revision 1.20 diff -u -r1.20 OutWriter.java --- src/org/netbeans/core/output2/OutWriter.java 11 Oct 2004 15:23:30 -0000 1.20 +++ src/org/netbeans/core/output2/OutWriter.java 11 Nov 2004 07:56:43 -0000 @@ -429,20 +429,25 @@ public synchronized void println(String s, OutputListener l) throws IOException { + println(s, l, false); + } + + + public synchronized void println(String s, OutputListener l, boolean important) throws IOException { if (checkError()) { return; } int addedCount = doPrintln (s); if (addedCount == 1) { - lines.addListener(lines.getLineCount() - 1, l); + lines.addListener(lines.getLineCount() - 1, l, important); } else { int newCount = lines.getLineCount(); for (int i=newCount - addedCount; i < newCount; i++) { - lines.addListener (i, l); + lines.addListener (i, l, important); } } } - + /** * A useless writer object to pass to the superclass constructor. We override all methods * of it anyway. Index: src/org/netbeans/core/output2/OutputTab.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/OutputTab.java,v retrieving revision 1.8 diff -u -r1.8 OutputTab.java --- src/org/netbeans/core/output2/OutputTab.java 23 Sep 2004 01:32:03 -0000 1.8 +++ src/org/netbeans/core/output2/OutputTab.java 11 Nov 2004 07:56:43 -0000 @@ -164,23 +164,27 @@ if (out != null) { if (Controller.log) Controller.log ("Looking for first appropriate" + " listener line to send the caret to"); - int[] lines = out.getLines().allListenerLines(); - for (int i=0; i < lines.length; i++) { - try { - String s = out.getLines().getLine(lines[i]); - if (s.indexOf("[deprecation]") == -1 && s.indexOf("warning") == -1 && s.indexOf("stopped") == -1) { - result = lines[i]; - if (Controller.log) Controller.log ("Line to navigate to" + - "is line " + lines[i] + ": " + s); - break; - } - if (Controller.log) Controller.log ("Ignoring " + - " \"" + s + "\"\n it is just a deprecation msg"); - } catch (Exception e) { - ErrorManager.getDefault().notify(e); - break; - } - } + result = out.getLines().firstImportantListenerLine(); + // mkleint - still use the old way as fallback until modules start using OutputWriter.println(String, Listener, boolean imporant); +// if (result == -1) { +// int[] lines = out.getLines().allListenerLines(); +// for (int i=0; i < lines.length; i++) { +// try { +// String s = out.getLines().getLine(lines[i]); +// if (s.indexOf("[deprecation]") == -1 && s.indexOf("warning") == -1 && s.indexOf("stopped") == -1) { +// result = lines[i]; +// if (Controller.log) Controller.log("Line to navigate to" + +// "is line " + lines[i] + ": " + s); +// break; +// } +// if (Controller.log) Controller.log("Ignoring " + +// " \"" + s + "\"\n it is just a deprecation msg"); +// } catch (Exception e) { +// ErrorManager.getDefault().notify(e); +// break; +// } +// } +// } } return result; } Index: src/org/netbeans/core/output2/WrappedTextView.java =================================================================== RCS file: /cvs/core/output2/src/org/netbeans/core/output2/WrappedTextView.java,v retrieving revision 1.13 diff -u -r1.13 WrappedTextView.java --- src/org/netbeans/core/output2/WrappedTextView.java 18 Aug 2004 02:59:26 -0000 1.13 +++ src/org/netbeans/core/output2/WrappedTextView.java 11 Nov 2004 07:56:43 -0000 @@ -81,6 +81,8 @@ static Color unselectedFg; static Color selectedLinkFg; static Color unselectedLinkFg; + static Color selectedImportantLinkFg; + static Color unselectedImportantLinkFg; static Color selectedErr; static Color unselectedErr; static final Color arrowColor = new Color (80, 162, 80); @@ -98,12 +100,22 @@ } selectedLinkFg = UIManager.getColor("nb.output.link.foreground.selected"); //NOI18N - if (selectedLinkFg == null) selectedLinkFg = Color.BLUE; + if (selectedLinkFg == null) selectedLinkFg = Color.BLUE.darker(); unselectedLinkFg = UIManager.getColor("nb.output.link.foreground"); //NOI18N if (unselectedLinkFg == null) { unselectedLinkFg = selectedLinkFg; } + + selectedImportantLinkFg = UIManager.getColor("nb.output.link.foreground.important.selected"); //NOI18N + if (selectedImportantLinkFg == null) { + selectedImportantLinkFg = selectedLinkFg.brighter(); + } + + unselectedImportantLinkFg = UIManager.getColor("nb.output.link.foreground.important"); //NOI18N + if (unselectedImportantLinkFg == null) { + unselectedImportantLinkFg = selectedImportantLinkFg; + } selectedErr = UIManager.getColor ("nb.output.err.foreground.selected"); //NOI18N if (selectedErr == null) { @@ -569,8 +581,11 @@ OutputDocument od = (OutputDocument) d; int line = od.getElementIndex (start); boolean hyperlink = od.getLines().isHyperlink(line); + boolean important = hyperlink ? od.getLines().isImportantHyperlink(line) : false; boolean isErr = od.getLines().isErr(line); - return hyperlink ? selected ? selectedLinkFg : unselectedLinkFg : - selected ? isErr ? selectedErr : selectedFg : isErr ? unselectedErr : unselectedFg; + return hyperlink ? (important ? (selected ? selectedImportantLinkFg : unselectedImportantLinkFg) : + (selected ? selectedLinkFg : unselectedLinkFg)) : + (selected ? (isErr ? selectedErr : selectedFg) : + (isErr ? unselectedErr : unselectedFg)); } }