本文整理匯總了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);
}