//# 0 errors, 46 messages
//#
/*
    //#ErrorTable.java:1:1: class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#ErrorTable.java:1:1: method: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable.com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable__static_init
 * 
 * Copyright (c) 2006-2008 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.dialogs.error;

import com.dmdirc.addons.ui_swing.components.PackingTable;

import com.dmdirc.addons.ui_swing.components.renderers.DateCellRenderer;
import com.dmdirc.addons.ui_swing.components.renderers.ErrorLevelIconCellRenderer;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.table.TableCellRenderer;

/**
 * Table listing ProgramErrors in the client.
 */
public class ErrorTable extends PackingTable {

    private static final long serialVersionUID = 3994014806819705247L;

    /**
     * Table listing ProgramErrors in the client.
     *
     * @param tableModel Table model
     * @param scrollPane Parent scrollpane
     */
    public ErrorTable(final ErrorTableModel tableModel,
            final JScrollPane scrollPane) {
        super(tableModel, false, scrollPane, true);
    //#ErrorTable.java:49: method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable.com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#ErrorTable.java:49: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.components.PackingTable(TableModel, bool, JScrollPane, bool)
    //#input(void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)): scrollPane
    //#input(void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)): tableModel
    //#input(void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)): this
    //#presumption(void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)): com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:getRowSorter(...)@59 != null
    //#presumption(void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)): com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:getTableHeader(...)@60 != null

        setAutoCreateRowSorter(true);
    //#ErrorTable.java:51: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setAutoCreateRowSorter(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setAutoCreateRowSorter(bool)
        setAutoCreateColumnsFromModel(true);
    //#ErrorTable.java:52: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setAutoCreateColumnsFromModel(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setAutoCreateColumnsFromModel(bool)
        setColumnSelectionAllowed(false);
    //#ErrorTable.java:53: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setColumnSelectionAllowed(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setColumnSelectionAllowed(bool)
        setCellSelectionEnabled(false);
    //#ErrorTable.java:54: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setCellSelectionEnabled(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setCellSelectionEnabled(bool)
        setDragEnabled(false);
    //#ErrorTable.java:55: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setDragEnabled(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setDragEnabled(bool)
        setFillsViewportHeight(false);
    //#ErrorTable.java:56: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setFillsViewportHeight(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setFillsViewportHeight(bool)
        setRowSelectionAllowed(true);
    //#ErrorTable.java:57: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setRowSelectionAllowed(bool)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setRowSelectionAllowed(bool)
        setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    //#ErrorTable.java:58: Warning: method not available - call not analyzed
    //#    call on void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setSelectionMode(int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:setSelectionMode(int)
        getRowSorter().toggleSortOrder(0);
    //#ErrorTable.java:59: Warning: method not available - call not analyzed
    //#    call on RowSorter com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:getRowSorter()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: RowSorter com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:getRowSorter()
        getTableHeader().setReorderingAllowed(false);
    //#ErrorTable.java:60: Warning: method not available - call not analyzed
    //#    call on JTableHeader com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:getTableHeader()
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)
    //#    unanalyzed callee: JTableHeader com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable:getTableHeader()
    }
    //#ErrorTable.java:61: end of method: void com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable.com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable(ErrorTableModel, JScrollPane)

    /** {@inheritDoc} */
    @Override
    public TableCellRenderer getCellRenderer(final int row,
            final int column) {
        switch (column) {
    //#ErrorTable.java:67: method: TableCellRenderer com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable.getCellRenderer(int, int)
    //#input(TableCellRenderer getCellRenderer(int, int)): column
    //#input(TableCellRenderer getCellRenderer(int, int)): row
    //#input(TableCellRenderer getCellRenderer(int, int)): this
    //#output(TableCellRenderer getCellRenderer(int, int)): new DateCellRenderer(getCellRenderer#1) num objects
    //#output(TableCellRenderer getCellRenderer(int, int)): new DateCellRenderer(getCellRenderer#1).__Tag
    //#output(TableCellRenderer getCellRenderer(int, int)): new ErrorLevelIconCellRenderer(getCellRenderer#2) num objects
    //#output(TableCellRenderer getCellRenderer(int, int)): new ErrorLevelIconCellRenderer(getCellRenderer#2).__Tag
    //#output(TableCellRenderer getCellRenderer(int, int)): return_value
    //#new obj(TableCellRenderer getCellRenderer(int, int)): new DateCellRenderer(getCellRenderer#1)
    //#new obj(TableCellRenderer getCellRenderer(int, int)): new ErrorLevelIconCellRenderer(getCellRenderer#2)
    //#post(TableCellRenderer getCellRenderer(int, int)): init'ed(return_value)
    //#post(TableCellRenderer getCellRenderer(int, int)): new DateCellRenderer(getCellRenderer#1) num objects <= 1
    //#post(TableCellRenderer getCellRenderer(int, int)): new DateCellRenderer(getCellRenderer#1).__Tag == com/dmdirc/addons/ui_swing/components/renderers/DateCellRenderer
    //#post(TableCellRenderer getCellRenderer(int, int)): new ErrorLevelIconCellRenderer(getCellRenderer#2) num objects <= 1
    //#post(TableCellRenderer getCellRenderer(int, int)): new ErrorLevelIconCellRenderer(getCellRenderer#2).__Tag == com/dmdirc/addons/ui_swing/components/renderers/ErrorLevelIconCellRenderer
    //#unanalyzed(TableCellRenderer getCellRenderer(int, int)): Effects-of-calling:javax.swing.table.DefaultTableCellRenderer
    //#test_vector(TableCellRenderer getCellRenderer(int, int)): column: {1}, {2}, {-2_147_483_648..0, 3..4_294_967_295}
            case 1:
                return new DateCellRenderer();
            case 2:
                return new ErrorLevelIconCellRenderer();
            default:
                return super.getCellRenderer(row, column);
    //#ErrorTable.java:73: Warning: method not available - call not analyzed
    //#    call on TableCellRenderer com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(int, int)
    //#    severity: INFORMATIONAL
    //#    class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
    //#    method: TableCellRenderer getCellRenderer(int, int)
    //#    unanalyzed callee: TableCellRenderer com.dmdirc.addons.ui_swing.components.PackingTable:getCellRenderer(int, int)
    //#ErrorTable.java:73: end of method: TableCellRenderer com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable.getCellRenderer(int, int)
        }
    }
}
    //#output(com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/error/ErrorTable]
    //#output(com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable__static_init): __Dispatch_Table.getCellRenderer(II)Ljavax/swing/table/TableCellRenderer;
    //#post(com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable__static_init): __Descendant_Table[com/dmdirc/addons/ui_swing/dialogs/error/ErrorTable] == &__Dispatch_Table
    //#post(com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable__static_init): __Dispatch_Table.getCellRenderer(II)Ljavax/swing/table/TableCellRenderer; == &getCellRenderer
    //#ErrorTable.java:: end of method: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable.com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable__static_init
    //#ErrorTable.java:: end of class: com.dmdirc.addons.ui_swing.dialogs.error.ErrorTable
