Package org.swingml.component

Source Code of org.swingml.component.TableCellIconDecorator

package org.swingml.component;

import java.util.*;

import javax.swing.table.*;

import org.swingml.model.*;

import org.swingml.model.TableColumnModel;


public class TableCellIconDecorator {

    public TableCellIconDecorator (JTableComponent aTable) {
        super();
        JTableModel theTableModel = (JTableModel) aTable.getModel();
        Iterator theColumns = theTableModel.getColumns().iterator();
        TableColumnModel theColumn = null;
        while (theColumns.hasNext()) {
            theColumn = (TableColumnModel) theColumns.next();
            TableCellRenderer originalRenderer = aTable.getDefaultRenderer(theColumn.getType().getClass());
            if (!(originalRenderer instanceof TableCellIconRenderer)) {
                aTable.setDefaultRenderer(theColumn.getType().getClass(), new TableCellIconRenderer(originalRenderer));
            }
        }
    }
}
TOP

Related Classes of org.swingml.component.TableCellIconDecorator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.