| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a773b9d commit acc16ce
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,11 +24,15 @@ | |||
| 24 | 24 | package processing.app.ui; | |
| 25 | 25 | ||
| 26 | 26 | import java.awt.*; | |
| 27 | + import java.awt.event.MouseAdapter; | ||
| 28 | + import java.awt.event.MouseEvent; | ||
| 27 | 29 | ||
| 28 | 30 | import javax.swing.plaf.basic.BasicSplitPaneDivider; | |
| 29 | 31 | import javax.swing.plaf.basic.BasicSplitPaneUI; | |
| 30 | 32 | ||
| 33 | + import processing.app.Base; | ||
| 31 | 34 | import processing.app.Mode; | |
| 35 | + import processing.core.PApplet; | ||
| 32 | 36 | ||
| 33 | 37 | ||
| 34 | 38 | /** | |
@@ -58,6 +62,7 @@ public class EditorStatus extends BasicSplitPaneDivider { //JPanel { | |||
| 58 | 62 | ||
| 59 | 63 | int mode; | |
| 60 | 64 | String message; | |
| 65 | + String url; | ||
| 61 | 66 | ||
| 62 | 67 | Font font; | |
| 63 | 68 | FontMetrics metrics; | |
@@ -82,6 +87,29 @@ public EditorStatus(BasicSplitPaneUI ui, Editor editor) { | |||
| 82 | 87 | this.editor = editor; | |
| 83 | 88 | empty(); | |
| 84 | 89 | updateMode(); | |
| 90 | + | ||
| 91 | + addMouseListener(new MouseAdapter() { | ||
| 92 | + public void mouseEntered(MouseEvent e) { | ||
| 93 | + if (url != null) { | ||
| 94 | + setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + public void mousePressed(MouseEvent e) { | ||
| 99 | + if (url != null) { | ||
| 100 | + Base.openURL(url); | ||
| 101 | + } | ||
| 102 | + } | ||
| 103 | + }); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + | ||
| 107 | + static String findURL(String message) { | ||
| 108 | + String[] m = PApplet.match(message, "http\\S+"); | ||
| 109 | + if (m != null) { | ||
| 110 | + return m[0]; | ||
| 111 | + } | ||
| 112 | + return null; | ||
| 85 | 113 | } | |
| 86 | 114 | ||
| 87 | 115 | ||
@@ -107,13 +135,15 @@ public void updateMode() { | |||
| 107 | 135 | public void empty() { | |
| 108 | 136 | mode = NOTICE; | |
| 109 | 137 | message = NO_MESSAGE; | |
| 138 | + url = null; | ||
| 110 | 139 | repaint(); | |
| 111 | 140 | } | |
| 112 | 141 | ||
| 113 | 142 | ||
| 114 | 143 | public void notice(String message) { | |
| 115 | 144 | mode = NOTICE; | |
| 116 | 145 | this.message = message; | |
| 146 | + url = findURL(message); | ||
| 117 | 147 | repaint(); | |
| 118 | 148 | } | |
| 119 | 149 | ||
@@ -126,6 +156,7 @@ public void unnotice(String unmessage) { | |||
| 126 | 156 | public void error(String message) { | |
| 127 | 157 | mode = ERR; | |
| 128 | 158 | this.message = message; | |
| 159 | + url = findURL(message); | ||
| 129 | 160 | repaint(); | |
| 130 | 161 | } | |
| 131 | 162 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,10 @@ X Cannot find "processing.core" library. Line 12 in tab sketch_150704a | |||
| 7 | 7 | X also happens with "import to com.jogamp.opengl.GL2" | |
| 8 | 8 | X https://github.com/processing/processing/issues/3547 | |
| 9 | 9 | X clean up the advanced opengl wiki page | |
| 10 | + X Initialize the Find dialog with the current selection | ||
| 11 | + X https://github.com/processing/processing/issues/3457 | ||
| 12 | + X Links in error bar are not selectable nor clickable | ||
| 13 | + X https://github.com/processing/processing/issues/3471 | ||
| 10 | 14 | ||
| 11 | 15 | export | |
| 12 | 16 | X save export settings to preferences | |
| Back | FazBrowse Home | New Git URL |
0 commit comments