Package jtrackbase.gui.table

Source Code of jtrackbase.gui.table.LabelTableModel

/* License see bottom */
package jtrackbase.gui.table;

import java.util.Collection;

import jtrackbase.db.Label;

public class LabelTableModel extends EntityTableModel<Label> {
  public LabelTableModel() {
    super();
  }
 
  public LabelTableModel(Collection<Label> coll) {
    super(coll);
  }
 
  @Override
  public Class<?> getColumnClass(int columnIndex) {
    return columnIndex==0?String.class:null;
  }

  @Override
  public int getColumnCount() {
    return 1;
  }

  @Override
  public String getColumnName(int columnIndex) {
    return columnIndex==0?"Name":null;
  }

  @Override
  public Object getValueAt(int rowIndex, int columnIndex) {
    Label m=get(rowIndex);
    if (m==null) {
      return null;
    }
    switch (columnIndex) {
    case 0:{
      return m.getName();
    }
    }
    return null;
  }
}

/*
    Copyright (C) 2008  Onkobu Tanaake

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program (gplv3.txt).
*/
TOP

Related Classes of jtrackbase.gui.table.LabelTableModel

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.