Permalink
Browse files

[#386] Resolve dependencies on jdt.ui / jdt.debug.ui

Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
  • Loading branch information...
kthoms committed Sep 29, 2017
1 parent 7370aaf commit 94a388c1631545e551fb558a6563f1b7acd4ee53
@@ -38,13 +38,11 @@ Require-Bundle: org.eclipse.xtext,
org.eclipse.xtext.common.types.ui;resolution:=optional;x-installation:=greedy,
org.eclipse.jdt.launching;bundle-version="3.5.200";resolution:=optional;x-installation:=greedy,
org.eclipse.ui.forms;bundle-version="3.4.1";resolution:=optional;x-installation:=greedy,
org.eclipse.jdt.ui;bundle-version="3.6.0";resolution:=optional;x-installation:=greedy,
org.eclipse.xtext.xbase.lib;visibility:=reexport,
org.eclipse.emf.ecore.editor;bundle-version="2.10.0";resolution:=optional;x-installation:=greedy,
org.eclipse.debug.core;bundle-version="3.6.0";resolution:=optional;x-installation:=greedy,
org.eclipse.debug.ui;bundle-version="3.6.0";resolution:=optional;visibility:=reexport;x-installation:=greedy,
org.eclipse.jdt.debug;bundle-version="3.6.0";resolution:=optional;x-installation:=greedy,
org.eclipse.jdt.debug.ui;bundle-version="3.5.2";resolution:=optional,
org.eclipse.xtend.lib,
org.eclipse.ui.console;bundle-version="3.5.0",
org.eclipse.xtext.smap
@@ -30,7 +30,6 @@
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.debug.core.IJavaStratumLineBreakpoint;
import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.ITextSelection;
@@ -74,7 +73,7 @@
private XbaseBreakpointUtil breakpointUtil;
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({ "rawtypes"})
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject instanceof XtextEditor) {
return this;
@@ -120,9 +119,8 @@ public Data exec(XtextResource state) throws Exception {
result.types = getClassNamePattern(state);
result.lang = provider.get(LanguageInfo.class);
result.sourceUri = state.getURI();
if (editorInput instanceof IClassFileEditorInput) {
IClassFile classFile = ((IClassFileEditorInput) editorInput).getClassFile();
result.classHandle = classFile.getHandleIdentifier();
if (editorInput.getAdapter(IClassFile.class) != null) {
result.classHandle = ((IClassFile)editorInput.getAdapter(IClassFile.class)).getHandleIdentifier();
}
return result;
}
@@ -18,7 +18,6 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.internal.ui.javaeditor.IClassFileEditorInput;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.xtext.common.types.ui.trace.ITraceForTypeRootProvider;
@@ -66,8 +65,8 @@ public IResource getBreakpointResource(IEditorInput input) throws CoreException
if (underlyingResource != null)
return underlyingResource;
}
} else if (input instanceof IClassFileEditorInput) {
IClassFile classFile = ((IClassFileEditorInput) input).getClassFile();
} else if (input.getAdapter(IClassFile.class) != null) {
IClassFile classFile = (IClassFile) input.getAdapter(IClassFile.class);
return getBreakpointResource(classFile.findPrimaryType());
}
return ResourcesPlugin.getWorkspace().getRoot();
@@ -100,11 +99,8 @@ public SourceRelativeURI getBreakpointURI(IEditorInput input) {
logger.error("Error finding breakpoint URI", e);
return null;
}
} else if (input instanceof IClassFileEditorInput) {
IClassFile classFile = ((IClassFileEditorInput) input).getClassFile();
if (classFile == null) {
return null;
}
} else if (input.getAdapter(IClassFile.class) != null) {
IClassFile classFile = (IClassFile) input.getAdapter(IClassFile.class);
ITrace traceToSource = traceForTypeRootProvider.getTraceToSource(classFile);
if (traceToSource == null)
return null;

0 comments on commit 94a388c

Please sign in to comment.