0
我正在製作Nebula Grid Table。我返回到方法的字符串不適合多行,同時它顯示在單行中。我正在使用下面的代碼來實現Multiline toooltip。但我仍然在單行中獲取該字符串。Nebula Grid的多行工具提示
ColumnViewerToolTipSupport toolTipSupport = new ColumnViewerToolTipSupport(col.getViewer(), SWT.NONE, false) {
@Override
protected Composite createToolTipContentArea(Event event, Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new FillLayout());
comp.setBounds(0, 0, 250, 250);
Text b = new Text(comp, SWT.LEFT);
b.setText(getText(event));
Activator.log("Text: " + getText(event), Status.INFO);
b.setBackground(new Color(null, 255, 0, 0));
b.setSize(250, 250);
// b.addSelectionListener(new SelectionAdapter() {
// @Override
// public void widgetSelected(SelectionEvent e) {
// hide();
// MessageBox box = new MessageBox(.getShell(),SWT.ICON_INFORMATION);
// box.setMessage("Hello World!");
// box.setText("Hello World");
// box.open();
// }
// });
return comp;
}
};