01: package org.osbl.client.wings.control;
02:
03: import org.osbl.client.wings.shell.Tool;
04: import org.concern.Controller;
05: import org.concern.Subject;
06: import org.wings.*;
07: import org.wings.table.SDefaultTableCellRenderer;
08: import org.wingx.XScrollPane;
09: import org.wingx.XTable;
10:
11: import java.util.*;
12:
13: /**
14: * @author hengels
15: * @version $Revision$
16: */
17: class LogTable extends XScrollPane implements Plugin {
18: XTable table;
19: LogTableModel logModel;
20:
21: public LogTable() {
22: logModel = new LogTableModel();
23: table = new XTable(logModel);
24: table.setEditable(false);
25: table.setPreferredSize(SDimension.FULLWIDTH);
26: table.setSelectionMode(SListSelectionModel.NO_SELECTION);
27: table.getColumnModel().getColumn(4).setCellRenderer(
28: new SDefaultTableCellRenderer() {
29: public SComponent getTableCellRendererComponent(
30: STable table, Object value,
31: boolean selected, int row, int col) {
32: String details = (String) value;
33: if (details != null && details.length() > 40)
34: value = details.substring(0, 40) + " ...";
35:
36: SComponent component = super
37: .getTableCellRendererComponent(table,
38: value, selected, row, col);
39: if (details != value)
40: component.setToolTipText(details);
41: return component;
42: }
43: });
44: setViewportView(table);
45: }
46:
47: public void update() {
48: logModel.refresh();
49: }
50:
51: public void setController(Controller controller) {
52: logModel.setController(controller);
53: }
54:
55: public void setSubject(Subject subject) {
56: logModel.setSubject(subject);
57: }
58:
59: public void setArchive(boolean archive) {
60: logModel.setArchive(archive);
61: }
62:
63: public List<Tool> getTools() {
64: return Collections.EMPTY_LIST;
65: }
66: }
|