Community
Participate
Working Groups
Build Identifier: SSE CustomFilterHandler has invalid enablement. Handler is executed on other outlines. Execution provides exception: !ENTRY org.eclipse.ui 4 0 2012-02-03 10:36:05.899 !MESSAGE Unhandled event loop exception !STACK 0 java.lang.ClassCastException: com.wtrocki.ui.editors.source.outline.SourceOutlinePage cannot be cast to org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage at org.eclipse.wst.sse.ui.internal.handlers.CustomFilterHandler.execute(CustomFilterHandler.java:25) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476) at .. Proposed change on FilterHandler: public class CustomFilterHandler extends AbstractHandler { public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart editor = HandlerUtil.getActiveEditor(event); Object adapter=editor.getAdapter(IContentOutlinePage.class); if(adapter instanceof ConfigurableContentOutlinePage){ ConfigurableContentOutlinePage page = (ConfigurableContentOutlinePage) adapter; if (page != null) { page.getOutlineFilterProcessor().openDialog(); } } return null; } } Reproducible: Always
Created attachment 210644 [details] patch
Adding Nitin for review since we're ramping down and will need PMC approval.
This fix only class cast problem. Filter action is still visible in other outlines. I think that visiblewhen expression for this action in plugin.xml should be also changed. Thanks for quick response for this bug.
Nick, the Plug-in Manifest editor outline might be a good stand-in test for the one reported; it does not have a Filter action (it's Outline view's local menu is empty).
Created attachment 210675 [details] patch The problem is the property tester wasn't being executed because the sse.ui plugin hadn't been activated yet. This patch forces plugin activation, but also excludes that property tester's package from the activation list.
Code released to HEAD.