Search in sources :

Example 1 with AbstractJavaBreakpointEditor

use of org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor in project xtext-eclipse by eclipse.

the class XbaseBreakpointDetailPaneFactory method createDetailPane.

@Override
public IDetailPane createDetailPane(String paneID) {
    if (XBASE_DETAIL_PANE.equals(paneID)) {
        return new LineBreakpointDetailPane() {

            @Override
            public void display(IStructuredSelection selection) {
                super.display(selection);
                AbstractJavaBreakpointEditor editor = getEditor();
                Object input = null;
                if (selection != null && selection.size() == 1) {
                    input = selection.getFirstElement();
                }
                try {
                    if (input instanceof IJavaStratumLineBreakpoint) {
                        IJavaStratumLineBreakpoint stratumBreakpoint = (IJavaStratumLineBreakpoint) input;
                        URI uri = URI.createURI((String) stratumBreakpoint.getMarker().getAttribute(StratumBreakpointAdapterFactory.ORG_ECLIPSE_XTEXT_XBASE_SOURCE_URI));
                        IResourceServiceProvider resourceServiceProvider = registry.getResourceServiceProvider(uri);
                        if (resourceServiceProvider != null) {
                            JavaBreakPointProvider javaBreakPointProvider = resourceServiceProvider.get(JavaBreakPointProvider.class);
                            input = javaBreakPointProvider.getBreakpointWithJavaLocation(stratumBreakpoint);
                        }
                    }
                    editor.setInput(input);
                } catch (CoreException e) {
                    JDIDebugUIPlugin.log(e);
                }
            }
        };
    } else {
        return super.createDetailPane(paneID);
    }
}
Also used : IJavaStratumLineBreakpoint(org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint) IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) CoreException(org.eclipse.core.runtime.CoreException) AbstractJavaBreakpointEditor(org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) URI(org.eclipse.emf.common.util.URI) LineBreakpointDetailPane(org.eclipse.jdt.internal.debug.ui.breakpoints.LineBreakpointDetailPane)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 URI (org.eclipse.emf.common.util.URI)1 IJavaStratumLineBreakpoint (org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint)1 AbstractJavaBreakpointEditor (org.eclipse.jdt.internal.debug.ui.breakpoints.AbstractJavaBreakpointEditor)1 LineBreakpointDetailPane (org.eclipse.jdt.internal.debug.ui.breakpoints.LineBreakpointDetailPane)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 IResourceServiceProvider (org.eclipse.xtext.resource.IResourceServiceProvider)1