1
2
3
4
5
6
7
8
9
10
11 package de.jaret.util.ui.table.strategies;
12
13 import java.util.List;
14
15 import de.jaret.util.ui.table.JaretTable;
16 import de.jaret.util.ui.table.model.IJaretTableCell;
17
18 /***
19 * Defaut implementation of a fill drag strategy: simply copy the content.
20 *
21 * @author Peter Kliem
22 * @version $Id: DefaultFillDragStrategy.java 394 2007-05-01 10:51:25Z olk $
23 */
24 public class DefaultFillDragStrategy implements IFillDragStrategy {
25
26 /***
27 * {@inheritDoc}
28 */
29 public void doFill(JaretTable table, IJaretTableCell firstCell, List<IJaretTableCell> cells) {
30 Object value = firstCell.getColumn().getValue(firstCell.getRow());
31 for (IJaretTableCell cell : cells) {
32
33 if (table.getTableModel().isEditable(cell.getRow(), cell.getColumn())) {
34 try {
35 cell.getColumn().setValue(cell.getRow(), value);
36 } catch (Exception e) {
37
38 }
39 }
40 }
41 }
42
43 }