本文整理汇总了Java中org.eclipse.jface.window.DefaultToolTip类的典型用法代码示例。如果您正苦于以下问题:Java DefaultToolTip类的具体用法?Java DefaultToolTip怎么用?Java DefaultToolTip使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultToolTip类属于org.eclipse.jface.window包,在下文中一共展示了DefaultToolTip类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTootipConnectionStatus
import org.eclipse.jface.window.DefaultToolTip; //导入依赖的package包/类
public static void setTootipConnectionStatus(final UISynchronize uiSynchronize, final Control control,
final String host, final boolean connected) {
final DefaultToolTip toolTip = new DefaultToolTip(control);
toolTip.setShift(new Point(5, 5));
uiSynchronize.asyncExec(new Runnable() {
@Override
public void run() {
if (connected) {
toolTip.setText("Connected to " + host);
} else {
toolTip.setText("Disconnected");
}
}
});
}
示例2: createApiDescForm
import org.eclipse.jface.window.DefaultToolTip; //导入依赖的package包/类
private void createApiDescForm(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout(1, true));
Label apiDesc = new Label(comp, SWT.BORDER);
apiDesc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
apiDesc.setFont(new Font(null, "Arial", 11, SWT.BOLD));
apiDesc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
apiDesc.setText(" [ Api Help ] ");
Composite tableComp = new Composite(comp, SWT.NONE);
tableComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
tableColumnLayout = new TableColumnLayout();
tableComp.setLayout(tableColumnLayout);
viewer = new TableViewer(tableComp, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
createColumns();
table = viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
viewer.setContentProvider(new ArrayContentProvider());
viewer.setComparator(new ColumnLabelSorter(viewer));
toolTip = new DefaultToolTip(table, DefaultToolTip.RECREATE, true);
toolTip.setFont(new Font(null, "Arial", 11, SWT.BOLD));
toolTip.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
addApiDescTableListener();
}
示例3: showToolTipSWTJface
import org.eclipse.jface.window.DefaultToolTip; //导入依赖的package包/类
private static void showToolTipSWTJface(Control control, int style, String title, String message) {
DefaultToolTip tooltip = new DefaultToolTip(control, org.eclipse.jface.window.ToolTip.NO_RECREATE, true);
tooltip.setHideDelay(TOOLTIP_HIDE_DELAY);
tooltip.setText("[" + title+ "]\n\n" + message);
tooltip.setImage(control.getDisplay().getSystemImage(/*SWT.ICON_INFORMATION*/ style));
tooltip.show(control.toDisplay(control.getSize().x/2, 5));
}
示例4: ToolTipListener
import org.eclipse.jface.window.DefaultToolTip; //导入依赖的package包/类
/**
* Creates a tooltip listener.
*
* @param control the control to attach to
* @param tooltip the tooltip string
*/
public ToolTipListener(Control control, String tooltip) {
this.control = control;
this.tooltip = new DefaultToolTip(control, ToolTip.NO_RECREATE, true);
this.tooltip.setText(tooltip);
this.tooltip.setHideDelay(0);
}
示例5: atachTooltip
import org.eclipse.jface.window.DefaultToolTip; //导入依赖的package包/类
private void atachTooltip(){
DefaultToolTip toolTip = new FindingsNatTableTooltip(natTable, dataProvider);
toolTip.setPopupDelay(250);
toolTip.activate();
toolTip.setShift(new Point(10, 10));
}