use of javax.swing.text.html.HTMLFrameHyperlinkEvent in project android by JetBrains.
the class LintNotificationPanel method hyperlinkUpdate.
// ---- Implements HyperlinkListener ----
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
JEditorPane pane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
HTMLDocument doc = (HTMLDocument) pane.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
return;
}
String url = e.getDescription();
NlModel model = myScreenView.getModel();
Module module = model.getModule();
PsiFile file = model.getFile();
DataContext dataContext = DataManager.getInstance().getDataContext(myScreenView.getSurface());
assert dataContext != null;
myLinkManager.handleUrl(url, module, file, dataContext, null);
}
}
use of javax.swing.text.html.HTMLFrameHyperlinkEvent in project adempiere by adempiere.
the class Worker method hyperlinkUpdate.
/**************************************************************************
* Hyperlink Listener
* @param e event
*/
public void hyperlinkUpdate(HyperlinkEvent e) {
// System.out.println("OnlineHelp.hyperlinkUpdate - " + e.getDescription() + " " + e.getURL());
if (e.getEventType() != HyperlinkEvent.EventType.ACTIVATED)
return;
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
HTMLDocument doc = (HTMLDocument) getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
} else if (e.getURL() == null)
// remove # of the reference
scrollToReference(e.getDescription().substring(1));
else {
try {
setPage(e.getURL());
} catch (Throwable t) {
System.err.println("Help.hyperlinkUpdate - " + t.toString());
displayError("Error", e.getURL(), t);
}
}
this.setCursor(Cursor.getDefaultCursor());
}
Aggregations