控制鼠标等待11:25
//鼠标设置为等待状态[code="java"]Display.getCurrent().getActiveShell().setCursor(new Cursor(null, SWT.CURSOR_WAIT)); [/code]//鼠标设置为正常状态[code="java"]Display.getCurrent().getActiveShell().set
·
//鼠标设置为等待状态
//鼠标设置为正常状态
如何在SWT中使鼠标的状态变成忙碌
文章来自于这里
http://gogoyoyo.iteye.com/blog/265130
关于修改标题的代码
//rcptitle是自己定义的
changeAppTitle(ApplicationWorkbenchWindowAdvisor.RcpTitle+" - 代码正在运行...");
Display.getCurrent().getActiveShell().setCursor(new Cursor(null, SWT.CURSOR_WAIT));
//鼠标设置为正常状态
Display.getCurrent().getActiveShell().setCursor(new Cursor(null, SWT.CURSOR_ARROW));
如何在SWT中使鼠标的状态变成忙碌
文章来自于这里
http://gogoyoyo.iteye.com/blog/265130
public class DoubleClickTreeNodeAction extends Action {
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
// get Display from your own plug-in
BusyIndicator.showWhile(Activator.getDefault().getWorkbench()
.getDisplay(), new Runnable() {
public void run() {
performAction(); //这里是原来run的内容
}
});
}
private void performAction() {
// connecting to database...
}
}
关于修改标题的代码
//rcptitle是自己定义的
changeAppTitle(ApplicationWorkbenchWindowAdvisor.RcpTitle+" - 代码正在运行...");
changeAppTitle(ApplicationWorkbenchWindowAdvisor.RcpTitle);
public static void changeAppTitle(String newTitle) {
Display display = Display.getDefault();
if (display != null) {
// Look at all the shells and pick the first one
// that is a workbench window.
Shell shells[] = display.getShells();
for (int i = 0; i < shells.length; i++) {
Object obj = shells[i].getData();
// Check whether this shell points to the
// Application main window's shell
if (obj instanceof IWorkbenchWindow) {
shells[i].setText(newTitle);
break;
}
}
}
}
更多推荐
已为社区贡献1条内容
所有评论(0)