本文整理了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.isOK
方法的一些代码示例,展示了RefactoringStatus.isOK
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RefactoringStatus.isOK
方法的具体详情如下:
包路径:org.eclipse.ltk.core.refactoring.RefactoringStatus
类名称:RefactoringStatus
方法名:isOK
[英]Returns whether the status's severity is OK
or not.
[中]返回状态的严重性是否为OK
。
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
/**
* {@inheritDoc}
*/
public RefactoringStatus checkPostConditions(IProgressMonitor monitor) throws CoreException {
fCodeGeneratorSettings= null;
if (fStatus == null || fStatus.isOK()) {
return super.checkPostConditions(monitor);
} else {
return fStatus;
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring
private IStatus asStatus(RefactoringStatus status) {
if (status.isOK()) {
return Status.OK_STATUS;
} else {
return status.getEntryWithHighestSeverity().toStatus();
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
public static ReorgTypedSourcePasteStarter create(TypedSource[] typedSources, IJavaElement destination) {
Assert.isNotNull(typedSources);
Assert.isNotNull(destination);
PasteTypedSourcesRefactoring pasteRefactoring= PasteTypedSourcesRefactoring.create(typedSources);
if (pasteRefactoring == null)
return null;
if (! pasteRefactoring.setDestination(destination).isOK())
return null;
return new ReorgTypedSourcePasteStarter(pasteRefactoring);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ltk.core.refactoring
private IStatus asStatus(RefactoringStatus status) {
if (status.isOK()) {
return Status.OK_STATUS;
} else {
return status.getEntryWithHighestSeverity().toStatus();
}
}
代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring
private IStatus createStatus(ExecuteResult result) {
if (!result.validationStatus.isOK()) {
return result.validationStatus.getEntryWithHighestSeverity().toStatus();
} else {
return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR,
RefactoringCoreMessages.UndoableOperation2ChangeAdapter_error_message,
null);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring
private IStatus asStatus(RefactoringStatus status) {
if (status.isOK()) {
return new Status(IStatus.OK, RefactoringCorePlugin.getPluginId(), IStatus.OK, "", null); //$NON-NLS-1$
} else {
return status.getEntryWithHighestSeverity().toStatus();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring
private IStatus createStatus(ExecuteResult result) {
if (!result.validationStatus.isOK()) {
return result.validationStatus.getEntryWithHighestSeverity().toStatus();
} else {
return new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IStatus.ERROR,
RefactoringCoreMessages.UndoableOperation2ChangeAdapter_error_message,
null);
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public static ReorgMoveStarter create(IJavaElement[] javaElements, IResource[] resources, IJavaElement destination) throws JavaModelException {
Assert.isNotNull(javaElements);
Assert.isNotNull(resources);
Assert.isNotNull(destination);
IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(resources, javaElements);
if (!policy.canEnable())
return null;
JavaMoveProcessor processor= new JavaMoveProcessor(policy);
if (! processor.setDestination(destination).isOK())
return null;
return new ReorgMoveStarter(processor);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public static ReorgCopyStarter create(IJavaElement[] javaElements, IResource[] resources, IJavaElement destination) throws JavaModelException {
Assert.isNotNull(javaElements);
Assert.isNotNull(resources);
Assert.isNotNull(destination);
ICopyPolicy copyPolicy= ReorgPolicyFactory.createCopyPolicy(resources, javaElements);
if (!copyPolicy.canEnable())
return null;
JavaCopyProcessor copyProcessor= new JavaCopyProcessor(copyPolicy);
if (!copyProcessor.setDestination(destination).isOK())
return null;
return new ReorgCopyStarter(copyProcessor);
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
public static ReorgCopyStarter create(IJavaElement[] javaElements, IResource[] resources, IReorgDestination destination) throws JavaModelException {
Assert.isNotNull(javaElements);
Assert.isNotNull(resources);
if (destination == null)
return null;
ICopyPolicy copyPolicy= ReorgPolicyFactory.createCopyPolicy(resources, javaElements);
if (!copyPolicy.canEnable())
return null;
JavaCopyProcessor copyProcessor= new JavaCopyProcessor(copyPolicy);
if (!copyProcessor.setDestination(destination).isOK())
return null;
return new ReorgCopyStarter(copyProcessor);
}
代码示例来源:origin: eclipse/eclipse.jdt.ls
private boolean willRenameCU() {
String name = JavaCore.removeJavaLikeExtension(fType.getCompilationUnit().getElementName());
if (!(Checks.isTopLevel(fType) && name.equals(fType.getElementName()))) {
return false;
}
if (!checkNewPathValidity().isOK()) {
return false;
}
if (!Checks.checkCompilationUnitNewName(fType.getCompilationUnit(), getNewElementName()).isOK()) {
return false;
}
return true;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private boolean willRenameCU() throws CoreException{
String name = JavaCore.removeJavaLikeExtension(fType.getCompilationUnit().getElementName());
if (! (Checks.isTopLevel(fType) && name.equals(fType.getElementName())))
return false;
if (! checkNewPathValidity().isOK())
return false;
if (! Checks.checkCompilationUnitNewName(fType.getCompilationUnit(), getNewElementName()).isOK())
return false;
return true;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private boolean willRenameCU() {
String name = JavaCore.removeJavaLikeExtension(fType.getCompilationUnit().getElementName());
if (! (Checks.isTopLevel(fType) && name.equals(fType.getElementName())))
return false;
if (! checkNewPathValidity().isOK())
return false;
if (! Checks.checkCompilationUnitNewName(fType.getCompilationUnit(), getNewElementName()).isOK())
return false;
return true;
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void widgetSelected(SelectionEvent e) {
IType factoryType= chooseFactoryClass();
if (factoryType == null)
return;
RefactoringStatus status= getUseFactoryRefactoring().setFactoryClass(factoryType.getFullyQualifiedName());
boolean nameOk= status.isOK();
factoryTypeName.setText(factoryType.getFullyQualifiedName());
IntroduceFactoryInputPage.this.setPageComplete(nameOk);
IntroduceFactoryInputPage.this.setErrorMessage(nameOk ? "" : //$NON-NLS-1$
status.getMessageMatchingSeverity(RefactoringStatus.ERROR));
}
});
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private final void verifyDestination(Object selected, boolean initialVerification) {
try {
RefactoringStatus status= verifyDestination(selected);
if (initialVerification)
setPageComplete(status.isOK());
else
setPageComplete(status);
} catch (JavaModelException e) {
JavaPlugin.log(e);
setPageComplete(false);
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
private IStatus validateType() {
if (fType == null)
return null;
String type= fType.getText();
RefactoringStatus status= TypeContextChecker.checkParameterTypeSyntax(type, fContext.getCuHandle().getJavaProject());
if (status == null || status.isOK())
return Status.OK_STATUS;
if (status.hasError())
return createErrorStatus(status.getEntryWithHighestSeverity().getMessage());
else
return createWarningStatus(status.getEntryWithHighestSeverity().getMessage());
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private IStatus validateType() {
if (fType == null)
return null;
String type= fType.getText();
RefactoringStatus status= TypeContextChecker.checkParameterTypeSyntax(type, fContext.getCuHandle().getJavaProject());
if (status == null || status.isOK())
return createOkStatus();
if (status.hasError())
return createErrorStatus(status.getEntryWithHighestSeverity().getMessage());
else
return createWarningStatus(status.getEntryWithHighestSeverity().getMessage());
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
private int handleValidateCopy(Object target) throws JavaModelException {
final ICopyPolicy policy= ReorgPolicyFactory.createCopyPolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements));
fCopyProcessor= policy.canEnable() ? new JavaCopyProcessor(policy) : null;
if (!canCopyElements())
return DND.DROP_NONE;
if (fCopyProcessor == null)
return DND.DROP_NONE;
if (!fCopyProcessor.setDestination(ReorgDestinationFactory.createDestination(target)).isOK())
return DND.DROP_NONE;
return DND.DROP_COPY;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public static boolean isApplicable(IInvocationContext context) throws CoreException {
ICompilationUnit unit= context.getCompilationUnit();
CompilationUnit ast= SharedASTProvider.getAST(unit, SharedASTProvider.WAIT_NO, null);
if (ast == null)
return true;
Selection selection= Selection.createFromStartLength(context.getSelectionOffset(), context.getSelectionLength());
SurroundWithAnalyzer analyzer= new SurroundWithAnalyzer(unit, selection, false);
context.getASTRoot().accept(analyzer);
return analyzer.getStatus().isOK() && analyzer.hasSelectedNodes();
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public static boolean isApplicable(IInvocationContext context) throws JavaModelException {
ICompilationUnit unit= context.getCompilationUnit();
CompilationUnit ast= ASTProvider.getASTProvider().getAST(unit, ASTProvider.WAIT_NO, null);
if (ast == null)
return true;
Selection selection= Selection.createFromStartLength(context.getSelectionOffset(), context.getSelectionLength());
SurroundWithAnalyzer analyzer= new SurroundWithAnalyzer(unit, selection);
context.getASTRoot().accept(analyzer);
return analyzer.getStatus().isOK() && analyzer.hasSelectedNodes();
}
内容来源于网络,如有侵权,请联系作者删除!