本文整理汇总了Java中org.eclipse.swt.widgets.ToolTip.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java ToolTip.setVisible方法的具体用法?Java ToolTip.setVisible怎么用?Java ToolTip.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.ToolTip
的用法示例。
在下文中一共展示了ToolTip.setVisible方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createAndShowBalloonToolTip
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
public static ToolTip createAndShowBalloonToolTip(Shell shell, int iconStyle, String message, String title, int pos, boolean autohide) {
int posX = shell.getLocation().x;
int posY = shell.getLocation().y;
if (pos == 1) {
posX += shell.getSize().x;
}
else if (pos == 2) {
posX += shell.getSize().x;
posY += shell.getSize().y;
}
else {
posY += shell.getSize().y;
}
ToolTip tt = createBallonToolTip(shell, iconStyle, message, title, posX, posY);
tt.setAutoHide(autohide);
tt.setVisible(true);
return tt;
}
示例2: canConnectToSource
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
@Override
public boolean canConnectToSource(INode oldSource, INode newSource,
INode target, EConnectionType lineStyle, String connectorName,
String connectionName) {
if (oldSource != null
&& newSource != null
&& (T_REST_REQUEST.equals(newSource.getComponent().getName()) || T_REST_REQUEST
.equals(oldSource.getComponent().getName()))) {
ToolTip tooltip = new ToolTip(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), SWT.ICON_WARNING);
tooltip.setText(Messages.RESTRequestReconnectionValidation_WarningMsg);
// tooltip.setMessage("It's not allowed to reconnect to or from a tRESTRequest component");
tooltip.setAutoHide(true);
tooltip.setVisible(true);
return false;
}
return true;
}
示例3: showTip
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
/**
* Show the top where the mouse is.
* @param tip
* @param message
*/
public static void showTip(ToolTip tip, String message) {
if (tip==null) return;
tip.setMessage(message);
PointerInfo a = MouseInfo.getPointerInfo();
java.awt.Point loc = a.getLocation();
tip.setLocation(loc.x, loc.y+20);
tip.setVisible(true);
}
示例4: show
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
public void show(String title, String message) {
ToolTip tooltip = new ToolTip(shell.getShell(), SWT.BALLOON | SWT.ICON_INFORMATION);
tooltip.setText(title);
tooltip.setMessage(message);
shell.getTrayItem().setToolTip(tooltip);
tooltip.setVisible(true);
tooltip.setAutoHide(true);
}
示例5: run
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
@Override
public void run() {
// 現在時刻
Date now = Calendar.getInstance().getTime();
List<String> notice = new ArrayList<String>();
boolean visibleHome = false;
// 遠征を更新する
if (this.updateDeck(now, notice)) {
PlayerThread.randomExpeditionSoundPlay();
visibleHome |= AppConfig.get().isVisibleOnReturnMission();
}
// 入渠を更新する
if (this.updateNdock(now, notice)) {
PlayerThread.randomDockSoundPlay();
visibleHome |= AppConfig.get().isVisibleOnReturnBathwater();
}
if (visibleHome) {
this.main.getTabFolder().setSelection(0);
}
if (AppConfig.get().isUseBalloon()) {
// バルーンツールチップを表示する
try {
// 遠征・入渠のお知らせ
if (notice.size() > 0) {
ToolTip tip = new ToolTip(this.main.getShell(), SWT.BALLOON
| SWT.ICON_INFORMATION);
tip.setText("遠征・入渠");
tip.setMessage(StringUtils.join(notice, "\r\n"));
this.main.getTrayItem().setToolTip(tip);
tip.setVisible(true);
}
} catch (Exception e) {
LoggerHolder.LOG.warn("お知らせの表示に失敗しました", e);
}
}
}
示例6: postFatal
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
/**
* 艦隊が出撃中で大破した場合に警告を行います
*/
private void postFatal() {
if (this.badlyDamage && GlobalContext.isSortie(this.dock.getId())) {
if (AppConfig.get().isBalloonBybadlyDamage()) {
List<ShipDto> ships = this.dock.getShips();
StringBuilder sb = new StringBuilder();
sb.append(AppConstants.MESSAGE_STOP_SORTIE);
sb.append("\n");
for (ShipDto shipDto : ships) {
if (shipDto.isBadlyDamage()) {
sb.append(shipDto.getName());
sb.append("(" + shipDto.getLv() + ")");
sb.append(" : ");
List<ItemDto> items = shipDto.getItem();
List<String> names = new ArrayList<String>();
for (ItemDto itemDto : items) {
if (itemDto != null) {
names.add(itemDto.getName());
}
}
sb.append(StringUtils.join(names, ","));
sb.append("\n");
}
}
ToolTip tip = new ToolTip(this.getShell(), SWT.BALLOON
| SWT.ICON_ERROR);
tip.setText("大破警告");
tip.setMessage(sb.toString());
this.main.getTrayItem().setToolTip(tip);
tip.setVisible(true);
}
// 大破時にサウンドを再生する
PlayerThread.randomBadlySoundPlay();
}
}
示例7: showToolTipSWTwidget
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
private static void showToolTipSWTwidget(Control control, int style, String title, String message) {
ToolTip tooltip = new ToolTip(control.getShell(), /*SWT.BALLOON | */ style);
tooltip.setAutoHide(true);
tooltip.setLocation(control.toDisplay(control.getSize().x/2, control.getSize().y + 5));
tooltip.setText(title);
tooltip.setMessage(message);
tooltip.setVisible(true);
}
示例8: showMessage
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
private void showMessage(final int style, final String title, final String message) {
if (trayItem != null && !trayItem.isDisposed()) {
final ToolTip currentTip = trayItem.getToolTip();
if (currentTip != null && !currentTip.isDisposed()) {
currentTip.dispose();
}
final ToolTip tip = new ToolTip(shell, SWT.BALLOON | style);
tip.setText(title);
tip.setMessage(message);
trayItem.setToolTip(tip);
tip.setVisible(true);
}
}
示例9: postFatal
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
/**
* 艦隊が出撃中で大破した場合に警告を行います
*/
private void postFatal() {
if (this.badlyDamage && GlobalContext.isSortie(this.dock.getId())) {
if (AppConfig.get().isBalloonBybadlyDamage()) {
List<ShipDto> ships = this.dock.getShips();
StringBuilder sb = new StringBuilder();
sb.append(AppConstants.MESSAGE_STOP_SORTIE);
sb.append("\n");
for (ShipDto shipDto : ships) {
if (shipDto.isBadlyDamage()) {
sb.append(shipDto.getName());
sb.append("(" + shipDto.getLv() + ")");
sb.append(" : ");
List<ItemDto> items = shipDto.getItem();
List<String> names = new ArrayList<String>();
for (ItemDto itemDto : items) {
if (itemDto != null) {
names.add(itemDto.getName());
}
}
sb.append(StringUtils.join(names, ","));
sb.append("\n");
}
}
ToolTip tip = new ToolTip(this.getShell(), SWT.BALLOON
| SWT.ICON_ERROR);
tip.setText("大破警告");
tip.setMessage(sb.toString());
this.main.getTrayItem().setToolTip(tip);
tip.setVisible(true);
}
// 大破時にサウンドを再生する
Sound.randomBadlySoundPlay();
}
}
示例10: run
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
@Override
public void run() {
// 現在時刻
Date now = Calendar.getInstance().getTime();
List<String> notice = new ArrayList<String>();
boolean visibleHome = false;
// 遠征を更新する
if (this.updateDeck(now, notice)) {
Sound.randomExpeditionSoundPlay();
visibleHome |= AppConfig.get().isVisibleOnReturnMission();
}
// 入渠を更新する
if (this.updateNdock(now, notice)) {
Sound.randomDockSoundPlay();
visibleHome |= AppConfig.get().isVisibleOnReturnBathwater();
}
if (visibleHome) {
this.main.getTabFolder().setSelection(0);
}
if (AppConfig.get().isUseBalloon()) {
// バルーンツールチップを表示する
try {
// 遠征・入渠のお知らせ
if (notice.size() > 0) {
ToolTip tip = new ToolTip(this.main.getShell(), SWT.BALLOON
| SWT.ICON_INFORMATION);
tip.setText("Notification");
tip.setMessage(StringUtils.join(notice, "\r\n"));
this.main.getTrayItem().setToolTip(tip);
tip.setVisible(true);
}
} catch (Exception e) {
LOG.warn("Failed to display the notification", e);
}
}
}
示例11: postFatal
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
/**
* 艦隊が出撃中で大破した場合に警告を行います
*/
private void postFatal() {
if (this.badlyDamage && GlobalContext.isSortie(this.dock.getId())) {
if (AppConfig.get().isBalloonBybadlyDamage()) {
List<ShipDto> ships = this.dock.getShips();
StringBuilder sb = new StringBuilder();
sb.append(AppConstants.MESSAGE_STOP_SORTIE);
sb.append("\n");
for (ShipDto shipDto : ships) {
if (shipDto.isBadlyDamage()) {
sb.append(shipDto.getName());
sb.append("(" + shipDto.getLv() + ")");
sb.append(" : ");
List<ItemDto> items = shipDto.getItem();
List<String> names = new ArrayList<String>();
for (ItemDto itemDto : items) {
if (itemDto != null) {
names.add(itemDto.getName());
}
}
sb.append(StringUtils.join(names, ","));
sb.append("\n");
}
}
ToolTip tip = new ToolTip(this.getShell(), SWT.BALLOON
| SWT.ICON_ERROR);
tip.setText("Warning");
tip.setMessage(sb.toString());
this.main.getTrayItem().setToolTip(tip);
tip.setVisible(true);
}
// 大破時にサウンドを再生する
Sound.randomBadlySoundPlay();
}
}
示例12: run
import org.eclipse.swt.widgets.ToolTip; //导入方法依赖的package包/类
@Override
public void run() {
// 現在時刻
Date now = Calendar.getInstance().getTime();
List<String> noticeMission = new ArrayList<String>();
List<String> noticeNdock = new ArrayList<String>();
boolean visibleHome = false;
// 遠征を更新する
if (this.updateDeck(now, noticeMission)) {
Sound.randomExpeditionSoundPlay();
visibleHome |= AppConfig.get().isVisibleOnReturnMission();
}
// 入渠を更新する
if (this.updateNdock(now, noticeNdock)) {
Sound.randomDockSoundPlay();
visibleHome |= AppConfig.get().isVisibleOnReturnBathwater();
}
if (visibleHome) {
this.main.getTabFolder().setSelection(0);
}
if (AppConfig.get().isUseBalloon()) {
// バルーンツールチップを表示する
try {
// 遠征・入渠のお知らせ
List<String> notice = new ArrayList<String>();
notice.addAll(noticeMission);
notice.addAll(noticeNdock);
if (notice.size() > 0) {
ToolTip tip = new ToolTip(this.main.getShell(), SWT.BALLOON
| SWT.ICON_INFORMATION);
tip.setText("遠征・入渠");
tip.setMessage(StringUtils.join(notice, "\r\n"));
this.main.getTrayItem().setToolTip(tip);
tip.setVisible(true);
}
} catch (Exception e) {
LOG.warn("お知らせの表示に失敗しました", e);
}
}
// Push通知 遠征
if ((noticeMission.size() > 0) && AppConfig.get().getPushMission()) {
PushNotify.add(StringUtils.join(noticeMission, "\r\n"), "遠征",
AppConfig.get().getPushPriorityMission());
}
// Push通知 入渠
if ((noticeNdock.size() > 0) && AppConfig.get().getPushNdock()) {
PushNotify.add(StringUtils.join(noticeNdock, "\r\n"), "入渠",
AppConfig.get().getPushPriorityNdock());
}
}