FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update status error/warning when changing the line by JakubValtar · Pull Request #3907 · processing/processing · GitHub

Repository navigation

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

Filter by extension

Filter by extension .java  (4) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 8 additions & 0 deletions app/src/processing/app/ui/Editor.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL