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(elementRenameArguments.getRenamedElementURIs(),resourceAccess,referenceDescriptionAcceptor,progress.newChild(2));
Multimap<IReferenceUpdater,IReferenceDescription> updater2descriptions = referenceDescriptionAcceptor
.getReferenceUpdater2ReferenceDescriptions();
SubMonitor updaterProgress = progress.newChild(98).setWorkRemaining(updater2descriptions.keySet().size());
for (IReferenceUpdater referenceUpdater : updater2descriptions.keySet()) {
createReferenceUpdates(referenceUpdater,elementRenameArguments,updater2descriptions.get(referenceUpdater),updateAcceptor,updaterProgress);
}
}
protected void createReferenceUpdates(IReferenceUpdater referenceUpdater,ElementRenameArguments elementRenameArguments,Iterable<IReferenceDescription> referenceDescriptions,SubMonitor updaterProgress) {
if (updaterProgress.isCanceled())
return;
referenceUpdater.createReferenceUpdates(elementRenameArguments,referenceDescriptions,updaterProgress.newChild(1));
}
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);
}
}
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;
}
项目:pokemon-tcgo-deck-generator
文件:AbstractPkmntcgoUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:n4js
文件:AbstractN4JSUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:n4js
文件:AbstractRegularExpressionUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:n4js
文件:AbstractN4MFUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:n4js
文件:AbstractTypesUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:Xtext_Xtend_HTML_Generator
文件:AbstractMyDslUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:gw4e.project
文件:AbstractDSLPoliciesUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return XbaseReferenceUpdater.class;
}
项目:lcdsl
文件:AbstractLcDslUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:org.xtext.dsl.restaurante
文件:AbstractRestauranteUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:M2Doc
文件:AbstractMyDslUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:minitl
文件:AbstractMinitlUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:Sparrow
文件:AbstractModelEditorUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:bts
文件:EmfUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return EmfResourceReferenceUpdater.class;
}
项目:bts
文件:DefaultResourceUIServiceProvider.java
/**
* @deprecated use <code>get(IReferenceUpdater.class)</code> instead
*/
@Deprecated
public IReferenceUpdater getReferenceUpdater() {
return get(IReferenceUpdater.class);
}
public Multimap<IReferenceUpdater,IReferenceDescription> getReferenceUpdater2ReferenceDescriptions() {
return updater2refs;
}
public IReferenceUpdater get() {
return referenceUpdater;
}
项目:cs2as
文件:AbstractASBHLangUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:cs2as
文件:AbstractMiniOCLUiModule.java
public Class<? extends IReferenceUpdater> bindIReferenceUpdater() {
return DefaultReferenceUpdater.class;
}
项目:bts
文件:IResourceUIServiceProvider.java
/**
* The reference updater of the language.
* @deprecated use {@link #get(Class) get(IReferenceUpdater.class)} instead
*/
@Deprecated
IReferenceUpdater getReferenceUpdater();
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。