MCPcopy
hub / github.com/arduino/Arduino / popupMenuWillBecomeVisible

Method popupMenuWillBecomeVisible

app/src/processing/app/EditorTab.java:263–276  ·  view source on GitHub ↗
(PopupMenuEvent e)

Source from the content-addressed store, hash-verified

261 menu.addPopupMenuListener(new PopupMenuListener() {
262
263 @Override
264 public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
265 String referenceFile = editor.base.getPdeKeywords().getReference(getCurrentKeyword());
266 referenceItem.setEnabled(referenceFile != null);
267
268 int offset = textarea.getCaretPosition();
269 org.fife.ui.rsyntaxtextarea.Token token = RSyntaxUtilities.getTokenAtOffset(textarea, offset);
270 if (token != null && token.isHyperlink()) {
271 openURLItem.setEnabled(true);
272 openURLItem.setActionCommand(token.getLexeme());
273 } else {
274 openURLItem.setEnabled(false);
275 }
276 }
277
278 @Override
279 public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {

Callers

nothing calls this directly

Calls 5

getCurrentKeywordMethod · 0.95
getReferenceMethod · 0.80
getPdeKeywordsMethod · 0.80
setEnabledMethod · 0.45
getCaretPositionMethod · 0.45

Tested by

no test coverage detected