mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
bug 307211: Different colors for info, warning and errors in the build console
This commit is contained in:
parent
e5a1e9060f
commit
c5b4c65418
7 changed files with 125 additions and 40 deletions
|
@ -29,7 +29,9 @@ ConsolePreferencePage.outputColor.label=Output text color
|
||||||
ConsolePreferencePage.infoColor.label=Information message text color
|
ConsolePreferencePage.infoColor.label=Information message text color
|
||||||
ConsolePreferencePage.errorColor.label=Error message text color
|
ConsolePreferencePage.errorColor.label=Error message text color
|
||||||
ConsolePreferencePage.backgroundColor.label=Background color
|
ConsolePreferencePage.backgroundColor.label=Background color
|
||||||
ConsolePreferencePage.problemBackgroundColor.label=Background color for build problems
|
ConsolePreferencePage.problemBackgroundColor.label=Background color for build errors
|
||||||
|
ConsolePreferencePage.problemWarningBackgroundColor.label=Background color for build warnings
|
||||||
|
ConsolePreferencePage.problemInfoBackgroundColor.label=Background color for build informational messages
|
||||||
ConsolePreferencePage.problemHighlightedColor.label=Highlighting color for build problems
|
ConsolePreferencePage.problemHighlightedColor.label=Highlighting color for build problems
|
||||||
|
|
||||||
# ------- Project/Prefernces/Wizards COnfiguration blocks -------
|
# ------- Project/Prefernces/Wizards COnfiguration blocks -------
|
||||||
|
|
|
@ -63,20 +63,43 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
||||||
public static final String KEY_LOG_LOCATION = "logLocation"; //$NON-NLS-1$
|
public static final String KEY_LOG_LOCATION = "logLocation"; //$NON-NLS-1$
|
||||||
public static final boolean CONSOLE_KEEP_LOG_DEFAULT = true;
|
public static final boolean CONSOLE_KEEP_LOG_DEFAULT = true;
|
||||||
|
|
||||||
ListenerList listeners = new ListenerList();
|
private ListenerList listeners = new ListenerList();
|
||||||
BuildConsole fConsole;
|
private BuildConsole fConsole;
|
||||||
private Map<IProject, BuildConsolePartitioner> fConsoleMap = new HashMap<IProject, BuildConsolePartitioner>();
|
private Map<IProject, BuildConsolePartitioner> fConsoleMap = new HashMap<IProject, BuildConsolePartitioner>();
|
||||||
Color infoColor, outputColor, errorColor, backgroundColor, problemHighlightedColor, problemBackgroundColor;
|
private Color infoColor;
|
||||||
|
private Color outputColor;
|
||||||
|
private Color errorColor;
|
||||||
|
private Color backgroundColor;
|
||||||
|
private Color problemHighlightedColor;
|
||||||
|
private Color problemErrorBackgroundColor;
|
||||||
|
private Color problemInfoBackgroundColor;
|
||||||
|
private Color problemWarningBackgroundColor;
|
||||||
|
|
||||||
public Color getProblemHighlightedColor() {
|
public Color getProblemHighlightedColor() {
|
||||||
return problemHighlightedColor;
|
return problemHighlightedColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function returns background color for errors only now
|
||||||
|
*/
|
||||||
public Color getProblemBackgroundColor() {
|
public Color getProblemBackgroundColor() {
|
||||||
return problemBackgroundColor;
|
return problemErrorBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildConsoleStreamDecorator infoStream, outputStream, errorStream;
|
public Color getWarningBackgroundColor() {
|
||||||
String fName, fContextMenuId;
|
return problemWarningBackgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color getInfoBackgroundColor() {
|
||||||
|
return problemInfoBackgroundColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
private BuildConsoleStreamDecorator infoStream;
|
||||||
|
private BuildConsoleStreamDecorator outputStream;
|
||||||
|
private BuildConsoleStreamDecorator errorStream;
|
||||||
|
|
||||||
|
private String fName;
|
||||||
|
private String fContextMenuId;
|
||||||
|
|
||||||
static public final int BUILD_STREAM_TYPE_INFO = 0;
|
static public final int BUILD_STREAM_TYPE_INFO = 0;
|
||||||
static public final int BUILD_STREAM_TYPE_OUTPUT = 1;
|
static public final int BUILD_STREAM_TYPE_OUTPUT = 1;
|
||||||
|
@ -180,7 +203,9 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
||||||
outputColor.dispose();
|
outputColor.dispose();
|
||||||
errorColor.dispose();
|
errorColor.dispose();
|
||||||
backgroundColor.dispose();
|
backgroundColor.dispose();
|
||||||
problemBackgroundColor.dispose();
|
problemErrorBackgroundColor.dispose();
|
||||||
|
problemWarningBackgroundColor.dispose();
|
||||||
|
problemInfoBackgroundColor.dispose();
|
||||||
problemHighlightedColor.dispose();
|
problemHighlightedColor.dispose();
|
||||||
}
|
}
|
||||||
ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new org.eclipse.ui.console.IConsole[]{fConsole});
|
ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new org.eclipse.ui.console.IConsole[]{fConsole});
|
||||||
|
@ -229,7 +254,9 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
||||||
backgroundColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_BACKGROUND_COLOR);
|
backgroundColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_BACKGROUND_COLOR);
|
||||||
fConsole.setBackground(backgroundColor);
|
fConsole.setBackground(backgroundColor);
|
||||||
problemHighlightedColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR);
|
problemHighlightedColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR);
|
||||||
problemBackgroundColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR);
|
problemErrorBackgroundColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR);
|
||||||
|
problemWarningBackgroundColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_WARNING_BACKGROUND_COLOR);
|
||||||
|
problemInfoBackgroundColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_INFO_BACKGROUND_COLOR);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
CUIPlugin.getWorkspace().addResourceChangeListener(this);
|
CUIPlugin.getWorkspace().addResourceChangeListener(this);
|
||||||
|
@ -271,8 +298,18 @@ public class BuildConsoleManager implements IBuildConsoleManager, IResourceChang
|
||||||
redrawTextViewer();
|
redrawTextViewer();
|
||||||
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR)) {
|
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR)) {
|
||||||
Color newColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR);
|
Color newColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR);
|
||||||
problemBackgroundColor.dispose();
|
problemErrorBackgroundColor.dispose();
|
||||||
problemBackgroundColor = newColor;
|
problemErrorBackgroundColor = newColor;
|
||||||
|
redrawTextViewer();
|
||||||
|
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_WARNING_BACKGROUND_COLOR)) {
|
||||||
|
Color newColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_WARNING_BACKGROUND_COLOR);
|
||||||
|
problemWarningBackgroundColor.dispose();
|
||||||
|
problemWarningBackgroundColor = newColor;
|
||||||
|
redrawTextViewer();
|
||||||
|
} else if (property.equals(BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_INFO_BACKGROUND_COLOR)) {
|
||||||
|
Color newColor = createColor(CUIPlugin.getStandardDisplay(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_PROBLEM_INFO_BACKGROUND_COLOR);
|
||||||
|
problemInfoBackgroundColor.dispose();
|
||||||
|
problemInfoBackgroundColor = newColor;
|
||||||
redrawTextViewer();
|
redrawTextViewer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,10 @@ public class BuildConsolePartition extends TypedRegion {
|
||||||
/** Partition type */
|
/** Partition type */
|
||||||
public static final String CONSOLE_PARTITION_TYPE = CUIPlugin.getPluginId() + ".CONSOLE_PARTITION_TYPE"; //$NON-NLS-1$
|
public static final String CONSOLE_PARTITION_TYPE = CUIPlugin.getPluginId() + ".CONSOLE_PARTITION_TYPE"; //$NON-NLS-1$
|
||||||
|
|
||||||
/** Partition type to report errors in console */
|
/** Partition types to report build problems in the console */
|
||||||
public static final String ERROR_PARTITION_TYPE = CUIPlugin.getPluginId() + ".ERROR_PARTITION_TYPE"; //$NON-NLS-1$
|
public static final String ERROR_PARTITION_TYPE = CUIPlugin.getPluginId() + ".ERROR_PARTITION_TYPE"; //$NON-NLS-1$
|
||||||
|
public static final String INFO_PARTITION_TYPE = CUIPlugin.getPluginId() + ".INFO_PARTITION_TYPE"; //$NON-NLS-1$
|
||||||
|
public static final String WARNING_PARTITION_TYPE = CUIPlugin.getPluginId() + ".WARNING_PARTITION_TYPE"; //$NON-NLS-1$
|
||||||
|
|
||||||
public BuildConsolePartition(BuildConsoleStreamDecorator stream, int offset, int length, String type) {
|
public BuildConsolePartition(BuildConsoleStreamDecorator stream, int offset, int length, String type) {
|
||||||
super(offset, length, type);
|
super(offset, length, type);
|
||||||
|
@ -77,14 +79,17 @@ public class BuildConsolePartition extends TypedRegion {
|
||||||
*/
|
*/
|
||||||
public boolean canBeCombinedWith(BuildConsolePartition partition) {
|
public boolean canBeCombinedWith(BuildConsolePartition partition) {
|
||||||
// Error partitions never can be combined together
|
// Error partitions never can be combined together
|
||||||
if ( getType() == ERROR_PARTITION_TYPE ) return false;
|
String type = getType();
|
||||||
|
if (isProblemPartitionType(type)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int start = getOffset();
|
int start = getOffset();
|
||||||
int end = start + getLength();
|
int end = start + getLength();
|
||||||
int otherStart = partition.getOffset();
|
int otherStart = partition.getOffset();
|
||||||
int otherEnd = otherStart + partition.getLength();
|
int otherEnd = otherStart + partition.getLength();
|
||||||
boolean overlap = (otherStart >= start && otherStart <= end) || (start >= otherStart && start <= otherEnd);
|
boolean overlap = (otherStart >= start && otherStart <= end) || (start >= otherStart && start <= otherEnd);
|
||||||
return getStream() != null && overlap && getType().equals(partition.getType()) && getStream().equals(partition.getStream());
|
return getStream() != null && overlap && type.equals(partition.getType()) && getStream().equals(partition.getStream());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,4 +122,12 @@ public class BuildConsolePartition extends TypedRegion {
|
||||||
public ProblemMarkerInfo getMarker() {
|
public ProblemMarkerInfo getMarker() {
|
||||||
return fMarker;
|
return fMarker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isProblemPartitionType(String type) {
|
||||||
|
return type==BuildConsolePartition.ERROR_PARTITION_TYPE
|
||||||
|
|| type==BuildConsolePartition.WARNING_PARTITION_TYPE
|
||||||
|
|| type==BuildConsolePartition.INFO_PARTITION_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Vector;
|
||||||
import org.eclipse.core.filesystem.EFS;
|
import org.eclipse.core.filesystem.EFS;
|
||||||
import org.eclipse.core.filesystem.IFileStore;
|
import org.eclipse.core.filesystem.IFileStore;
|
||||||
import org.eclipse.core.filesystem.URIUtil;
|
import org.eclipse.core.filesystem.URIUtil;
|
||||||
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
@ -327,7 +328,8 @@ public class BuildConsolePartitioner
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addStreamEntryToDocument(StreamEntry entry) throws BadLocationException {
|
private void addStreamEntryToDocument(StreamEntry entry) throws BadLocationException {
|
||||||
if ( entry.getMarker() == null ) {
|
ProblemMarkerInfo marker = entry.getMarker();
|
||||||
|
if (marker==null) {
|
||||||
// It is plain unmarkered console output
|
// It is plain unmarkered console output
|
||||||
addPartition(new BuildConsolePartition(fLastStream,
|
addPartition(new BuildConsolePartition(fLastStream,
|
||||||
fDocument.getLength(),
|
fDocument.getLength(),
|
||||||
|
@ -336,10 +338,18 @@ public class BuildConsolePartitioner
|
||||||
} else {
|
} else {
|
||||||
// this text line in entry is markered with ProblemMarkerInfo,
|
// this text line in entry is markered with ProblemMarkerInfo,
|
||||||
// create special partition for it.
|
// create special partition for it.
|
||||||
|
String errorPartitionType;
|
||||||
|
if (marker.severity==IMarker.SEVERITY_INFO) {
|
||||||
|
errorPartitionType = BuildConsolePartition.INFO_PARTITION_TYPE;
|
||||||
|
} else if (marker.severity==IMarker.SEVERITY_WARNING) {
|
||||||
|
errorPartitionType = BuildConsolePartition.WARNING_PARTITION_TYPE;
|
||||||
|
} else {
|
||||||
|
errorPartitionType = BuildConsolePartition.ERROR_PARTITION_TYPE;
|
||||||
|
}
|
||||||
addPartition(new BuildConsolePartition(fLastStream,
|
addPartition(new BuildConsolePartition(fLastStream,
|
||||||
fDocument.getLength(),
|
fDocument.getLength(),
|
||||||
entry.getText().length(),
|
entry.getText().length(),
|
||||||
BuildConsolePartition.ERROR_PARTITION_TYPE, entry.getMarker()));
|
errorPartitionType, marker));
|
||||||
}
|
}
|
||||||
fDocument.replace(fDocument.getLength(), 0, entry.getText());
|
fDocument.replace(fDocument.getLength(), 0, entry.getText());
|
||||||
}
|
}
|
||||||
|
@ -479,21 +489,21 @@ public class BuildConsolePartitioner
|
||||||
|
|
||||||
ITypedRegion newPartition = null;
|
ITypedRegion newPartition = null;
|
||||||
int offset = region.getOffset();
|
int offset = region.getOffset();
|
||||||
|
String type = messageConsolePartition.getType();
|
||||||
if (offset < overflow) {
|
if (offset < overflow) {
|
||||||
int endOffset = offset + region.getLength();
|
int endOffset = offset + region.getLength();
|
||||||
if (endOffset < overflow ||
|
if (endOffset < overflow || BuildConsolePartition.isProblemPartitionType(type)) {
|
||||||
messageConsolePartition.getType() == BuildConsolePartition.ERROR_PARTITION_TYPE ) {
|
|
||||||
// remove partition,
|
// remove partition,
|
||||||
// partitions with problem markers can't be split - remove them too
|
// partitions with problem markers can't be split - remove them too
|
||||||
} else {
|
} else {
|
||||||
// split partition
|
// split partition
|
||||||
int length = endOffset - overflow;
|
int length = endOffset - overflow;
|
||||||
newPartition = messageConsolePartition.createNewPartition(0, length, messageConsolePartition.getType());
|
newPartition = messageConsolePartition.createNewPartition(0, length, type);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// modify partition offset
|
// modify partition offset
|
||||||
newPartition = messageConsolePartition.createNewPartition(messageConsolePartition.getOffset()
|
offset = messageConsolePartition.getOffset() - overflow;
|
||||||
- overflow, messageConsolePartition.getLength(), messageConsolePartition.getType());
|
newPartition = messageConsolePartition.createNewPartition(offset, messageConsolePartition.getLength(), type);
|
||||||
}
|
}
|
||||||
if (newPartition != null) {
|
if (newPartition != null) {
|
||||||
newParitions.add(newPartition);
|
newParitions.add(newPartition);
|
||||||
|
@ -572,31 +582,35 @@ public class BuildConsolePartitioner
|
||||||
return new BuildOutputStream(this, fManager.getStreamDecorator(BuildConsoleManager.BUILD_STREAM_TYPE_ERROR));
|
return new BuildOutputStream(this, fManager.getStreamDecorator(BuildConsoleManager.BUILD_STREAM_TYPE_ERROR));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is useful for future debugging and bugfixing */
|
/** This method is useful for future debugging and bug-fixing */
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings({ "unused", "nls" })
|
||||||
private void printDocumentPartitioning() {
|
private void printDocumentPartitioning() {
|
||||||
System.out.println("Document partitioning: "); //$NON-NLS-1$
|
System.out.println("Document partitioning: ");
|
||||||
for (ITypedRegion tr : fPartitions) {
|
for (ITypedRegion tr : fPartitions) {
|
||||||
BuildConsolePartition p = (BuildConsolePartition) tr;
|
BuildConsolePartition p = (BuildConsolePartition) tr;
|
||||||
int start = p.getOffset();
|
int start = p.getOffset();
|
||||||
int end = p.getOffset() + p.getLength();
|
int end = p.getOffset() + p.getLength();
|
||||||
String text;
|
String text;
|
||||||
String isError = "U"; //$NON-NLS-1$
|
String isError = "U";
|
||||||
if (p.getType() == BuildConsolePartition.ERROR_PARTITION_TYPE) {
|
String type = p.getType();
|
||||||
isError = "E"; //$NON-NLS-1$
|
if (type == BuildConsolePartition.ERROR_PARTITION_TYPE) {
|
||||||
} else if (p.getType() == BuildConsolePartition.CONSOLE_PARTITION_TYPE) {
|
isError = "E";
|
||||||
isError = "C"; //$NON-NLS-1$
|
} else if (type == BuildConsolePartition.WARNING_PARTITION_TYPE) {
|
||||||
|
isError = "W";
|
||||||
|
} else if (type == BuildConsolePartition.INFO_PARTITION_TYPE) {
|
||||||
|
isError = "I";
|
||||||
|
} else if (type == BuildConsolePartition.CONSOLE_PARTITION_TYPE) {
|
||||||
|
isError = "C";
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
text = fDocument.get(p.getOffset(), p.getLength());
|
text = fDocument.get(p.getOffset(), p.getLength());
|
||||||
} catch (BadLocationException e) {
|
} catch (BadLocationException e) {
|
||||||
text = "N/A"; //$NON-NLS-1$
|
text = "N/A";
|
||||||
}
|
}
|
||||||
if (text.endsWith("\n")) { //$NON-NLS-1$
|
if (text.endsWith("\n")) {
|
||||||
text = text.substring(0, text.length() - 1);
|
text = text.substring(0, text.length() - 1);
|
||||||
}
|
}
|
||||||
System.out.println(" " + isError + " " + start + "-" + end + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
System.out.println(" " + isError + " " + start + "-" + end + ":[" + text + "]");
|
||||||
":[" + text + "]"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -258,8 +258,15 @@ public class BuildConsoleViewer extends TextViewer
|
||||||
|
|
||||||
BuildConsolePartition partition = (BuildConsolePartition) partitioner.getPartition(event.lineOffset);
|
BuildConsolePartition partition = (BuildConsolePartition) partitioner.getPartition(event.lineOffset);
|
||||||
// Set background for error partitions
|
// Set background for error partitions
|
||||||
if ( partition != null && partition.getType() == BuildConsolePartition.ERROR_PARTITION_TYPE ) {
|
if (partition!=null) {
|
||||||
event.lineBackground = partitioner.fManager.getProblemBackgroundColor();
|
String type = partition.getType();
|
||||||
|
if (type==BuildConsolePartition.ERROR_PARTITION_TYPE) {
|
||||||
|
event.lineBackground = partitioner.fManager.getProblemBackgroundColor();
|
||||||
|
} else if (type==BuildConsolePartition.WARNING_PARTITION_TYPE) {
|
||||||
|
event.lineBackground = partitioner.fManager.getWarningBackgroundColor();
|
||||||
|
} else if (type==BuildConsolePartition.INFO_PARTITION_TYPE) {
|
||||||
|
event.lineBackground = partitioner.fManager.getInfoBackgroundColor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,8 @@ class DocumentMarkerManager {
|
||||||
if ( i == fPartitioner.fPartitions.size() ) {
|
if ( i == fPartitioner.fPartitions.size() ) {
|
||||||
i = 0;
|
i = 0;
|
||||||
}
|
}
|
||||||
if ( fPartitioner.fPartitions.get(i).getType() == BuildConsolePartition.ERROR_PARTITION_TYPE ) {
|
String type = fPartitioner.fPartitions.get(i).getType();
|
||||||
|
if (BuildConsolePartition.isProblemPartitionType(type)) {
|
||||||
highlightedPartitionIndex = i;
|
highlightedPartitionIndex = i;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -64,7 +65,8 @@ class DocumentMarkerManager {
|
||||||
if ( i == -1 ) {
|
if ( i == -1 ) {
|
||||||
i = fPartitioner.fPartitions.size() - 1;
|
i = fPartitioner.fPartitions.size() - 1;
|
||||||
}
|
}
|
||||||
if ( fPartitioner.fPartitions.get(i).getType() == BuildConsolePartition.ERROR_PARTITION_TYPE ) {
|
String type = fPartitioner.fPartitions.get(i).getType();
|
||||||
|
if (BuildConsolePartition.isProblemPartitionType(type)) {
|
||||||
highlightedPartitionIndex = i;
|
highlightedPartitionIndex = i;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
@ -75,7 +77,8 @@ class DocumentMarkerManager {
|
||||||
|
|
||||||
void moveToFirstError() {
|
void moveToFirstError() {
|
||||||
for (int i=0; i<fPartitioner.fPartitions.size(); i++) {
|
for (int i=0; i<fPartitioner.fPartitions.size(); i++) {
|
||||||
if ( fPartitioner.fPartitions.get(i).getType() == BuildConsolePartition.ERROR_PARTITION_TYPE ) {
|
String type = fPartitioner.fPartitions.get(i).getType();
|
||||||
|
if (BuildConsolePartition.isProblemPartitionType(type)) {
|
||||||
highlightedPartitionIndex = i;
|
highlightedPartitionIndex = i;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -86,13 +89,14 @@ class DocumentMarkerManager {
|
||||||
/** Returns true if offset points to error partition and false otherwise */
|
/** Returns true if offset points to error partition and false otherwise */
|
||||||
boolean moveToErrorByOffset(int offset) {
|
boolean moveToErrorByOffset(int offset) {
|
||||||
ITypedRegion p = fPartitioner.getPartition(offset);
|
ITypedRegion p = fPartitioner.getPartition(offset);
|
||||||
if ( BuildConsolePartition.ERROR_PARTITION_TYPE.equals(p.getType()) ) {
|
String type = p.getType();
|
||||||
|
if (BuildConsolePartition.isProblemPartitionType(type)) {
|
||||||
highlightedPartitionIndex = fPartitioner.fPartitions.indexOf(p);
|
highlightedPartitionIndex = fPartitioner.fPartitions.indexOf(p);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Get marker for current error */
|
/** Get marker for current error */
|
||||||
ProblemMarkerInfo getCurrentErrorMarker() {
|
ProblemMarkerInfo getCurrentErrorMarker() {
|
||||||
BuildConsolePartition p = getCurrentPartition();
|
BuildConsolePartition p = getCurrentPartition();
|
||||||
|
|
|
@ -42,6 +42,8 @@ public class BuildConsolePreferencePage extends FieldEditorPreferencePage implem
|
||||||
public static final String PREF_BUILDCONSOLE_ERROR_COLOR = "buildConsoleErrorStreamColor"; //$NON-NLS-1$
|
public static final String PREF_BUILDCONSOLE_ERROR_COLOR = "buildConsoleErrorStreamColor"; //$NON-NLS-1$
|
||||||
public static final String PREF_BUILDCONSOLE_BACKGROUND_COLOR = "buildConsoleBackgroundColor"; //$NON-NLS-1$
|
public static final String PREF_BUILDCONSOLE_BACKGROUND_COLOR = "buildConsoleBackgroundColor"; //$NON-NLS-1$
|
||||||
public static final String PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR = "buildConsoleProblemBackgroundColor"; //$NON-NLS-1$
|
public static final String PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR = "buildConsoleProblemBackgroundColor"; //$NON-NLS-1$
|
||||||
|
public static final String PREF_BUILDCONSOLE_PROBLEM_WARNING_BACKGROUND_COLOR = "buildConsoleProblemWarningBackgroundColor"; //$NON-NLS-1$
|
||||||
|
public static final String PREF_BUILDCONSOLE_PROBLEM_INFO_BACKGROUND_COLOR = "buildConsoleProblemInfoBackgroundColor"; //$NON-NLS-1$
|
||||||
public static final String PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR = "buildConsoleProblemHighlightedColor"; //$NON-NLS-1$
|
public static final String PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR = "buildConsoleProblemHighlightedColor"; //$NON-NLS-1$
|
||||||
|
|
||||||
public BuildConsolePreferencePage() {
|
public BuildConsolePreferencePage() {
|
||||||
|
@ -87,6 +89,10 @@ public class BuildConsolePreferencePage extends FieldEditorPreferencePage implem
|
||||||
CUIPlugin.getResourceString("ConsolePreferencePage.backgroundColor.label"), parent)); //$NON-NLS-1$
|
CUIPlugin.getResourceString("ConsolePreferencePage.backgroundColor.label"), parent)); //$NON-NLS-1$
|
||||||
addField(createColorFieldEditor(PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR,
|
addField(createColorFieldEditor(PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR,
|
||||||
CUIPlugin.getResourceString("ConsolePreferencePage.problemBackgroundColor.label"), parent)); //$NON-NLS-1$
|
CUIPlugin.getResourceString("ConsolePreferencePage.problemBackgroundColor.label"), parent)); //$NON-NLS-1$
|
||||||
|
addField(createColorFieldEditor(PREF_BUILDCONSOLE_PROBLEM_WARNING_BACKGROUND_COLOR,
|
||||||
|
CUIPlugin.getResourceString("ConsolePreferencePage.problemWarningBackgroundColor.label"), parent)); //$NON-NLS-1$
|
||||||
|
addField(createColorFieldEditor(PREF_BUILDCONSOLE_PROBLEM_INFO_BACKGROUND_COLOR,
|
||||||
|
CUIPlugin.getResourceString("ConsolePreferencePage.problemInfoBackgroundColor.label"), parent)); //$NON-NLS-1$
|
||||||
addField(createColorFieldEditor(PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR,
|
addField(createColorFieldEditor(PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR,
|
||||||
CUIPlugin.getResourceString("ConsolePreferencePage.problemHighlightedColor.label"), parent)); //$NON-NLS-1$
|
CUIPlugin.getResourceString("ConsolePreferencePage.problemHighlightedColor.label"), parent)); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -143,6 +149,8 @@ public class BuildConsolePreferencePage extends FieldEditorPreferencePage implem
|
||||||
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_ERROR_COLOR, new RGB(255, 0, 0));
|
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_ERROR_COLOR, new RGB(255, 0, 0));
|
||||||
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_BACKGROUND_COLOR, new RGB(255, 255, 255));
|
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_BACKGROUND_COLOR, new RGB(255, 255, 255));
|
||||||
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR, new RGB(254, 231, 224));
|
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_PROBLEM_BACKGROUND_COLOR, new RGB(254, 231, 224));
|
||||||
|
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_PROBLEM_WARNING_BACKGROUND_COLOR, new RGB(254, 243, 218));
|
||||||
|
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_PROBLEM_INFO_BACKGROUND_COLOR, new RGB(244, 247, 254));
|
||||||
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR, new RGB(255, 0, 0));
|
PreferenceConverter.setDefault(prefs, PREF_BUILDCONSOLE_PROBLEM_HIGHLIGHTED_COLOR, new RGB(255, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue