}
protected void activateLink(int pos, JEditorPane html, int type) {
Document doc = html.getDocument();
if (doc instanceof HTMLDocument) {
HTMLDocument hdoc = (HTMLDocument) doc;
Element e = hdoc.getCharacterElement(pos);
AttributeSet a = e.getAttributes();
AttributeSet anchor =
(AttributeSet) a.getAttribute(HTML.Tag.A);
String href = (anchor != null) ?
(String) anchor.getAttribute(HTML.Attribute.HREF) : null;
boolean shouldExit = false;
HyperlinkEvent linkEvent = null;
if (href != null) {
URL u;
try {
u = new URL(hdoc.getBase(), href);
} catch (MalformedURLException m) {
u = null;
}
if ((type == MOVE) && (!u.equals(currentUrl))) {