org.eclipse.xtext.ui.resource.IResourceUIServiceProvider Java Examples

The following examples show how to use org.eclipse.xtext.ui.resource.IResourceUIServiceProvider. 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: GlobalDescriptionLabelProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.1 protected
 */
protected ILabelProvider lookupDescriptionLabelProvider(Object description) {
	URI uri = uri(description);
	if (uri != null) {
		IResourceServiceProvider resourceServiceProvider = IResourceServiceProvider.Registry.INSTANCE
				.getResourceServiceProvider(uri);
		if (resourceServiceProvider instanceof IResourceUIServiceProvider)
			return ((IResourceUIServiceProvider) resourceServiceProvider).getLabelProvider();
	}
	return null;
}
 
Example #2
Source File: GlobalURIEditorOpener.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IEditorPart open(URI uri, boolean select) {
	IResourceServiceProvider resourceServiceProvider = resourceServiceProviderRegistry.getResourceServiceProvider(uri.trimFragment());
	if(resourceServiceProvider instanceof IResourceUIServiceProvider) {
		IURIEditorOpener editorOpener = ((IResourceUIServiceProvider) resourceServiceProvider).getURIEditorOpener();
		if (editorOpener != null) {
			return editorOpener.open(uri, select);
		}
	}
	return openDefaultEditor(uri, null, -1, select);
}
 
Example #3
Source File: GlobalURIEditorOpener.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IEditorPart open(URI referenceOwnerURI, EReference reference, int indexInList, boolean select) {
	IResourceServiceProvider resourceServiceProvider = resourceServiceProviderRegistry.getResourceServiceProvider(referenceOwnerURI.trimFragment());
	if(resourceServiceProvider instanceof IResourceUIServiceProvider) {
		IURIEditorOpener editorOpener = ((IResourceUIServiceProvider) resourceServiceProvider).getURIEditorOpener();
		if (editorOpener != null) {
			return editorOpener.open(referenceOwnerURI, reference, indexInList, select);
		}
	}
	return openDefaultEditor(referenceOwnerURI, reference, indexInList, select);
}
 
Example #4
Source File: XtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IResourceUIServiceProvider> bindIResourceUIServiceProvider() {
	return XtendResourceUiServiceProvider.class;
}
 
Example #5
Source File: AbstractSARLUiModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends IResourceUIServiceProvider> bindIResourceUIServiceProvider() {
	return XtendResourceUiServiceProvider.class;
}