Login UI issue [message #78027] |
Wed, 12 March 2008 03:10  |
Eclipse User |
|
|
|
Originally posted by: dnise.hotmail.com
Hi all:
I have created a login UI interface before entrying my application. I have
created a shell which included userName and password controls in
createUI method. so I can display a Login UI interface before launching
whole system.it would cut down some resource consumption.if someone
inputed correct username and password,he can pass into system. I have
implemented these too. but there was a problem that how could I return to
login interface when i logout the system? how could i return to these
shell?
can i implement this in RAP??
is there anyone can give me some advice?
Thanks in advance
best regards
dnise
|
|
|
|
|
Re: Login UI issue [message #78147 is a reply to message #78044] |
Wed, 12 March 2008 22:42   |
Eclipse User |
|
|
|
Originally posted by: dnise.hotmail.com
Hi Frank:
maybe I haven't described the problem clearly.The createUI method
is a entrance of application.In order to avoid a long startup time
and preserve resources, so I have created a shell and filled some controls
on it before "return PlatformUI.createAndRunWorkbench(display, advisor)",
it can entry into application while inputing correct username and password.
there is a logout button in system of each "ViewPart". i wanna to display
the shell which was create firstly. I don't know how to return to this
shell, I think the workbench has been closed, because it haven't created
workbench as shell generated. my codes as follows:
public int createUI() {
Display display = PlatformUI.createDisplay();
WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
int i = 0;
shell = new Shell(display, SWT.NO_TRIM);
shell.setLayout(new GridLayout(2, false));
Label lbl1 = new Label(shell, SWT.NONE);
lbl1.setText("UserName:");
lbl1.setSize(40, 30);
txtUserName = new Text(shell, SWT.BORDER);
txtUserName.setSize(90, 30);
Label lbl2 = new Label(shell, SWT.NONE);
lbl2.setText("Password:");
lbl2.setSize(40, 30);
txtPassword = new Text(shell, SWT.BORDER);
txtPassword.setSize(90, 30);
Button btn = new Button(shell, SWT.PUSH);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
login = validata_Login(txtUserName.getText(), txtPassword
.getText());
System.out.println(login);
}
});
btn.setText("submit");
btn.setSize(50, 30);
shell.setSize(400, 300);
shell.setMaximized(false);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (login) {
break;
}
if (!display.readAndDispatch()) {
display.sleep();
}
}
return PlatformUI.createAndRunWorkbench(display, advisor);
}
Thanks & regards
Dnise
2008-03-13
|
|
|
Re: Login UI issue [message #78162 is a reply to message #78147] |
Wed, 12 March 2008 23:35   |
Eclipse User |
|
|
|
Originally posted by: anupgokhale.rediffmail.com
dnise wrote:
> Hi Frank:
> maybe I haven't described the problem clearly.The createUI method
> is a entrance of application.In order to avoid a long startup time
> and preserve resources, so I have created a shell and filled some controls
> on it before "return PlatformUI.createAndRunWorkbench(display, advisor)",
> it can entry into application while inputing correct username and password.
> there is a logout button in system of each "ViewPart". i wanna to display
> the shell which was create firstly. I don't know how to return to this
> shell, I think the workbench has been closed, because it haven't created
> workbench as shell generated. my codes as follows:
I think your are unnecessarily over complicating the problem. I can
suggest two simple solutions:
1. Each of your views as a "Log-Out" menu/toolbar. When user clicks on
this menu, you can perform all clean up operations, and close all th
eopen editors and views. In this case you workbench will remain open.
You can then display the "Log-In" shell/dialog. In this shell, after
user credentials have been validated, you can decide whether the shell
has been loaded for the in which case you can run
PlatformUI.createAndRunWorkbench. If the log-in shell has been displayed
due to a log-off action, then the work bench has already been created
and you only need to load the required editors/views.
2. In the second option, whenever th euser logs off you can simply
redirect the browser to your original startup entry point.
Regards,
Anup
|
|
|
|
Re: Login UI issue [message #98841 is a reply to message #97844] |
Fri, 18 July 2008 05:07  |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
The only workaround I could think of at the moment is to cleanup the
session completle. Somewhere on this list I described how to do this by
an URL "redirect" using the browser widget. Not nice but it worked...
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Frank Gerhardt [mailto:fg@frankgerhardt.com]
Bereitgestellt: Sonntag, 13. Juli 2008 01:40
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Login UI issue
Betreff: Re: Login UI issue
Frank Appel schrieb:
> Hi,
>
> does logout close your workbench? If so you could create a while loop
in
> your IEntryPoint#createUI() implementation:
>
> display creation
> while( !exit )
> loginShell
> createWorkbench
Hi Frank, that's exactly the idea I was looking for. However,
createworkbench works only once. When the loop is executed a second
time, the workbench does not start, bug 201545.
Do you know a workaround?
Frank.
|
|
|
Powered by
FUDForum. Page generated in 0.04267 seconds