MCPcopy Create free account
hub / github.com/benfry/processing4 / EditorStatus

Method EditorStatus

app/src/processing/app/ui/EditorStatus.java:112–195  ·  view source on GitHub ↗
(BasicSplitPaneUI ui, Editor editor)

Source from the content-addressed store, hash-verified

110
111
112 public EditorStatus(BasicSplitPaneUI ui, Editor editor) {
113 super(ui);
114 this.editor = editor;
115 empty();
116 updateTheme();
117
118 addMouseListener(new MouseAdapter() {
119
120 @Override
121 public void mouseEntered(MouseEvent e) {
122 updateMouse(e, false);
123 }
124
125 @Override
126 public void mousePressed(MouseEvent e) {
127 updateMouse(e, true);
128 }
129
130 @Override
131 public void mouseReleased(MouseEvent e) {
132 if (mouseState == URL_PRESSED) {
133 Platform.openURL(url);
134
135 } else if (mouseState == CLIPBOARD_PRESSED) {
136 if (e.isShiftDown()) {
137 // open the text in a browser window as a search
138 final String fmt = Preferences.get("search.format");
139 Platform.openURL(String.format(fmt, PApplet.urlEncode(message)));
140
141 } else {
142 // copy the text to the clipboard
143 Clipboard clipboard = getToolkit().getSystemClipboard();
144 clipboard.setContents(new StringSelection(message), null);
145 System.out.println("Copied to the clipboard. " +
146 "Use shift-click to search the web instead.");
147 }
148
149 } else if (mouseState == COLLAPSE_PRESSED) {
150 setCollapsed(!collapsed);
151 }
152 updateMouse(e, false); // no longer pressed
153 }
154
155 @Override
156 public void mouseExited(MouseEvent e) {
157 updateMouse(null, false);
158 }
159 });
160
161 addMouseMotionListener(new MouseMotionListener() {
162 @Override
163 public void mouseDragged(MouseEvent e) {
164 // BasicSplitPaneUI.startDragging gets called even when you click but
165 // don't drag, so we can't expand the console whenever that gets called
166 // or the button wouldn't work.
167 setCollapsed(false);
168
169 updateMouse(e, true);

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.95
updateThemeMethod · 0.95
getTextAreaMethod · 0.45

Tested by

no test coverage detected