@@ -0,0 +1,2376 @@
+package net.sf.kerner.utils.swing.impl;%0A%0Aimport java.awt.Component;%0Aimport java.awt.event.ActionEvent;%0Aimport java.awt.event.ActionListener;%0Aimport java.util.ArrayList;%0Aimport java.util.EventListener;%0Aimport java.util.EventObject;%0Aimport java.util.List;%0A%0Aimport javax.swing.JButton;%0Aimport javax.swing.JTable;%0Aimport javax.swing.event.CellEditorListener;%0Aimport javax.swing.table.TableCellEditor;%0Aimport javax.swing.table.TableCellRenderer;%0A%0Apublic class TableButton extends JButton implements TableCellRenderer, TableCellEditor %7B%0A%0A    public static interface Listener extends EventListener %7B%0A        public void tableButtonClicked(int row, int col);%0A    %7D%0A%0A    private static final long serialVersionUID = 8772175735048815470L;%0A%0A    private final List%3CListener%3E listener = new ArrayList%3CListener%3E();%0A%0A    private int selectedColumn;%0A    private int selectedRow;%0A%0A    public TableButton(final String text) %7B%0A        super(text);%0A        addActionListener(new ActionListener() %7B%0A            public void actionPerformed(final ActionEvent e) %7B%0A                for (final Listener l : listener) %7B%0A                    l.tableButtonClicked(selectedRow, selectedColumn);%0A                %7D%0A            %7D%0A        %7D);%0A    %7D%0A%0A    public void addCellEditorListener(final CellEditorListener arg0) %7B%0A    %7D%0A%0A    public void addTableButtonListener(final Listener l) %7B%0A        listener.add(l);%0A    %7D%0A%0A    public void cancelCellEditing() %7B%0A    %7D%0A%0A    public Object getCellEditorValue() %7B%0A        return %22%22;%0A    %7D%0A%0A    public Component getTableCellEditorComponent(final JTable table, final Object value, final boolean isSelected,%0A            final int row, final int col) %7B%0A        selectedRow = row;%0A        selectedColumn = col;%0A        return this;%0A    %7D%0A%0A    public Component getTableCellRendererComponent(final JTable table, final Object value, final boolean isSelected,%0A            final boolean hasFocus, final int row, final int col) %7B%0A        return this;%0A    %7D%0A%0A    public boolean isCellEditable(final EventObject arg0) %7B%0A        return true;%0A    %7D%0A%0A    public void removeCellEditorListener(final CellEditorListener arg0) %7B%0A    %7D%0A%0A    public void removeTableButtonListener(final Listener l) %7B%0A        listener.remove(l);%0A    %7D%0A%0A    public boolean shouldSelectCell(final EventObject arg0) %7B%0A        return true;%0A    %7D%0A%0A    public boolean stopCellEditing() %7B%0A        return true;%0A    %7D%0A%7D

Introduce TableButton.