📄 msgbox.java
字号:
package com.cownew.studio.modelDev.common;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Shell;
import com.cownew.studio.Activator;
public class MsgBox
{
public static void showInfo(String message)
{
Shell shell = Activator.getShell();
showInfo(shell, message);
}
public static void showInfo(final Shell shell, final String message)
{
if (shell == null)
{
System.err.println(message);
return;
}
shell.getDisplay().asyncExec(new Runnable() {
public void run()
{
MessageDialog.openInformation(shell, "info", message);
}
});
}
public static void showError(String message)
{
Shell shell = Activator.getShell();
showError(shell, message);
}
public static void showError(final Shell shell, final String message)
{
if (shell == null)
{
System.err.println(message);
return;
}
shell.getDisplay().asyncExec(new Runnable() {
public void run()
{
MessageDialog.openError(shell, "error", message);
}
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -