//# 0 errors, 44 messages
//#
/*
    //#ContainerToggleButton.java:1:1: class: com.dmdirc.addons.ui_swing.components.ContainerToggleButton
    //#ContainerToggleButton.java:1:1: method: com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton__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;

import javax.swing.Icon;
import javax.swing.JToggleButton;

/**
 * JButton that holds an object.
 * 
 * @param <T> Holds an object of this type
 */
public class ContainerToggleButton<T> extends JToggleButton {

    /**
     * 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;
    /** Contents. */
    private T contents;

    /**
     * Instantiates a new container button.
     * 
     * @param contents Contents
     * @param string Title
     * @param icon Icon
     */
    public ContainerToggleButton(final T contents, final String string,
            final Icon icon) {
        super(string, icon);
    //#ContainerToggleButton.java:53: method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String, Icon)
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String, Icon)): icon
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String, Icon)): string
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String, Icon)): this
    }
    //#ContainerToggleButton.java:54: end of method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String, Icon)

    /**
     * Instantiates a new container button.
     * 
     * @param contents Contents
     * @param string Title
     */
    public ContainerToggleButton(final T contents, final String string) {
        super(string);
    //#ContainerToggleButton.java:63: method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String)
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String)): string
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String)): this
    }
    //#ContainerToggleButton.java:64: end of method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, String)

    /**
     * Instantiates a new container button.
     * 
     * @param contents Contents
     * @param icon Icon
     */
    public ContainerToggleButton(final T contents, final Icon icon) {
        super(icon);
    //#ContainerToggleButton.java:73: method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, Icon)
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, Icon)): icon
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, Icon)): this
    }
    //#ContainerToggleButton.java:74: end of method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object, Icon)

    /**
     * Instantiates a new container button.
     * 
     * @param contents Contents
     */
    public ContainerToggleButton(final T contents) {
        super();
    //#ContainerToggleButton.java:82: method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object)
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object)): this
    }
    //#ContainerToggleButton.java:83: end of method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton(Object)

    /**
     * Instantiates a new container button.
     */
    public ContainerToggleButton() {
        super();
    //#ContainerToggleButton.java:89: method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton()
    //#input(void com.dmdirc.addons.ui_swing.components.ContainerToggleButton()): this
    }
    //#ContainerToggleButton.java:90: end of method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton()

    /**
     * Gets the button's contents
     * 
     * @return Button contents
     */
    public T getContents() {
        return contents;
    //#ContainerToggleButton.java:98: method: Object com.dmdirc.addons.ui_swing.components.ContainerToggleButton.getContents()
    //#input(Object getContents()): this
    //#input(Object getContents()): this.contents
    //#output(Object getContents()): return_value
    //#pre[2] (Object getContents()): init'ed(this.contents)
    //#post(Object getContents()): return_value == this.contents
    //#post(Object getContents()): init'ed(return_value)
    //#ContainerToggleButton.java:98: end of method: Object com.dmdirc.addons.ui_swing.components.ContainerToggleButton.getContents()
    }

    /**
     * Sets the button's contents
     * 
     * @param contents New contents
     */
    public void setValue(final T contents) {
        this.contents = contents;
    //#ContainerToggleButton.java:107: method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.setValue(Object)
    //#input(void setValue(Object)): contents
    //#input(void setValue(Object)): this
    //#output(void setValue(Object)): this.contents
    //#post(void setValue(Object)): this.contents == contents
    //#post(void setValue(Object)): init'ed(this.contents)
    }
    //#ContainerToggleButton.java:108: end of method: void com.dmdirc.addons.ui_swing.components.ContainerToggleButton.setValue(Object)
}
    //#output(com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/ContainerToggleButton]
    //#output(com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init): __Dispatch_Table.getContents()Ljava/lang/Object;
    //#output(com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init): __Dispatch_Table.setValue(Ljava/lang/Object;)V
    //#post(com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/ContainerToggleButton] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init): __Dispatch_Table.getContents()Ljava/lang/Object; == &getContents
    //#post(com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init): __Dispatch_Table.setValue(Ljava/lang/Object;)V == &setValue
    //#ContainerToggleButton.java:: end of method: com.dmdirc.addons.ui_swing.components.ContainerToggleButton.com.dmdirc.addons.ui_swing.components.ContainerToggleButton__static_init
    //#ContainerToggleButton.java:: end of class: com.dmdirc.addons.ui_swing.components.ContainerToggleButton
