|
|
Re: Problem using StartupMonitor to show a login dialog [message #798261 is a reply to message #798241] |
Tue, 14 February 2012 12:57 |
Markus Stier Messages: 12 Registered: July 2009 |
Junior Member |
|
|
I register my implementation of StartupMonitor as a service in the Activator of the containing bundle.
public void start(BundleContext context) throws Exception
{
(...)
IEclipseContext eclipseCtx = EclipseContextFactory.getServiceContext(context);
LoginStartupMonitor lsm = new LoginStartupMonitor(eclipseCtx);
s_loginMonitorRegistration = context.registerService(StartupMonitor.class, lsm, monitorProps);
(...)
}
The handler, which handles the Login_Successful_Event, is registered during @ProcessAdditions but executed later:
@ProcessAdditions
public void processAddtions(IEclipseContext context, IEventBroker evtBroker, final EPartService partService,
ISessionService sessionService, final ISystemUIService sysUIService)
{
(...)
evtBroker.subscribe(ISessionService.EVENT_LOGIN_SUCCESSFUL, new EventHandler()
{
@Override
public void handleEvent(Event evt)
{
String strTopic = evt.getTopic();
// Login-Event
if (ISessionService.EVENT_LOGIN_SUCCESSFUL.equals(strTopic)) {
// NavigatorPart und ResultsPart anzeigen
partService.showPart(NavigatorPart.ID, PartState.CREATE);
partService.showPart(NavigatorPart.ID, PartState.VISIBLE);
sysUIService.startScreenMonitoring();
}
}
(...)
Maybe the place to register the handler is not the most adequate, but it will be executed at a later point of time.
What I want to achieve is, that the workbench is empty besides the login dialog. If authentication succeeded the workbench should be populated with some standard views. Later I'd like to restore the previous state of the workbench.
Markus
|
|
|
Re: Problem using StartupMonitor to show a login dialog [message #798282 is a reply to message #798261] |
Tue, 14 February 2012 13:33 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
So I get this right you want to show the workbench while the login
dialog is displayed? Why don't you block in @ProcessAdditions until the
user is logged in, modify the model directly afterwards and the let the
workbench start proceed?
Tom
Am 14.02.12 13:57, schrieb Markus Stier:
> I register my implementation of StartupMonitor as a service in the
> Activator of the containing bundle.
>
>
> public void start(BundleContext context) throws Exception
> {
> (...)
> IEclipseContext eclipseCtx =
> EclipseContextFactory.getServiceContext(context);
> LoginStartupMonitor lsm = new LoginStartupMonitor(eclipseCtx);
> s_loginMonitorRegistration =
> context.registerService(StartupMonitor.class, lsm, monitorProps);
> (...)
> }
>
>
> The handler, which handles the Login_Successful_Event, is registered
> during @ProcessAdditions but executed later:
>
>
> @ProcessAdditions
> public void processAddtions(IEclipseContext context, IEventBroker
> evtBroker, final EPartService partService,
> ISessionService sessionService, final ISystemUIService
> sysUIService)
> {
> (...)
>
> evtBroker.subscribe(ISessionService.EVENT_LOGIN_SUCCESSFUL, new
> EventHandler()
> {
>
> @Override
> public void handleEvent(Event evt)
> {
> String strTopic = evt.getTopic();
>
> // Login-Event
> if
> (ISessionService.EVENT_LOGIN_SUCCESSFUL.equals(strTopic)) {
> // NavigatorPart und ResultsPart anzeigen
> partService.showPart(NavigatorPart.ID,
> PartState.CREATE);
> partService.showPart(NavigatorPart.ID,
> PartState.VISIBLE);
>
> sysUIService.startScreenMonitoring();
> }
> }
> (...)
>
>
> Maybe the place to register the handler is not the most adequate, but it
> will be executed at a later point of time.
>
> What I want to achieve is, that the workbench is empty besides the login
> dialog. If authentication succeeded the workbench should be populated
> with some standard views. Later I'd like to restore the previous state
> of the workbench.
>
> Markus
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03608 seconds