Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » adding a ToolControl to TrimBar causes ClosePerspective exception
adding a ToolControl to TrimBar causes ClosePerspective exception [message #1439935] Tue, 07 October 2014 18:06
Sean Smith is currently offline Sean SmithFriend
Messages: 6
Registered: September 2014
Junior Member
I am trying to add a banner to the top tool bar in an e3 rcp application running in Luna eclipse 4.4.

The type BannerImpl is an extension of ToolControlImpl that simply makes its constructor visible by calling super(); in its constructor.

plugin/BannerPart is a composite that adds the banner.

        ApplicationImpl app = (ApplicationImpl) PlatformUI.getWorkbench().getService(MApplication.class);
        List<MWindow> t = app.getChildren();
        TrimmedWindowImpl trimmed = ((TrimmedWindowImpl) t.get(0));
        
        List<MTrimBar> trimbars = trimmed.getTrimBars();

        BannerImpl p = new BannerImpl();
        p.setContributionURI("bundleclass://plugin/BannerPart");
        trimbars.get(0).getChildren().add(p)



The banner is successfully added, but now when ever the function

WorkbenchPage.closePerspective(id, Boolean, Boolean) is called the following exception is thrown

!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/ui/ElementContainer/children/REMOVE] to handler org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler@5927f904
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:62)
at org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler$1.run(UIEventObjectSupplier.java:56)
at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:187)
at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:156)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:4734)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:218)
at org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler.handleEvent(UIEventObjectSupplier.java:53)
at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
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:81)
at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:59)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:718)
at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:462)
at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.removePerspectiveModel(ModelServiceImpl.java:810)
at org.eclipse.ui.internal.WorkbenchPage.closePerspective(WorkbenchPage.java:1710)
at org.eclipse.ui.internal.WorkbenchPage.closePerspective(WorkbenchPage.java:1734)
at org.eclipse.ui.internal.WorkbenchPage.closePerspective(WorkbenchPage.java:1719)



What is the reason that this would be occurring? I am simply adding to a trimBar when the application starts so I am very confused as to why this would have any interaction with the closePerspective function.
Previous Topic:Contribution and disposing tray icon in e4 application
Next Topic:How to catch unhandled exceptions in e4?
Goto Forum:
  


Current Time: Wed Jan 27 17:47:02 GMT 2021

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

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

Back to the top