//# 0 errors, 58 messages
//#
/*
    //#HTMLLabel.java:1:1: class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#HTMLLabel.java:1:1: method: com.dmdirc.addons.ui_swing.components.text.HTMLLabel.com.dmdirc.addons.ui_swing.components.text.HTMLLabel__static_init
 * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.dmdirc.addons.ui_swing.components.text;

import java.awt.Font;

import javax.swing.JEditorPane;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicTextPaneUI;
import javax.swing.text.html.HTMLDocument;

/**
 * Dyamnic text label with hyperlink support.
 */
public class HTMLLabel extends JEditorPane {

    /**
     * A version number for this class. It should be changed whenever the
     * class structure is changed (or anything else that would prevent
     * serialized objects being unserialized with the new class).
     */
    private static final long serialVersionUID = 1;

    /**
     * Creates a new instance of TextLabel.
     */
    public HTMLLabel() {
        this(null);
    //#HTMLLabel.java:48: method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel.com.dmdirc.addons.ui_swing.components.text.HTMLLabel()
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): "; "._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): "body { font-family: "._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): "font-size: "._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): "pt; }"._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): this
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:javax.swing.plaf.basic.BasicTextPaneUI
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setUI
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setOpaque
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setEditable
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setHighlighter
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:javax.swing.UIManager:getFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:javax.swing.JEditorPane
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:getDocument
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:javax.swing.text.html.HTMLDocument:getStyleSheet
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:java.lang.StringBuilder
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:java.lang.StringBuilder:append
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:java.awt.Font:getFamily
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:java.awt.Font:getSize
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:java.lang.StringBuilder:toString
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel()): Effects-of-calling:javax.swing.text.html.StyleSheet:addRule
    }
    //#HTMLLabel.java:49: end of method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel.com.dmdirc.addons.ui_swing.components.text.HTMLLabel()

    /**
     * Creates a new instance of TextLabel.
     *
     * @param text Text to display
     */
    public HTMLLabel(final String text) {
        super("text/html", text);
    //#HTMLLabel.java:57: method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel.com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): "; "._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): "body { font-family: "._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): "font-size: "._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): "pt; }"._tainted
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): text
    //#input(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): this
    //#presumption(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): com.dmdirc.addons.ui_swing.components.text.HTMLLabel:getDocument(...)@60 != null
    //#presumption(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): javax.swing.UIManager:getFont(...)@59 != null
    //#presumption(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): javax.swing.text.html.HTMLDocument:getStyleSheet(...)@60 != null
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:javax.swing.plaf.basic.BasicTextPaneUI
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setUI
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setOpaque
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setEditable
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setHighlighter
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:javax.swing.UIManager:getFont
    //#unanalyzed(void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)): Effects-of-calling:com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setFont

        final Font font = UIManager.getFont("Label.font");
        ((HTMLDocument) getDocument()).getStyleSheet().addRule("body " +
    //#HTMLLabel.java:60: Warning: method not available - call not analyzed
    //#    call on Document com.dmdirc.addons.ui_swing.components.text.HTMLLabel:getDocument()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#    method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)
    //#    unanalyzed callee: Document com.dmdirc.addons.ui_swing.components.text.HTMLLabel:getDocument()
                "{ font-family: " + font.getFamily() + "; " + "font-size: " +
                font.getSize() + "pt; }");

        init();
    }
    //#HTMLLabel.java:65: end of method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel.com.dmdirc.addons.ui_swing.components.text.HTMLLabel(String)

    /** Initialiases the component. */
    private void init() {
        setUI(new BasicTextPaneUI());
    //#HTMLLabel.java:69: method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel.init()
    //#HTMLLabel.java:69: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setUI(TextUI)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#    method: void init()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setUI(TextUI)
    //#input(void init()): this
        setOpaque(false);
    //#HTMLLabel.java:70: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setOpaque(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#    method: void init()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setOpaque(bool)
        setEditable(false);
    //#HTMLLabel.java:71: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setEditable(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#    method: void init()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setEditable(bool)
        setHighlighter(null);
    //#HTMLLabel.java:72: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setHighlighter(Highlighter)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#    method: void init()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setHighlighter(Highlighter)
        setFont(UIManager.getFont("TextField.font"));
    //#HTMLLabel.java:73: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setFont(Font)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
    //#    method: void init()
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel:setFont(Font)
    }
    //#HTMLLabel.java:74: end of method: void com.dmdirc.addons.ui_swing.components.text.HTMLLabel.init()
}
    //#output(com.dmdirc.addons.ui_swing.components.text.HTMLLabel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/text/HTMLLabel]
    //#output(com.dmdirc.addons.ui_swing.components.text.HTMLLabel__static_init): __Dispatch_Table.init()V
    //#post(com.dmdirc.addons.ui_swing.components.text.HTMLLabel__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/text/HTMLLabel] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.text.HTMLLabel__static_init): __Dispatch_Table.init()V == &init
    //#HTMLLabel.java:: end of method: com.dmdirc.addons.ui_swing.components.text.HTMLLabel.com.dmdirc.addons.ui_swing.components.text.HTMLLabel__static_init
    //#HTMLLabel.java:: end of class: com.dmdirc.addons.ui_swing.components.text.HTMLLabel
