org.eclipse.xtext.resource.EObjectAtOffsetHelper Java Examples

The following examples show how to use org.eclipse.xtext.resource.EObjectAtOffsetHelper. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestDiscoveryUIUtils.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
private static EObject getSelectedElement(final XtextEditor editor, final ITextSelection textSelection) {
	return editor.getDocument().modify(
			resource -> {
				final IResourceServiceProvider serviceProvider = resource.getResourceServiceProvider();
				final EObjectAtOffsetHelper offsetHelper = serviceProvider.get(EObjectAtOffsetHelper.class);
				return offsetHelper.resolveElementAt(resource, textSelection.getOffset());
			});
}
 
Example #2
Source File: DefaultXbaseRuntimeModule.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends EObjectAtOffsetHelper> bindEObjectAtOffsetHelper() {
	return BrokenConstructorCallAwareEObjectAtOffsetHelper.class;
}
 
Example #3
Source File: HyperlinkHelper.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @since 2.5
 */
protected EObjectAtOffsetHelper getEObjectAtOffsetHelper() {
	return eObjectAtOffsetHelper;
}
 
Example #4
Source File: XtendRuntimeModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends EObjectAtOffsetHelper> bindEObjectAtOffsetHelper() {
	return XtendEObjectAtOffsetHelper.class;
}
 
Example #5
Source File: RenameService2.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected EObjectAtOffsetHelper getEObjectAtOffsetHelper() {
	return eObjectAtOffsetHelper;
}
 
Example #6
Source File: AbstractSARLRuntimeModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends EObjectAtOffsetHelper> bindEObjectAtOffsetHelper() {
	return XtendEObjectAtOffsetHelper.class;
}