Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331126 - [Compatibility] NPE in perspective code when adding standalone view relative to a view
Summary: [Compatibility] NPE in perspective code when adding standalone view relative ...
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 M4   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-25 09:37 EST by Remy Suen CLA
Modified: 2010-11-25 09:43 EST (History)
0 users

See Also:


Attachments
ModeledPageLayout patch v1 (913 bytes, patch)
2010-11-25 09:42 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2010-11-25 09:37:36 EST
public void createInitialLayout(IPageLayout layout) {
  layout.addView(IPageLayout.ID_BOOKMARKS, IPageLayout.RIGHT, 0.25f,
      IPageLayout.ID_EDITOR_AREA);
  layout.addStandaloneView(IPageLayout.ID_OUTLINE, false,
      IPageLayout.TOP, .3f, IPageLayout.ID_BOOKMARKS);
}

Caused by: java.lang.IllegalArgumentException: The added object 'org.eclipse.e4.ui.model.application.ui.basic.impl.PartSashContainerImpl@10641064 (elementId: null, tags: null) (widget: null, renderer: null, toBeRendered: true, onTop: false, visible: true, containerData: null, accessibilityPhrase: null) (horizontal: false)' is not assignable to 'org.eclipse.e4.ui.model.application.ui.basic.MStackElement'
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl$1.validate(ElementContainerImpl.java:114)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl$1.validate(ElementContainerImpl.java:1)
	at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:443)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUnique(NotifyingListImpl.java:393)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:377)
	at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:345)
	at org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.insert(ModeledPageLayout.java:444)
	at org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.insert(ModeledPageLayout.java:523)
	at org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.insertView(ModeledPageLayout.java:344)
	at org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.addStandaloneView(ModeledPageLayout.java:177)
	at b.perspectives.RelEngPerspective.createInitialLayout(RelEngPerspective.java:11)
	at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:2635)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.openPerspective(ShowPerspectiveHandler.java:146)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.openOther(ShowPerspectiveHandler.java:118)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.execute(ShowPerspectiveHandler.java:57)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
Comment 1 Remy Suen CLA 2010-11-25 09:42:53 EST
Created attachment 183853 [details]
ModeledPageLayout patch v1
Comment 2 Remy Suen CLA 2010-11-25 09:43:31 EST
(In reply to comment #1)
> Created an attachment (id=183853) [details]
> ModeledPageLayout patch v1

Fix released to CVS HEAD.