01: package net.sourceforge.squirrel_sql.plugins.graph;
02:
03: import javax.swing.*;
04: import java.awt.event.MouseEvent;
05:
06: public class ColumnTextArea extends JTextArea {
07: private TableToolTipProvider _toolTipProvider;
08:
09: public ColumnTextArea(TableToolTipProvider toolTipProvider) {
10: _toolTipProvider = toolTipProvider;
11: setToolTipText("Just to make getToolTiptext() to be called");
12: }
13:
14: public String getToolTipText(MouseEvent event) {
15: return _toolTipProvider.getToolTipText(event);
16: }
17:
18: /**
19: * Not named setColumns() because it would be an overload.
20: * @param columnInfos
21: */
22: public void setGraphColumns(ColumnInfo[] columnInfos) {
23: StringBuffer sb = new StringBuffer();
24: for (int i = 0; i < columnInfos.length; i++) {
25: columnInfos[i].setIndex(i);
26: sb.append(columnInfos[i]).append('\n');
27: }
28: setText(sb.toString());
29: }
30: }
|