本文整理了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.addInfo
方法的一些代码示例,展示了RefactoringStatus.addInfo
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RefactoringStatus.addInfo
方法的具体详情如下:
包路径:org.eclipse.ltk.core.refactoring.RefactoringStatus
类名称:RefactoringStatus
方法名:addInfo
[英]Adds an INFO
entry filled with the given message to this status. If the current severity is OK
it will be changed to INFO
. It will remain unchanged otherwise.
[中]将包含给定消息的INFO
条目添加到此状态。如果当前严重性为OK
,则将更改为INFO
。否则将保持不变。
代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring
/**
* Adds an <code>INFO</code> entry filled with the given message to this status.
* If the current severity is <code>OK</code> it will be changed to <code>INFO
* </code>. It will remain unchanged otherwise.
*
* @param msg the message of the info entry
*
* @see RefactoringStatusEntry
*/
public void addInfo(String msg) {
addInfo(msg, null);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ltk.core.refactoring
/**
* Adds an <code>INFO</code> entry filled with the given message to this status.
* If the current severity is <code>OK</code> it will be changed to <code>INFO
* </code>. It will remain unchanged otherwise.
*
* @param msg the message of the info entry
*
* @see RefactoringStatusEntry
*/
public void addInfo(String msg) {
addInfo(msg, null);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring
/**
* Adds an <code>INFO</code> entry filled with the given message to this status.
* If the current severity is <code>OK</code> it will be changed to <code>INFO
* </code>. It will remain unchanged otherwise.
*
* @param msg the message of the info entry
*
* @see RefactoringStatusEntry
*/
public void addInfo(String msg) {
addInfo(msg, null);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
result.addInfo(msg);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
result.addInfo(msg);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
result.addInfo(msg);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public static ICleanUpFix createCleanUp(final CompilationUnit cu, CodeGenerationSettings settings, boolean organizeImports, RefactoringStatus status) throws CoreException {
if (!organizeImports)
return null;
final boolean hasAmbiguity[]= new boolean[] { false };
IChooseImportQuery query= new IChooseImportQuery() {
@Override
public TypeNameMatch[] chooseImports(TypeNameMatch[][] openChoices, ISourceRange[] ranges) {
hasAmbiguity[0]= true;
return new TypeNameMatch[0];
}
};
final ICompilationUnit unit= (ICompilationUnit)cu.getJavaElement();
OrganizeImportsOperation op= new OrganizeImportsOperation(unit, cu, settings.importIgnoreLowercase, false, false, query);
final TextEdit edit= op.createTextEdit(null);
if (hasAmbiguity[0]) {
status.addInfo(Messages.format(ActionMessages.OrganizeImportsAction_multi_error_unresolvable, getLocationString(cu)));
}
if (op.getParseError() != null) {
status.addInfo(Messages.format(ActionMessages.OrganizeImportsAction_multi_error_parse, getLocationString(cu)));
return null;
}
if (edit == null || (edit instanceof MultiTextEdit && edit.getChildrenSize() == 0))
return null;
return new ImportsFix(edit, unit, FixMessages.ImportsFix_OrganizeImports_Description);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
public static ICleanUpFix createCleanUp(final CompilationUnit cu, CodeGenerationSettings settings, boolean organizeImports, RefactoringStatus status) throws CoreException {
if (!organizeImports)
return null;
final boolean hasAmbiguity[]= new boolean[] { false };
IChooseImportQuery query= new IChooseImportQuery() {
@Override
public TypeNameMatch[] chooseImports(TypeNameMatch[][] openChoices, ISourceRange[] ranges) {
hasAmbiguity[0]= true;
return new TypeNameMatch[0];
}
};
final ICompilationUnit unit= (ICompilationUnit)cu.getJavaElement();
OrganizeImportsOperation op= new OrganizeImportsOperation(unit, cu, settings.importIgnoreLowercase, false, false, query);
final TextEdit edit= op.createTextEdit(null);
if (hasAmbiguity[0]) {
status.addInfo(Messages.format(ActionMessages.OrganizeImportsAction_multi_error_unresolvable, getLocationString(cu)));
}
if (op.getParseError() != null) {
status.addInfo(Messages.format(ActionMessages.OrganizeImportsAction_multi_error_parse, getLocationString(cu)));
return null;
}
if (edit == null || (edit instanceof MultiTextEdit && edit.getChildrenSize() == 0))
return null;
return new ImportsFix(edit, unit, FixMessages.ImportsFix_OrganizeImports_Description);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
edit= op.createTextEdit(null);
} catch (AmbiguousImportException e) {
status.addInfo(Messages.format(ActionMessages.OrganizeImportsAction_multi_error_unresolvable, getLocationString(cu)));
return null;
status.addInfo(Messages.format(ActionMessages.OrganizeImportsAction_multi_error_parse, getLocationString(cu)));
return null;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
protected RefactoringStatus verifyDestination(IJavaElement destination) throws JavaModelException {
RefactoringStatus superStatus= super.verifyDestination(destination);
if (superStatus.hasFatalError())
return superStatus;
Object commonParent= new ParentChecker(getResources(), getJavaElements()).getCommonParent();
if (destination.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IContainer destinationAsContainer= getDestinationAsContainer();
if (destinationAsContainer != null && (destinationAsContainer.equals(commonParent) || commonParent instanceof IPackageFragmentRoot
&& destinationAsContainer.equals(((IPackageFragmentRoot) commonParent).getResource())))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IPackageFragment destinationAsPackage= getDestinationAsPackageFragment();
if (destinationAsPackage != null && (destinationAsPackage.equals(commonParent)))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
if (cannotUpdateReferencesForDestination())
superStatus.addInfo(RefactoringCoreMessages.ReorgPolicyFactory_noJavaUpdates);
return superStatus;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
protected RefactoringStatus verifyDestination(IResource destination) throws JavaModelException {
RefactoringStatus superStatus= super.verifyDestination(destination);
if (superStatus.hasFatalError())
return superStatus;
Object commonParent= getCommonParent();
if (destination.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IContainer destinationAsContainer= getDestinationAsContainer();
if (destinationAsContainer != null && destinationAsContainer.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IJavaElement destinationContainerAsPackage= getDestinationContainerAsJavaElement();
if (destinationContainerAsPackage != null && destinationContainerAsPackage.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
if (cannotUpdateReferencesForDestination())
superStatus.addInfo(RefactoringCoreMessages.ReorgPolicyFactory_noJavaUpdates);
return superStatus;
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
protected RefactoringStatus verifyDestination(IResource destination) throws JavaModelException {
RefactoringStatus superStatus= super.verifyDestination(destination);
if (superStatus.hasFatalError())
return superStatus;
Object commonParent= getCommonParent();
if (destination.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IContainer destinationAsContainer= getDestinationAsContainer();
if (destinationAsContainer != null && destinationAsContainer.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IJavaElement destinationContainerAsPackage= getDestinationContainerAsJavaElement();
if (destinationContainerAsPackage != null && destinationContainerAsPackage.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
if (cannotUpdateReferencesForDestination())
superStatus.addInfo(RefactoringCoreMessages.ReorgPolicyFactory_noJavaUpdates);
return superStatus;
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
protected RefactoringStatus verifyDestination(IJavaElement destination) throws JavaModelException {
RefactoringStatus superStatus= super.verifyDestination(destination);
if (superStatus.hasFatalError())
return superStatus;
Object commonParent= new ParentChecker(getResources(), getJavaElements()).getCommonParent();
if (destination.equals(commonParent))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IContainer destinationAsContainer= getDestinationAsContainer();
if (destinationAsContainer != null && (destinationAsContainer.equals(commonParent) || commonParent instanceof IPackageFragmentRoot
&& destinationAsContainer.equals(((IPackageFragmentRoot) commonParent).getResource())))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
IPackageFragment destinationAsPackage= getDestinationAsPackageFragment();
if (destinationAsPackage != null && (destinationAsPackage.equals(commonParent)))
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
if (cannotUpdateReferencesForDestination())
superStatus.addInfo(RefactoringCoreMessages.ReorgPolicyFactory_noJavaUpdates);
return superStatus;
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
@Override
protected RefactoringStatus verifyDestination(IResource destination) throws JavaModelException {
RefactoringStatus superStatus= super.verifyDestination(destination);
if (superStatus.hasFatalError()) {
return superStatus;
}
Object commonParent= getCommonParent();
if (destination.equals(commonParent)) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
}
IContainer destinationAsContainer= getDestinationAsContainer();
if (destinationAsContainer != null && destinationAsContainer.equals(commonParent)) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
}
IJavaElement destinationContainerAsPackage= getDestinationContainerAsJavaElement();
if (destinationContainerAsPackage != null && destinationContainerAsPackage.equals(commonParent)) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
}
if (cannotUpdateReferencesForDestination()) {
superStatus.addInfo(RefactoringCoreMessages.ReorgPolicyFactory_noJavaUpdates);
}
return superStatus;
}
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
@Override
protected RefactoringStatus verifyDestination(IJavaElement destination) throws JavaModelException {
RefactoringStatus superStatus= super.verifyDestination(destination);
if (superStatus.hasFatalError()) {
return superStatus;
}
Object commonParent= new ParentChecker(getResources(), getJavaElements()).getCommonParent();
if (destination.equals(commonParent)) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
}
IContainer destinationAsContainer= getDestinationAsContainer();
if (destinationAsContainer != null && (destinationAsContainer.equals(commonParent) || commonParent instanceof IPackageFragmentRoot
&& destinationAsContainer.equals(((IPackageFragmentRoot) commonParent).getResource()))) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
}
IPackageFragment destinationAsPackage= getDestinationAsPackageFragment();
if (destinationAsPackage != null && (destinationAsPackage.equals(commonParent))) {
return RefactoringStatus.createFatalErrorStatus(RefactoringCoreMessages.ReorgPolicyFactory_parent);
}
if (cannotUpdateReferencesForDestination()) {
superStatus.addInfo(RefactoringCoreMessages.ReorgPolicyFactory_noJavaUpdates);
}
return superStatus;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_field_delegate_not_final, BasicElementLabels.getJavaElementName(frag.getName().getIdentifier())), null);
} else if (frag.getInitializer() == null) {
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_field_delegate_no_initializer, BasicElementLabels.getJavaElementName(frag.getName().getIdentifier())), null);
} else {
DelegateFieldCreator creator= new DelegateFieldCreator();
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_delegate_for_type, BasicElementLabels.getJavaElementName(((AbstractTypeDeclaration) declaration).getName().getIdentifier())),
null);
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_field_delegate_not_final, frag.getName()), null);
} else if (frag.getInitializer() == null) {
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_field_delegate_no_initializer, frag.getName()), null);
} else {
DelegateFieldCreator creator= new DelegateFieldCreator();
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_delegate_for_type, ((AbstractTypeDeclaration) declaration).getName().getIdentifier()),
null);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_field_delegate_not_final, BasicElementLabels.getJavaElementName(frag.getName().getIdentifier())), null);
} else if (frag.getInitializer() == null) {
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_field_delegate_no_initializer, BasicElementLabels.getJavaElementName(frag.getName().getIdentifier())), null);
} else {
DelegateFieldCreator creator= new DelegateFieldCreator();
result.addInfo(Messages.format(RefactoringCoreMessages.DelegateCreator_cannot_create_delegate_for_type, BasicElementLabels.getJavaElementName(((AbstractTypeDeclaration) declaration).getName().getIdentifier())),
null);
内容来源于网络,如有侵权,请联系作者删除!