use of javax.swing.text.html.HTMLDocument 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.HTMLDocument in project jdk8u_jdk by JetBrains.
the class bug8028616 method main.
public static void main(String[] args) throws Exception {
ParserCB cb = new ParserCB();
HTMLEditorKit htmlKit = new HTMLEditorKit();
HTMLDocument htmlDoc = (HTMLDocument) htmlKit.createDefaultDocument();
htmlDoc.getParser().parse(new StringReader(text), cb, true);
synchronized (lock) {
if (!isCallbackInvoked) {
lock.wait(5000);
}
}
if (!isCallbackInvoked) {
throw new RuntimeException("Test Failed: ParserCallback.handleText() is not invoked for text - " + text);
}
if (exception != null) {
throw exception;
}
}
use of javax.swing.text.html.HTMLDocument in project adempiere by adempiere.
the class Help method loadInfo.
// jbInit
/*************************************************************************
* Load Info - Windows Help
* @param mWindow window model
*/
private void loadInfo(GridWindow mWindow) {
WebDoc doc = mWindow.getHelpDoc(true);
HTMLDocument htmlDoc = (HTMLDocument) info.getEditorKit().createDefaultDocument();
htmlDoc.getDocumentProperties().put("IgnoreCharsetDirective", true);
info.setDocument(htmlDoc);
info.setText(doc.toString());
}
use of javax.swing.text.html.HTMLDocument in project adempiere by adempiere.
the class Worker method dumpTags.
// run
/**
* Diagnostics
* @param doc html document
* @param tag html tag
*/
private void dumpTags(HTMLDocument doc, HTML.Tag tag) {
System.out.println("Doc=" + doc.getBase() + ", Tag=" + tag);
HTMLDocument.Iterator it = doc.getIterator(tag);
while (it != null && it.isValid()) {
AttributeSet as = it.getAttributes();
System.out.println("~ " + as);
it.next();
}
}
use of javax.swing.text.html.HTMLDocument 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