Package clips.contract

Source Code of clips.contract.TableCellRendererContractSearch

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package clips.contract;

import cli_fmw.main.ClipsException;
import cli_fmw.utils.sorted_table.renderer.LabelRenderer;
import clips.delegate.contract.ContractLocal;
import framework.utils.Converter;
import java.awt.Color;
import java.util.Date;
import javax.swing.JTable;
import javax.swing.table.TableModel;

/**
*
* @author finder
*/
public class TableCellRendererContractSearch extends LabelRenderer {
  @Override
  protected void modifyErrorTableCellRendererComponent(JTable table, Object value, int row, int col) throws ClipsException {
    TableModel          model = table.getModel();
    if (!(model instanceof TableModelContractList)){
      return;
    }
    ContractLocal        contract = ((TableModelContractList)model).getRowValue(row);
    if (contract.isOpen()){
      render().setForeground(table.getForeground());
    }
    else{
      render().setForeground(Color.GRAY);
    }
  }

    @Override
    protected void setValue(Object value) {
        if (value instanceof Date) {
            super.setValue(Converter.dateToString((Date) value));
        }
        else {
            super.setValue(value);
        }
    }
}
TOP

Related Classes of clips.contract.TableCellRendererContractSearch

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.