//# 0 errors, 31 messages
//#
/*
    //#ActionTypeTableCellRenderer.java:1:1: class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#ActionTypeTableCellRenderer.java:1:1: method: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer__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.renderers;

import com.dmdirc.actions.interfaces.ActionType;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

/**
 * Displays actions types and headers in a pretty fashion.
 */
public final class ActionTypeTableCellRenderer extends DefaultTableCellRenderer {
    
    /**
     * 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 ActionTypeRenderer.
     */
    public ActionTypeTableCellRenderer() {
        super();
    //#ActionTypeTableCellRenderer.java:50: method: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer()
    //#input(void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer()): this
    }
    //#ActionTypeTableCellRenderer.java:51: end of method: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer()
    
    /** {@inheritDoc} */
    @Override
    public void setValue(final Object value) {        
        if (value == null) {
    //#ActionTypeTableCellRenderer.java:56: method: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer.setValue(Object)
    //#input(void setValue(Object)): java.awt.Color.GRAY
    //#input(void setValue(Object)): this
    //#input(void setValue(Object)): value
    //#input(void setValue(Object)): value._tainted
    //#presumption(void setValue(Object)): com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:getFont(...)@60 != null
    //#presumption(void setValue(Object)): init'ed(java.awt.Color.GRAY)
    //#test_vector(void setValue(Object)): value: Inverse{null}, Addr_Set{null}
    //#test_vector(void setValue(Object)): com.dmdirc.actions.interfaces.ActionType:instanceof(...)@62: {0}, {1}
    //#test_vector(void setValue(Object)): java.lang.String:instanceof(...)@58: {0}, {1}
    //#test_vector(void setValue(Object)): java.lang.String:isEmpty(...)@58: {1}, {0}
            setText("");
    //#ActionTypeTableCellRenderer.java:57: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
        } else if (value instanceof String && !((String) value).isEmpty()) {
            setBackground(Color.GRAY);
    //#ActionTypeTableCellRenderer.java:59: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setBackground(Color)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setBackground(Color)
            setFont(getFont().deriveFont(Font.BOLD));
    //#ActionTypeTableCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on Font com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:getFont()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: Font com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:getFont()
    //#ActionTypeTableCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setFont(Font)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setFont(Font)
            setText(value.toString());
    //#ActionTypeTableCellRenderer.java:61: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
        } else if (value instanceof ActionType) {
            setText(((ActionType) value).getName());
    //#ActionTypeTableCellRenderer.java:63: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.actions.interfaces.ActionType:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: String com.dmdirc.actions.interfaces.ActionType:getName()
    //#ActionTypeTableCellRenderer.java:63: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
        } else {
            setText(value.toString());
    //#ActionTypeTableCellRenderer.java:65: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer:setText(String)
        }
    }
    //#ActionTypeTableCellRenderer.java:67: end of method: void com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer.setValue(Object)
    
}
    //#output(com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer]
    //#output(com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer__static_init): __Dispatch_Table.setValue(Ljava/lang/Object;)V
    //#post(com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/renderers/ActionTypeTableCellRenderer] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer__static_init): __Dispatch_Table.setValue(Ljava/lang/Object;)V == &setValue
    //#ActionTypeTableCellRenderer.java:: end of method: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer__static_init
    //#ActionTypeTableCellRenderer.java:: end of class: com.dmdirc.addons.ui_swing.components.renderers.ActionTypeTableCellRenderer
