| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2789,6 +2789,14 @@ public String getStatusMessage() { | |||
| 2789 | 2789 | } | |
| 2790 | 2790 | ||
| 2791 | 2791 | ||
| 2792 | + /** | ||
| 2793 | + * Returns the current notice message in the editor status bar. | ||
| 2794 | + */ | ||
| 2795 | + public int getStatusMode() { | ||
| 2796 | + return status.mode; | ||
| 2797 | + } | ||
| 2798 | + | ||
| 2799 | + | ||
| 2792 | 2800 | // /** | |
| 2793 | 2801 | // * Returns the current mode of the editor status bar: NOTICE, ERR or EDIT. | |
| 2794 | 2802 | // */ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,8 +50,9 @@ public class EditorStatus extends BasicSplitPaneDivider { //JPanel { | |||
| 50 | 50 | ||
| 51 | 51 | @SuppressWarnings("hiding") | |
| 52 | 52 | static public final int ERROR = 1; | |
| 53 | - static public final int COMPILER_ERROR = 1; // temporary | ||
| 54 | - static public final int WARNING = 2; | ||
| 53 | + static public final int CURSOR_LINE_ERROR = 2; | ||
| 54 | + static public final int WARNING = 3; | ||
| 55 | + static public final int CURSOR_LINE_WARNING = 4; | ||
| 55 | 56 | static public final int NOTICE = 0; | |
| 56 | 57 | ||
| 57 | 58 | static final int YES = 1; | |
@@ -121,19 +122,25 @@ public void updateMode() { | |||
| 121 | 122 | fgColor = new Color[] { | |
| 122 | 123 | mode.getColor("status.notice.fgcolor"), | |
| 123 | 124 | mode.getColor("status.error.fgcolor"), | |
| 125 | + mode.getColor("status.error.fgcolor"), | ||
| 126 | + mode.getColor("status.warning.fgcolor"), | ||
| 124 | 127 | mode.getColor("status.warning.fgcolor") | |
| 125 | 128 | }; | |
| 126 | 129 | ||
| 127 | 130 | bgColor = new Color[] { | |
| 128 | 131 | mode.getColor("status.notice.bgcolor"), | |
| 129 | 132 | mode.getColor("status.error.bgcolor"), | |
| 133 | + mode.getColor("status.error.bgcolor"), | ||
| 134 | + mode.getColor("status.warning.bgcolor"), | ||
| 130 | 135 | mode.getColor("status.warning.bgcolor") | |
| 131 | 136 | }; | |
| 132 | 137 | ||
| 133 | 138 | bgImage = new Image[] { | |
| 134 | 139 | mode.loadImage("/lib/status/notice.png"), | |
| 135 | 140 | mode.loadImage("/lib/status/error.png"), | |
| 136 | - mode.loadImage("/lib/status/edit.png") | ||
| 141 | + mode.loadImage("/lib/status/error.png"), | ||
| 142 | + mode.loadImage("/lib/status/warning.png"), | ||
| 143 | + mode.loadImage("/lib/status/warning.png") | ||
| 137 | 144 | }; | |
| 138 | 145 | ||
| 139 | 146 | font = mode.getFont("status.font"); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -167,6 +167,12 @@ public void windowLostFocus(WindowEvent e) { | |||
| 167 | 167 | ||
| 168 | 168 | public void windowGainedFocus(WindowEvent e) { } | |
| 169 | 169 | }); | |
| 170 | + | ||
| 171 | + textarea.addCaretListener(new CaretListener() { | ||
| 172 | + public void caretUpdate(CaretEvent e) { | ||
| 173 | + errorCheckerService.updateEditorStatus(); | ||
| 174 | + } | ||
| 175 | + }); | ||
| 170 | 176 | } | |
| 171 | 177 | ||
| 172 | 178 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -953,13 +953,18 @@ public void updateEditorStatus() { | |||
| 953 | 953 | if (errorMarker != null) { | |
| 954 | 954 | if (errorMarker.getType() == LineMarker.WARNING) { | |
| 955 | 955 | editor.statusMessage(errorMarker.getProblem().getMessage(), | |
| 956 | - EditorStatus.WARNING); | ||
| 956 | + EditorStatus.CURSOR_LINE_WARNING); | ||
| 957 | 957 | } else { | |
| 958 | 958 | editor.statusMessage(errorMarker.getProblem().getMessage(), | |
| 959 | - EditorStatus.COMPILER_ERROR); | ||
| 959 | + EditorStatus.CURSOR_LINE_ERROR); | ||
| 960 | 960 | } | |
| 961 | 961 | } else { | |
| 962 | - editor.statusEmpty(); // No error, clear the status | ||
| 962 | + switch (editor.getStatusMode()) { | ||
| 963 | + case EditorStatus.CURSOR_LINE_ERROR: | ||
| 964 | + case EditorStatus.CURSOR_LINE_WARNING: | ||
| 965 | + editor.statusEmpty(); | ||
| 966 | + break; | ||
| 967 | + } | ||
| 963 | 968 | } | |
| 964 | 969 | } | |
| 965 | 970 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments