Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Bug while event setting selected Element?
Bug while event setting selected Element? [message #573102] Tue, 06 April 2010 22:24
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi,

I was experimenting again with e4 and tried the following


1. Have a main plug-in with two perspectives on one stack
selected is first perspective.
So far, so good - everything works out smoothly.


2. Have a second plug-in/code bundle with using snippet component declaration via extension point "org.eclipse.e4.workbench.model"
Component snippet just defines to add a view to first PartStack in second perspective using component/children-tags.
So far so good. No issues in model - no complains while parsing or building up model.

When switching the perspective to the second not yet selected perspective e4 crashes while dispatching the selectedElement/SET event (see stack trace below).

The doOpenProject() method does nothing but running a job to switch the perspective via model service (see code snippet below).
When debugging it crashes in the line "ps.setSelectedElement(p);"

Everything works out fine, if that contributed part resides within the same bundle.
Did I anything wrong? I supposed these ModelComponents could be used to declare parts even in other, but required, bundles/plug-ins.

Secondly, do the views still have to be specified via extension point "org.eclipse.ui.views" ?

Sebastian


========== STACKTRACE ========================
2010-04-07 00:07:37.886 Log ErrorException while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/application/ElementContainer/ selectedElement/SET] to handler mailto:org.eclipse.e4.ui.services.internal.events.UIEventHandler@6a5afc
java.lang.NullPointerException
at org.eclipse.e4.workbench.ui.internal.ReflectionContributionF actory.createFromBundle(ReflectionContributionFactory.java:1 78)
at org.eclipse.e4.workbench.ui.internal.ReflectionContributionF actory.create(ReflectionContributionFactory.java:159)
at org.eclipse.e4.workbench.ui.renderers.swt.ContributedPartRen derer.createWidget(ContributedPartRenderer.java:58)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createWidget(PartRenderingEngine.java:438)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:336)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:398)
at org.eclipse.e4.workbench.ui.renderers.swt.StackRenderer.show Tab(StackRenderer.java:450)
at org.eclipse.e4.workbench.ui.renderers.swt.LazyStackRenderer$ 1.handleEvent(LazyStackRenderer.java:66)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler.ha ndleEvent(UIEventHandler.java:41)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handl eEvent(EventHandlerWrapper.java:188)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispa tchEvent(EventHandlerTracker.java:198)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEve nt(EventManager.java:227)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEv entSynchronous(ListenerQueue.java:149)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEv ent(EventAdminImpl.java:139)
at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent( EventAdminImpl.java:78)
at org.eclipse.equinox.internal.event.EventComponent.sendEvent( EventComponent.java:39)
at org.eclipse.e4.ui.services.internal.events.EventBroker.send( EventBroker.java:74)
at org.eclipse.e4.workbench.ui.internal.UIEventPublisher.notify Changed(UIEventPublisher.java:59)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify (BasicNotifierImpl.java:280)
at org.eclipse.e4.ui.model.application.impl.ElementContainerImp l.setSelectedElement(ElementContainerImpl.java:135)
at org.eclipse.e4.workbench.ui.renderers.swt.LazyStackRenderer. postProcess(LazyStackRenderer.java:103)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:352)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:398)
at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:56)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:348)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:398)
at org.eclipse.e4.workbench.ui.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:56)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:348)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .createGui(PartRenderingEngine.java:398)
at org.eclipse.e4.workbench.ui.renderers.swt.PerspectiveStackRe nderer.showTab(PerspectiveStackRenderer.java:100)
at org.eclipse.e4.workbench.ui.renderers.swt.LazyStackRenderer$ 1.handleEvent(LazyStackRenderer.java:66)
at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1. run(UIEventHandler.java:46)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:4012)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3631)
at org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:173)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:388)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:507)
at de.zwp.chavvah.rcp.ui.views.WelcomeView.doOpenProject(Welcom eView.java:134)
at de.zwp.chavvah.rcp.ui.views.WelcomeView$2.widgetSelected(Wel comeView.java:122)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1050)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:4037)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3628)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine $5.run(PartRenderingEngine.java:554)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.e4.ui.workbench.swt.internal.PartRenderingEngine .run(PartRenderingEngine.java:478)
at org.eclipse.e4.workbench.ui.internal.E4Workbench.createAndRu nUI(E4Workbench.java:100)
at org.eclipse.e4.ui.workbench.swt.internal.E4Application.start (E4Application.java:84)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1406)
at org.eclipse.equinox.launcher.Main.main(Main.java:1382)

========== CODE SNIPPET ========================
MPerspectiveStack ps = (MPerspectiveStack) modelService.find(
IConstants.DEFAULT_PERSPECTIVE_STACK, searchRoot);


EList<MPerspective> kids = ps.getChildren();
for (MPerspective p : kids) {
if (p.getId().equals("secondPerspective"))
ps.setSelectedElement(p);
}
Previous Topic:How to add a banner to an e4 application
Next Topic:Bug while event setting selected Element?
Goto Forum:
  


Current Time: Thu Dec 18 15:24:41 GMT 2014

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

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