//# 0 errors, 32 messages
//#
/*
    //#ActionConditionCellRenderer.java:1:1: class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#ActionConditionCellRenderer.java:1:1: method: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer__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.ActionCondition;
import com.dmdirc.actions.CoreActionComparison;

import javax.swing.table.DefaultTableCellRenderer;

/**
 * Renders an action condition in plain english.
 */
public final class ActionConditionCellRenderer 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 = 2;
    
    /** Creates a new instance of ActionConditionCellRenderer. */
    public ActionConditionCellRenderer() {
        super();
    //#ActionConditionCellRenderer.java:44: method: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer()
    //#input(void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer()): this
    }
    //#ActionConditionCellRenderer.java:45: end of method: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer()
    
    /** {@inheritDoc} */
    @Override
    public void setValue(final Object value) {
        if (value == null) {
    //#ActionConditionCellRenderer.java:50: method: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer.setValue(Object)
    //#input(void setValue(Object)): " "._tainted
    //#input(void setValue(Object)): com.dmdirc.actions.CoreActionComparison.INT_EQUALS
    //#input(void setValue(Object)): com.dmdirc.actions.CoreActionComparison.INT_GREATER
    //#input(void setValue(Object)): com.dmdirc.actions.CoreActionComparison.INT_LESS
    //#input(void setValue(Object)): this
    //#input(void setValue(Object)): value
    //#input(void setValue(Object)): value._tainted
    //#presumption(void setValue(Object)): com.dmdirc.actions.ActionCondition:getComparison(...)@60 != null
    //#presumption(void setValue(Object)): init'ed(com.dmdirc.actions.CoreActionComparison.INT_EQUALS)
    //#presumption(void setValue(Object)): init'ed(com.dmdirc.actions.CoreActionComparison.INT_GREATER)
    //#presumption(void setValue(Object)): init'ed(com.dmdirc.actions.CoreActionComparison.INT_LESS)
    //#test_vector(void setValue(Object)): value: Inverse{null}, Addr_Set{null}
            setText("Any");
    //#ActionConditionCellRenderer.java:51: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer:setText(String)
            return;
        }
        
        final ActionCondition condition = (ActionCondition) value;
        
        if (condition.getComparison() == CoreActionComparison.INT_EQUALS 
    //#ActionConditionCellRenderer.java:57: Warning: method not available - call not analyzed
    //#    call on ActionComparison com.dmdirc.actions.ActionCondition:getComparison()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: ActionComparison com.dmdirc.actions.ActionCondition:getComparison()
                || condition.getComparison() == CoreActionComparison.INT_GREATER 
                || condition.getComparison() == CoreActionComparison.INT_LESS) {
            setText(condition.getComparison().getName() + " " + condition.getTarget());
    //#ActionConditionCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on ActionComparison com.dmdirc.actions.ActionCondition:getComparison()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: ActionComparison com.dmdirc.actions.ActionCondition:getComparison()
    //#ActionConditionCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.actions.interfaces.ActionComparison:getName()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: String com.dmdirc.actions.interfaces.ActionComparison:getName()
    //#ActionConditionCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on String com.dmdirc.actions.ActionCondition:getTarget()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: String com.dmdirc.actions.ActionCondition:getTarget()
    //#ActionConditionCellRenderer.java:60: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer:setText(String)
        } else {
            setText(value.toString());
    //#ActionConditionCellRenderer.java:62: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer:setText(String)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
    //#    method: void setValue(Object)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer:setText(String)
        }
    }
    //#ActionConditionCellRenderer.java:64: end of method: void com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer.setValue(Object)
    
}
    //#output(com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/renderers/ActionConditionCellRenderer]
    //#output(com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer__static_init): __Dispatch_Table.setValue(Ljava/lang/Object;)V
    //#post(com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/components/renderers/ActionConditionCellRenderer] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer__static_init): __Dispatch_Table.setValue(Ljava/lang/Object;)V == &setValue
    //#ActionConditionCellRenderer.java:: end of method: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer.com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer__static_init
    //#ActionConditionCellRenderer.java:: end of class: com.dmdirc.addons.ui_swing.components.renderers.ActionConditionCellRenderer
