Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/src/processing/app/ui/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2789,6 +2789,14 @@ public String getStatusMessage() {
}


/**
* Returns the current notice message in the editor status bar.
*/
public int getStatusMode() {
return status.mode;
}


// /**
// * Returns the current mode of the editor status bar: NOTICE, ERR or EDIT.
// */
Expand Down
13 changes: 10 additions & 3 deletions app/src/processing/app/ui/EditorStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ public class EditorStatus extends BasicSplitPaneDivider { //JPanel {

@SuppressWarnings("hiding")
static public final int ERROR = 1;
static public final int COMPILER_ERROR = 1; // temporary
static public final int WARNING = 2;
static public final int CURSOR_LINE_ERROR = 2;
static public final int WARNING = 3;
static public final int CURSOR_LINE_WARNING = 4;
static public final int NOTICE = 0;

static final int YES = 1;
Expand Down Expand Up @@ -121,19 +122,25 @@ public void updateMode() {
fgColor = new Color[] {
mode.getColor("status.notice.fgcolor"),
mode.getColor("status.error.fgcolor"),
mode.getColor("status.error.fgcolor"),
mode.getColor("status.warning.fgcolor"),
mode.getColor("status.warning.fgcolor")
};

bgColor = new Color[] {
mode.getColor("status.notice.bgcolor"),
mode.getColor("status.error.bgcolor"),
mode.getColor("status.error.bgcolor"),
mode.getColor("status.warning.bgcolor"),
mode.getColor("status.warning.bgcolor")
};

bgImage = new Image[] {
mode.loadImage("/lib/status/notice.png"),
mode.loadImage("/lib/status/error.png"),
mode.loadImage("/lib/status/edit.png")
mode.loadImage("/lib/status/error.png"),
mode.loadImage("/lib/status/warning.png"),
mode.loadImage("/lib/status/warning.png")
};

font = mode.getFont("status.font");
Expand Down
6 changes: 6 additions & 0 deletions java/src/processing/mode/java/JavaEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ public void windowLostFocus(WindowEvent e) {

public void windowGainedFocus(WindowEvent e) { }
});

textarea.addCaretListener(new CaretListener() {
public void caretUpdate(CaretEvent e) {
errorCheckerService.updateEditorStatus();
}
});
}


Expand Down
11 changes: 8 additions & 3 deletions java/src/processing/mode/java/pdex/ErrorCheckerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -953,13 +953,18 @@ public void updateEditorStatus() {
if (errorMarker != null) {
if (errorMarker.getType() == LineMarker.WARNING) {
editor.statusMessage(errorMarker.getProblem().getMessage(),
EditorStatus.WARNING);
EditorStatus.CURSOR_LINE_WARNING);
} else {
editor.statusMessage(errorMarker.getProblem().getMessage(),
EditorStatus.COMPILER_ERROR);
EditorStatus.CURSOR_LINE_ERROR);
}
} else {
editor.statusEmpty(); // No error, clear the status
switch (editor.getStatusMode()) {
case EditorStatus.CURSOR_LINE_ERROR:
case EditorStatus.CURSOR_LINE_WARNING:
editor.statusEmpty();
break;
}
}
}

Expand Down