Issue with Login Popup [message #1066126] |
Mon, 01 July 2013 03:10 |
Eclipse User |
|
|
|
Hello All,
Am trying to add a log-in dialog to my application. I have added this code in the
start method of the IApplication java file:
below is the code:
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start
org.eclipse.equinox.app.IApplicationContext)
*/
public Object start(IApplicationContext context) throws Exception {
Display display = PlatformUI.createDisplay();
if(aunthenticateUser(display)){
try {
int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
if (returnCode == PlatformUI.RETURN_RESTART)
return IApplication.EXIT_RESTART;
else
return IApplication.EXIT_OK;
} finally {
display.dispose();
}
}else{
return IApplication.EXIT_OK;
}
}
Now, the issue is: when the application starts the splash screen shows up first ( i have configured the splash screen in the productconfiguration file of the application). Then the login dialog appears.
Before entering the credentials in the login dialog, if the user closes the application by selecting the "close window" conext-menu from the windows task bar, the application closes (spash screen), but the login dialog doesn't close.
The login dialog is created as below in the IApplication.java
private boolean aunthenticateUser(Display display){
boolean openApp = false;
Shell shell = new Shell(display);
final LoginDialog loginDia = new LoginDialog(shell);
final int status = loginDia.open();
if(status == Window.OK){
openApp = true;
}
loginDia.close();
shell.dispose();
shell = null;
return openApp;
}
On debugging i noticed that, if the user closes the application before entering the credentials in the login dialog, the control doesn't come to the IApplicatio.java file itself. If this is the case, how can i close my Login dialog in this scenarion
Please let me know suggestion to resolve this issue
|
|
|
Powered by
FUDForum. Page generated in 0.05225 seconds