本文整理汇总了Java中org.eclipse.swt.SWT.BALLOON属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.BALLOON属性的具体用法?Java SWT.BALLOON怎么用?Java SWT.BALLOON使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.BALLOON属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTray
private void initTray() {
tray = display.getSystemTray();
if (tray != null) {
TrayItem trayItem = new TrayItem(tray, SWT.NONE);
trayItem.setImage(ImageUtils.getImage(Images.UNBLOCKED));
trayItem.setToolTipText(APP_NAME);
final Menu trayMenu = new Menu(getShell(), SWT.POP_UP);
MenuItem trayMenuItem = new MenuItem(trayMenu, SWT.PUSH);
trayMenuItem.setText(resourceBundle.getString("exit"));
trayMenuItem.addListener(SWT.Selection, event -> {
if (settings.isConfirmExit()) {
getShell().forceActive();
}
getShell().close();
});
trayItem.addListener(SWT.MenuDetect, event -> trayMenu.setVisible(true));
ToolTip tip = new ToolTip(getShell(), SWT.BALLOON | SWT.ICON_WARNING);
tip.setText(APP_NAME);
tip.setAutoHide(true);
tip.setVisible(false);
trayItem.setToolTip(tip);
}
}
示例2: createRegionActions
private IAction createRegionActions() {
final String regionViewName = PlotUtil.getRegionViewName();
final ToolTip tip = new ToolTip(viewer.getTable().getShell(), SWT.BALLOON);
MenuAction rois = new MenuAction("Add Region");
ActionContributionItem menu = (ActionContributionItem)system.getActionBars().getMenuManager().find(BasePlottingConstants.ADD_REGION);
IAction menuAction = (IAction)menu.getAction();
for (RegionType regionType : regionTypes) {
IAction action = new Action("Press to click and drag a "+regionType.getName()+" on '"+PlotUtil.getRegionViewName()+"'") {
@Override
public void run() {
try {
ScanRegions.createRegion(system, regionType, null);
ViewUtil.showTip(tip, "Click and drag in the '"+regionViewName+"' to create a scan region.");
} catch (Exception e) {
logger.error("Unable to create region!", e);
}
rois.setSelectedAction(this);
}
};
final ImageDescriptor des = findImageDescriptor(menuAction, regionType.getId());
action.setImageDescriptor(des);
rois.add(action);
}
rois.setSelectedAction(rois.getAction(0));
return rois;
}
示例3: showTip
private void showTip(String message) {
if (!store.getBoolean(DevicePreferenceConstants.SHOW_CONTROL_TOOLTIPS)) return;
if (tip==null) this.tip = new ToolTip(seriesTable.getControl().getShell(), SWT.BALLOON);
ViewUtil.showTip(tip, message);
}