1新建一个总在最上面的Shell
private Shell newshell;
public void init(final Shell splash) {
newshell=new Shell(splash.getDisplay(),SWT.ON_TOP |SWT.TOP);
// Store the shell
super.init(splash);
preSpring();
// Configure the shell layout
configureUISplash();
// Create UI
createUI();
2 新建的Shell最小化并打开
newshell.setSize(0,0);
newshell.open();
3把启动界面的Shell移到它的上面
splash.moveAbove(newshell);
// Create UI listeners
createUIListeners();
// Force the splash screen to layout
splash.layout(true);
// Keep the splash screen visible and prevent the RCP application from
// loading until the close button is clicked.
doEventLoop();
}
4 新建的Shell要记得到dispose
private void handleButtonCancelWidgetSelected() {
// Abort the loading of the RCP application
newshell.dispose();
getSplash().getDisplay().close();
System.exit(0);
}
private void handleButtonOKWidgetSelected() {
String username = fTextUsername.getText();
String password = fTextPassword.getText();
String mess;
if (login()){
fAuthenticated = true;
newshell.dispose();
} else {
MessageDialog.openError(getSplash(), "登陆失败", mess);
}
}
private Shell newshell;
public void init(final Shell splash) {
newshell=new Shell(splash.getDisplay(),SWT.ON_TOP |SWT.TOP);
// Store the shell
super.init(splash);
preSpring();
// Configure the shell layout
configureUISplash();
// Create UI
createUI();
2 新建的Shell最小化并打开
newshell.setSize(0,0);
newshell.open();
3把启动界面的Shell移到它的上面
splash.moveAbove(newshell);
// Create UI listeners
createUIListeners();
// Force the splash screen to layout
splash.layout(true);
// Keep the splash screen visible and prevent the RCP application from
// loading until the close button is clicked.
doEventLoop();
}
4 新建的Shell要记得到dispose
private void handleButtonCancelWidgetSelected() {
// Abort the loading of the RCP application
newshell.dispose();
getSplash().getDisplay().close();
System.exit(0);
}
private void handleButtonOKWidgetSelected() {
String username = fTextUsername.getText();
String password = fTextPassword.getText();
String mess;
if (login()){
fAuthenticated = true;
newshell.dispose();
} else {
MessageDialog.openError(getSplash(), "登陆失败", mess);
}
}