/**
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 *
 * Copyright (C)
 * <a href="http://www.inab.org">Spanish National Institute of Bioinformatics (INB)</a>
 * <a href="http://www.bsc.es">Barcelona Supercomputing Center (BSC)</a>
 * <a href="http://inb.bsc.es">Computational Node 6</a>
 */

package org.inb.biomoby.central.gui;

import javax.swing.table.TableColumn;
import org.inb.biomoby.central.model.DatatypesModel;
import org.inb.biomoby.central.gui.model.MobyPropertiesTableModel;
import org.inb.biomoby.central.gui.renderer.ObjectTypeTableCellEditor;

/**
 * @author Dmitry Repchevsky
 */

public class MobyPropertyTable extends AbstractMobyPropertyTable
{
    public MobyPropertyTable()
    {
        TableColumn typeNameColumn = columnModel.getColumn(0);
        typeNameColumn.setHeaderValue("Object Type");

        ObjectTypeTableCellEditor objectTypeTableCellEditor = new ObjectTypeTableCellEditor(DatatypesModel.instance());

        typeNameColumn.setCellEditor(objectTypeTableCellEditor);

        TableColumn propertyNameColumn = columnModel.getColumn(1);
        propertyNameColumn.setHeaderValue("Property name");

        TableColumn cardinalityColumn = columnModel.getColumn(2);
        cardinalityColumn.setHeaderValue("Relationship");
    }

    @Override
    protected MobyPropertiesTableModel createDefaultDataModel()
    {
        return new MobyPropertiesTableModel();
    }
}
