Example usage for javax.swing.event HyperlinkEvent getSourceElement

List of usage examples for javax.swing.event HyperlinkEvent getSourceElement

Introduction

In this page you can find the example usage for javax.swing.event HyperlinkEvent getSourceElement.

Prototype

public Element getSourceElement() 

Source Link

Document

Returns the Element that corresponds to the source of the event.

Usage

From source file:net.java.sip.communicator.impl.gui.main.chat.ChatConversationPanel.java

/**
 * Opens a link in the default browser when clicked and shows link url in a
 * popup on mouseover./*from w  ww.j  a v  a  2 s .c  o  m*/
 *
 * @param e The HyperlinkEvent.
 */
public void hyperlinkUpdate(HyperlinkEvent e) {
    if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) {
        String href = e.getDescription();

        this.isCurrentHrefImg = e.getSourceElement().getName().equals("img");
        this.currentHref = href;
    } else if (e.getEventType() == HyperlinkEvent.EventType.EXITED) {
        this.currentHref = "";
        this.isCurrentHrefImg = false;
    }
}