ToolItem item = new ToolItem(bar, SWT.PUSH);
item.setText(getResourceString("ToolItem.text", new Object[] { new Integer(i) }));
item.setData("TIP_TEXT", getResourceString("ToolItem.tooltip", new Object[] { item.getText() }));
item.setData("TIP_HELPTEXTHANDLER", new ToolTipHelpTextHandler() {
public String getHelpText(Widget widget) {
Item item = (Item) widget;
return getResourceString("ToolItem.help", new Object[] { item.getText() });
}
});
}
GridData gridData = new GridData();
gridData.horizontalSpan = 3;
bar.setLayoutData(gridData);
tooltip.activateHoverHelp(bar);
Table table = new Table(frame, SWT.BORDER);
for (int i = 0; i < 4; i++) {
TableItem item = new TableItem(table, SWT.PUSH);
item.setText(getResourceString("Item", new Object[] { new Integer(i) }));
item.setData("TIP_IMAGE", images[HoverHelp.hhiInformation]);
item.setText(getResourceString("TableItem.text", new Object[] { new Integer(i) }));
item.setData("TIP_TEXT", getResourceString("TableItem.tooltip", new Object[] { item.getText() }));
item.setData("TIP_HELPTEXTHANDLER", new ToolTipHelpTextHandler() {
public String getHelpText(Widget widget) {
Item item = (Item) widget;
return getResourceString("TableItem.help", new Object[] { item.getText() });
}
});
}
table.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL));
tooltip.activateHoverHelp(table);
Tree tree = new Tree(frame, SWT.BORDER);
for (int i = 0; i < 4; i++) {
TreeItem item = new TreeItem(tree, SWT.PUSH);
item.setText(getResourceString("Item", new Object[] { new Integer(i) }));
item.setData("TIP_IMAGE", images[HoverHelp.hhiWarning]);
item.setText(getResourceString("TreeItem.text", new Object[] { new Integer(i) }));
item.setData("TIP_TEXT", getResourceString("TreeItem.tooltip", new Object[] { item.getText() }));
item.setData("TIP_HELPTEXTHANDLER", new ToolTipHelpTextHandler() {
public String getHelpText(Widget widget) {
Item item = (Item) widget;
return getResourceString("TreeItem.help", new Object[] { item.getText() });
}
});
}
tree.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL));
tooltip.activateHoverHelp(tree);