org.eclipse.xtext.ui.refactoring.IReferenceUpdater Java Examples

The following examples show how to use org.eclipse.xtext.ui.refactoring.IReferenceUpdater. 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: ReferenceUpdaterDispatcher.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
public void createReferenceUpdates(
		ElementRenameArguments elementRenameArguments,
		ResourceSet resourceSet,
		IRefactoringUpdateAcceptor updateAcceptor,
		IProgressMonitor monitor) {
	SubMonitor progress = SubMonitor.convert(monitor, "Updating references", 100);
	ResourceAccess resourceAccess = resourceAccessProvider.get();
	resourceAccess.registerResourceSet(resourceSet);
	
	ReferenceDescriptionAcceptor referenceDescriptionAcceptor = createFindReferenceAcceptor(updateAcceptor);
	referenceFinder.findAllReferences(
			targetURIConverter.fromIterable(elementRenameArguments.getRenamedElementURIs()),
			resourceAccess,
			indexData,
			referenceDescriptionAcceptor,
			progress.newChild(2));
	Multimap<IReferenceUpdater, IReferenceDescription> updater2descriptions = referenceDescriptionAcceptor
			.getReferenceUpdater2ReferenceDescriptions();
	SubMonitor updaterProgress = progress.newChild(98).setWorkRemaining(updater2descriptions.keySet().size());
	for (IReferenceUpdater referenceUpdater : updater2descriptions.keySet()) {
		if (updaterProgress.isCanceled())
			return;
		referenceUpdater.createReferenceUpdates(elementRenameArguments, updater2descriptions.get(referenceUpdater), updateAcceptor,
				updaterProgress.newChild(1));
	}
}
 
Example #2
Source File: ReferenceUpdaterDispatcher.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void accept(IReferenceDescription referenceDescription) {
	if (referenceDescription.getSourceEObjectUri() == null
			|| referenceDescription.getTargetEObjectUri() == null
			|| referenceDescription.getEReference() == null) {
		handleCorruptReferenceDescription(referenceDescription, status);
	} else {
		URI sourceResourceURI = referenceDescription.getSourceEObjectUri().trimFragment();
		IReferenceUpdater referenceUpdater = getReferenceUpdater(sourceResourceURI);
		if (referenceUpdater == null)
			handleNoReferenceUpdater(sourceResourceURI, status);
		else
			updater2refs.put(referenceUpdater, referenceDescription);
	}
}
 
Example #3
Source File: ReferenceUpdaterDispatcher.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected IReferenceUpdater getReferenceUpdater(URI sourceResourceURI) {
	//TODO Why do we cache the IReferenceUpdater here?
	IResourceServiceProvider resourceServiceProvider = resourceServiceProviderRegistry
			.getResourceServiceProvider(sourceResourceURI);
	if (resourceServiceProvider == null)
		return null;
	IReferenceUpdater referenceUpdater = provider2updater.get(resourceServiceProvider);
	if (referenceUpdater == null) {
		referenceUpdater = resourceServiceProvider.get(OptionalReferenceUpdaterProxy.class).get();
		if (referenceUpdater != null)
			provider2updater.put(resourceServiceProvider, referenceUpdater);
	}
	return referenceUpdater;
}
 
Example #4
Source File: SharedCommonTypesModule.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
public void configure(Binder binder) {
	binder.bind(IEObjectHoverProvider.class).to(JdtHoverProvider.class);
	binder.bind(IEObjectHoverDocumentationProvider.class).to(JdtHoverDocumentationProvider.class);
	binder.bind(IResourceServiceProvider.class).to(SharedCommonTypesResourceServiceProvider.class);
	binder.bind(IResourceSetProvider.class).to(XtextResourceSetProvider.class);
	binder.bindConstant().annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).to("java");

	binder.bind(IQualifiedNameProvider.class).to(JvmIdentifiableQualifiedNameProvider.class);
	binder.bind(ICopyQualifiedNameService.class).to(DefaultCopyQualifiedNameService.class);
	binder.bind(IJvmTypeProvider.Factory.class).to(JdtTypeProviderFactory.class);
	binder.bind(IRenameRefactoringProvider.class).to(DefaultRenameRefactoringProvider.class);
	binder.bind(AbstractRenameProcessor.class).to(JvmMemberRenameProcessor.class);
	binder.bind(IRenameStrategy.Provider.class).to(JvmMemberRenameStrategy.Provider.class);
	binder.bind(RefactoringResourceSetProvider.class).to(JvmRefactoringResourceSetProvider.class);
	binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("Java");

	binder.bind(IResourceDescriptions.class).annotatedWith(Names.named(ResourceDescriptionsProvider.LIVE_SCOPE))
			.to(LiveShadowedResourceDescriptions.class);
	binder.bind(IResourceDescriptions.class)
			.annotatedWith(Names.named(ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE))
			.to(CurrentDescriptions.ResourceSetAware.class);
	binder.bind(IResourceDescriptions.class)
			.annotatedWith(Names.named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS))
			.to(IBuilderState.class);

	binder.bind(IWorkspaceRoot.class).toInstance(ResourcesPlugin.getWorkspace().getRoot());
	binder.bind(ITraceForStorageProvider.class).to(TraceForStorageProvider.class);

	binder.bind(IReferenceUpdater.class).to(NullReferenceUpdater.class);
}
 
Example #5
Source File: AbstractArithmeticsUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #6
Source File: AbstractRuleEngineUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #7
Source File: AbstractBuilderTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #8
Source File: EmfUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return EmfResourceReferenceUpdater.class;
}
 
Example #9
Source File: DefaultResourceUIServiceProvider.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @deprecated use <code>get(IReferenceUpdater.class)</code> instead
 */
@Override
@Deprecated
public IReferenceUpdater getReferenceUpdater() {
	return get(IReferenceUpdater.class);
}
 
Example #10
Source File: ReferenceUpdaterDispatcher.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Multimap<IReferenceUpdater, IReferenceDescription> getReferenceUpdater2ReferenceDescriptions() {
	return updater2refs;
}
 
Example #11
Source File: ReferenceUpdaterDispatcher.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public IReferenceUpdater get() {
	return referenceUpdater;
}
 
Example #12
Source File: AbstractPureXbaseUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #13
Source File: AbstractBug462047LangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #14
Source File: AbstractXImportSectionTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #15
Source File: AbstractContentAssistFragmentTestLangUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #16
Source File: AbstractXtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #17
Source File: XtendUiModule.java    From xtext-xtend with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @since 2.12
 */
@Override
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XtendReferenceUpdater.class;
}
 
Example #18
Source File: AbstractHelloWorldUiModule.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #19
Source File: AbstractGamlUiModule.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #20
Source File: AbstractSARLUiModule.java    From sarl with Apache License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return XbaseReferenceUpdater.class;
}
 
Example #21
Source File: AbstractReferringTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #22
Source File: AbstractRegularExpressionUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #23
Source File: AbstractJSONUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #24
Source File: AbstractTypesUiModule.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #25
Source File: AbstractBromiumUiModule.java    From bromium with MIT License 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #26
Source File: AbstractMyDslUiModule.java    From M2Doc with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #27
Source File: AbstractXtextGrammarTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #28
Source File: AbstractNoJdtTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #29
Source File: AbstractNestedRefsTestLanguageUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}
 
Example #30
Source File: AbstractXmlUiModule.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
	return DefaultReferenceUpdater.class;
}