private JList list = new JList();
private DefaultListModel listModel = new DefaultListModel();
private BorderLayout borderLayout1 = new BorderLayout();
+ private boolean hasWarning = false;
public CompilerMessagesPanel() {
try {
public void addSourcelineTask(IMessage message) {
listModel.addElement(new CompilerMessage(message));
+ if (!hasWarning && IMessage.WARNING.isSameOrLessThan(message.getKind())) {
+ hasWarning = true;
+ }
BrowserManager.getDefault().showMessages();
}
public void addProjectTask(String message, IMessage.Kind kind) {
IMessage m = new Message(message, kind, null, null);
listModel.addElement(new CompilerMessage(m));
+ if (!hasWarning && IMessage.WARNING.isSameOrLessThan(kind)) {
+ hasWarning = true;
+ }
BrowserManager.getDefault().showMessages();
}
+ public boolean hasWarning() {
+ return hasWarning;
+ }
+
public void clearTasks() {
listModel.clear();
}
public class NullIdeTaskListManager implements TaskListManager {
List sourceLineTasks = new ArrayList();
+ boolean hasWarning = false;
public void addSourcelineTask(
String message,
ISourceLocation sourceLocation,
IMessage.Kind kind) {
addSourcelineTask(new Message(message, kind, null, sourceLocation));
+ if (!hasWarning && IMessage.WARNING.isSameOrLessThan(kind)) {
+ hasWarning = true;
+ }
}
public void addSourcelineTask(IMessage message) {
sourceLineTasks.add(new SourceLineTask(message));
+ if (!hasWarning && IMessage.WARNING.isSameOrLessThan(message.getKind())) {
+ hasWarning = true;
+ }
// System.out.println("> added sourceline task: " + message + ", file: " + sourceLocation.getSourceFile().getAbsolutePath()
// + ": " + sourceLocation.getLine());
}
public void addProjectTask(String message, IMessage.Kind kind) {
+ if (!hasWarning && IMessage.WARNING.isSameOrLessThan(kind)) {
+ hasWarning = true;
+ }
// System.out.println("> added project task: " + message + ", kind: " + kind);
}
+ public boolean hasWarning() {
+ return hasWarning;
+ }
+
public void clearTasks() {
sourceLineTasks = new ArrayList();
+ hasWarning = false;
// System.out.println("> cleared tasks");
}