Project: Eclipse_Platform_UI
Bug 124564 [Presentations] DetachedWindow should not use TabbedStackPresentation
Reported: 2006-01-19 18:42:23 | Status: verified fixed

I'm working on my own presentation and for 3.2M4 I have a problem with DetachedWindow: it makes an assumption, that StackPresentation returned by PartStack.getPresentation() is always *Tabbed*StackPresentation, but this is not the always the case. My presentation inherites StackPresentation and therefore I have a CCE on line 181: java.lang.ClassCastException: de.loskutov.eclipseskins.presentation.VSViewStackPresentation at org.eclipse.ui.internal.DetachedWindow.add(DetachedWindow.java:181) at org.eclipse.ui.internal.PerspectiveHelper.detach(PerspectiveHelper.java:793) at org.eclipse.ui.internal.PerspectiveHelper.detachPart(PerspectiveHelper.java:825) at org.eclipse.ui.internal.WorkbenchPage.detachView(WorkbenchPage.java:1470) at org.eclipse.ui.internal.ViewPane.doDetach(ViewPane.java:254) at org.eclipse.ui.internal.presentations.SystemMenuDetach.run(SystemMenuDetach.java:59) This exception occurs if I try to "detach" any view. Is it possible to not made a cast to *Tabbed*StackPresentation? The code on lines 182 - 192 is not interoperable with any other presentation, e.g. with "Eclipse 2.1 Style Presentation": java.lang.ClassCastException: org.eclipse.ui.internal.presentations.R21ViewStackPresentation at org.eclipse.ui.internal.DetachedWindow.add(DetachedWindow.java:181) at org.eclipse.ui.internal.PerspectiveHelper.detach(PerspectiveHelper.java:793) at org.eclipse.ui.internal.PerspectiveHelper.detachPart(PerspectiveHelper.java:825) at org.eclipse.ui.internal.WorkbenchPage.detachView(WorkbenchPage.java:1470) at org.eclipse.ui.internal.ViewPane.doDetach(ViewPane.java:254) at org.eclipse.ui.internal.presentations.SystemMenuDetach.run(SystemMenuDetach.java:59)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/DetachedWindow.java