Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Examples » Issue with Login Popup(Issue with Login Popup)
Issue with Login Popup [message #1066126] Mon, 01 July 2013 07:10
Jack Clouseau is currently offline Jack ClouseauFriend
Messages: 21
Registered: June 2010
Junior Member
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
Previous Topic:Need examples for Eclipse 3.5's Editor, View, Formatter, more
Next Topic:tomcat issue
Goto Forum:
  


Current Time: Thu Dec 18 08:34:00 GMT 2014

Powered by FUDForum. Page generated in 0.02863 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software