本文整理匯總了Java中org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer.getReferenceNodes方法的典型用法代碼示例。如果您正苦於以下問題:Java TempOccurrenceAnalyzer.getReferenceNodes方法的具體用法?Java TempOccurrenceAnalyzer.getReferenceNodes怎麽用?Java TempOccurrenceAnalyzer.getReferenceNodes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer
的用法示例。
在下文中一共展示了TempOccurrenceAnalyzer.getReferenceNodes方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkIfDeletedParametersUsed
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
protected void checkIfDeletedParametersUsed() {
for (Iterator<ParameterInfo> iter = getDeletedInfos().iterator(); iter.hasNext(); ) {
ParameterInfo info = iter.next();
VariableDeclaration paramDecl = getParameter(info.getOldIndex());
TempOccurrenceAnalyzer analyzer = new TempOccurrenceAnalyzer(paramDecl, false);
analyzer.perform();
SimpleName[] paramRefs = analyzer.getReferenceNodes();
if (paramRefs.length > 0) {
RefactoringStatusContext context =
JavaStatusContext.create(fCuRewrite.getCu(), paramRefs[0]);
String typeName = getFullTypeName();
Object[] keys =
new String[] {
BasicElementLabels.getJavaElementName(paramDecl.getName().getIdentifier()),
BasicElementLabels.getJavaElementName(getMethod().getElementName()),
BasicElementLabels.getJavaElementName(typeName)
};
String msg =
Messages.format(
RefactoringCoreMessages.ChangeSignatureRefactoring_parameter_used, keys);
fResult.addError(msg, context);
}
}
}
示例2: addTempRenames
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
private void addTempRenames(ASTRewrite rewrite) {
boolean noNameChange = fFieldName.equals(fTempDeclarationNode.getName().getIdentifier());
if (fLinkedProposalModel == null && noNameChange) {
return; // no changes needed
}
TempOccurrenceAnalyzer analyzer = new TempOccurrenceAnalyzer(fTempDeclarationNode, false);
analyzer.perform();
SimpleName[] tempRefs =
analyzer.getReferenceNodes(); // no javadocs (refactoring not for parameters)
for (int j = 0; j < tempRefs.length; j++) {
SimpleName occurence = tempRefs[j];
if (noNameChange) {
addLinkedName(rewrite, occurence, false);
} else {
SimpleName newName = getAST().newSimpleName(fFieldName);
addLinkedName(rewrite, newName, false);
rewrite.replace(occurence, newName, null);
}
}
}
示例3: checkIfDeletedParametersUsed
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
protected void checkIfDeletedParametersUsed() {
for (Iterator<ParameterInfo> iter= getDeletedInfos().iterator(); iter.hasNext();) {
ParameterInfo info= iter.next();
VariableDeclaration paramDecl= getParameter(info.getOldIndex());
TempOccurrenceAnalyzer analyzer= new TempOccurrenceAnalyzer(paramDecl, false);
analyzer.perform();
SimpleName[] paramRefs= analyzer.getReferenceNodes();
if (paramRefs.length > 0) {
RefactoringStatusContext context= JavaStatusContext.create(fCuRewrite.getCu(), paramRefs[0]);
String typeName= getFullTypeName();
Object[] keys= new String[] { BasicElementLabels.getJavaElementName(paramDecl.getName().getIdentifier()),
BasicElementLabels.getJavaElementName(getMethod().getElementName()),
BasicElementLabels.getJavaElementName(typeName) };
String msg= Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_parameter_used, keys);
fResult.addError(msg, context);
}
}
}
示例4: addTempRenames
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
private void addTempRenames(ASTRewrite rewrite) {
boolean noNameChange= fFieldName.equals(fTempDeclarationNode.getName().getIdentifier());
if (fLinkedProposalModel == null && noNameChange) {
return; // no changes needed
}
TempOccurrenceAnalyzer analyzer= new TempOccurrenceAnalyzer(fTempDeclarationNode, false);
analyzer.perform();
SimpleName[] tempRefs= analyzer.getReferenceNodes(); // no javadocs (refactoring not for parameters)
for (int j= 0; j < tempRefs.length; j++) {
SimpleName occurence= tempRefs[j];
if (noNameChange) {
addLinkedName(rewrite, occurence, false);
} else {
SimpleName newName= getAST().newSimpleName(fFieldName);
addLinkedName(rewrite, newName, false);
rewrite.replace(occurence, newName, null);
}
}
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:22,代碼來源:PromoteTempToFieldRefactoring.java
示例5: checkIfDeletedParametersUsed
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
private void checkIfDeletedParametersUsed() {
for (Iterator<ParameterInfo> iter= getDeletedInfos().iterator(); iter.hasNext();) {
ParameterInfo info= iter.next();
SingleVariableDeclaration paramDecl= (SingleVariableDeclaration) fMethDecl.parameters().get(info.getOldIndex());
TempOccurrenceAnalyzer analyzer= new TempOccurrenceAnalyzer(paramDecl, false);
analyzer.perform();
SimpleName[] paramRefs= analyzer.getReferenceNodes();
if (paramRefs.length > 0){
RefactoringStatusContext context= JavaStatusContext.create(fCuRewrite.getCu(), paramRefs[0]);
String typeName= getFullTypeName(fMethDecl);
Object[] keys= new String[]{ BasicElementLabels.getJavaElementName(paramDecl.getName().getIdentifier()),
BasicElementLabels.getJavaElementName(fMethDecl.getName().getIdentifier()),
BasicElementLabels.getJavaElementName(typeName)};
String msg= Messages.format(RefactoringCoreMessages.ChangeSignatureRefactoring_parameter_used, keys);
fResult.addError(msg, context);
}
}
}
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion-Juno38,代碼行數:20,代碼來源:ChangeSignatureProcessor.java
示例6: getReferences
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
public SimpleName[] getReferences() {
if (fReferences != null) return fReferences;
TempOccurrenceAnalyzer analyzer = new TempOccurrenceAnalyzer(getVariableDeclaration(), false);
analyzer.perform();
fReferences = analyzer.getReferenceNodes();
return fReferences;
}
示例7: getReferences
import org.eclipse.jdt.internal.corext.refactoring.rename.TempOccurrenceAnalyzer; //導入方法依賴的package包/類
public SimpleName[] getReferences() {
if (fReferences != null)
return fReferences;
TempOccurrenceAnalyzer analyzer= new TempOccurrenceAnalyzer(getVariableDeclaration(), false);
analyzer.perform();
fReferences= analyzer.getReferenceNodes();
return fReferences;
}