Author: sbavencoff Date: 2013-12-31 16:06:23 +0100 (Tue, 31 Dec 2013) New Revision: 3724 Url: http://chorem.org/projects/lima/repository/revisions/3724 Log: Factoring code of table and model table. Added: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/DefaultColumn.java Removed: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionColumn.java Copied: trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/DefaultColumn.java (from rev 3719, trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionColumn.java) =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/DefaultColumn.java (rev 0) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/common/DefaultColumn.java 2013-12-31 15:06:23 UTC (rev 3724) @@ -0,0 +1,65 @@ +package org.chorem.lima.ui.common; + +/* + * #%L + * Lima :: Swing + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2008 - 2013 CodeLutin + * %% + * 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. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ + +import javax.swing.table.TableCellEditor; +import javax.swing.table.TableCellRenderer; + +/** + * @author Sylvain Bavencoff <bavencoff@codelutin.com> + */ +public abstract class DefaultColumn<T extends AbstractLimaTableModel> implements Column<T> { + + protected T tableModel; + + protected TableCellRenderer renderer; + + protected TableCellEditor editor; + + @Override + public void setTableModel(T tableModel) { + this.tableModel = tableModel; + } + + @Override + public TableCellRenderer getCellRenderer(int row) { + return renderer; + } + + @Override + public TableCellEditor getCellEditor(int row) { + return editor; + } + + @Override + public boolean isCellEditable(int row) { + return false; + } + + @Override + public boolean setValueAt(Object value, int row) { + return false; + } +} Deleted: trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionColumn.java =================================================================== --- trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionColumn.java 2013-12-31 15:06:05 UTC (rev 3723) +++ trunk/lima-swing/src/main/java/org/chorem/lima/ui/financialtransaction/FinancialTransactionColumn.java 2013-12-31 15:06:23 UTC (rev 3724) @@ -1,59 +0,0 @@ -package org.chorem.lima.ui.financialtransaction; - -/* - * #%L - * Lima :: Swing - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2008 - 2013 CodeLutin - * %% - * 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. If not, see - * <http://www.gnu.org/licenses/gpl-3.0.html>. - * #L% - */ - -import org.chorem.lima.ui.common.Column; - -import javax.swing.table.TableCellEditor; -import javax.swing.table.TableCellRenderer; - -/** - * @author Sylvain Bavencoff <bavencoff@codelutin.com> - */ -public abstract class FinancialTransactionColumn implements Column { - - protected FinancialTransactionTableModel tableModel; - - protected TableCellRenderer renderer; - - protected TableCellEditor editor; - - - public FinancialTransactionColumn(FinancialTransactionTableModel tableModel) { - this.tableModel = tableModel; - this.renderer = null; - this.editor = null; - } - - @Override - public TableCellRenderer getCellRenderer(int row) { - return renderer; - } - - @Override - public TableCellEditor getCellEditor(int row) { - return editor; - } -}
participants (1)
-
sbavencoffļ¼ users.chorem.org