public static ReorgMoveStarter create(IJavaElement[] javaElements, IResource[] resources, IReorgDestination 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).hasError()) return null; return new ReorgMoveStarter(processor); }
public static ReorgMoveStarter create(IJavaElement[] javaElements, IResource[] resources, IReorgDestination 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).hasError()) return null; return new ReorgMoveStarter(processor); }
private void validateInput(boolean methodName) { RefactoringStatus merged= new RefactoringStatus(); if (fMethodNameStatus != null && (methodName || fMethodNameStatus.hasError())) merged.merge(fMethodNameStatus); if (fDestinationStatus != null && (!methodName || fDestinationStatus.hasError())) merged.merge(fDestinationStatus); setPageComplete(!merged.hasError()); int severity= merged.getSeverity(); String message= merged.getMessageMatchingSeverity(severity); if (severity >= RefactoringStatus.INFO) { setMessage(message, severity); } else { setMessage("", NONE); //$NON-NLS-1$ } } }
private void validateInput(boolean methodName) { RefactoringStatus merged= new RefactoringStatus(); if (fMethodNameStatus != null && (methodName || fMethodNameStatus.hasError())) merged.merge(fMethodNameStatus); if (fDestinationStatus != null && (!methodName || fDestinationStatus.hasError())) merged.merge(fDestinationStatus); setPageComplete(!merged.hasError()); int severity= merged.getSeverity(); String message= merged.getMessageMatchingSeverity(severity); if (severity >= RefactoringStatus.INFO) { setMessage(message, severity); } else { setMessage("", NONE); //$NON-NLS-1$ } } }
private void validateInput(boolean methodName) { RefactoringStatus merged= new RefactoringStatus(); if (fMethodNameStatus != null && (methodName || fMethodNameStatus.hasError())) merged.merge(fMethodNameStatus); if (fDestinationStatus != null && (!methodName || fDestinationStatus.hasError())) merged.merge(fDestinationStatus); setPageComplete(!merged.hasError()); int severity= merged.getSeverity(); String message= merged.getMessageMatchingSeverity(severity); if (severity >= RefactoringStatus.INFO) { setMessage(message, severity); } else { setMessage("", NONE); //$NON-NLS-1$ } } }
private int showStatus(RefactoringStatus status) { if (!status.hasError()) return Window.OK; Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Dialog dialog= RefactoringUI.createRefactoringStatusDialog(status, shell, "", false); //$NON-NLS-1$ return dialog.open(); }
private int showStatus(RefactoringStatus status) { if (!status.hasError()) return Window.OK; Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Dialog dialog= RefactoringUI.createRefactoringStatusDialog(status, shell, "", false); //$NON-NLS-1$ return dialog.open(); }
private int showStatus(RefactoringStatus status) { if (!status.hasError()) return Window.OK; Shell shell= PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); Dialog dialog= RefactoringUI.createRefactoringStatusDialog(status, shell, "", false); //$NON-NLS-1$ return dialog.open(); }
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()); }
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()); }
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()); }
public final RefactoringStatus checkInitialConditions(final IProgressMonitor monitor) throws CoreException, OperationCanceledException { Assert.isNotNull(monitor); final RefactoringStatus status= new RefactoringStatus(); try { monitor.beginTask("", 4); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_checking); status.merge(Checks.checkIfCuBroken(fMethod)); if (!status.hasError()) { checkMethodDeclaration(new SubProgressMonitor(monitor, 1), status); if (status.isOK()) { final MethodDeclaration declaration= ASTNodeSearchUtil.getMethodDeclarationNode(fMethod, fSourceRewrite.getRoot()); checkGenericTypes(new SubProgressMonitor(monitor, 1), declaration, status); checkMethodBody(new SubProgressMonitor(monitor, 1), declaration, status); checkPossibleTargets(new SubProgressMonitor(monitor, 1), declaration, status); } } } finally { monitor.done(); } return status; }
@Override public final RefactoringStatus checkInitialConditions(final IProgressMonitor monitor) throws CoreException, OperationCanceledException { Assert.isNotNull(monitor); final RefactoringStatus status= new RefactoringStatus(); try { monitor.beginTask("", 4); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_checking); status.merge(Checks.checkIfCuBroken(fMethod)); if (!status.hasError()) { checkMethodDeclaration(new SubProgressMonitor(monitor, 1), status); if (status.isOK()) { final MethodDeclaration declaration= ASTNodeSearchUtil.getMethodDeclarationNode(fMethod, fSourceRewrite.getRoot()); checkGenericTypes(new SubProgressMonitor(monitor, 1), declaration, status); checkMethodBody(new SubProgressMonitor(monitor, 1), declaration, status); checkPossibleTargets(new SubProgressMonitor(monitor, 1), declaration, status); } } } finally { monitor.done(); } return status; }
private void validateInput() { RefactoringStatus merged= new RefactoringStatus(); merged.merge(getIntroduceIndirectionRefactoring().setIntermediaryTypeName(fIntermediaryTypeName.getText())); merged.merge(getIntroduceIndirectionRefactoring().setIntermediaryMethodName(fIntermediaryMethodName.getText())); setPageComplete(!merged.hasError()); int severity= merged.getSeverity(); String message= merged.getMessageMatchingSeverity(severity); if (severity >= RefactoringStatus.INFO) { setMessage(message, severity); } else { setMessage("", NONE); //$NON-NLS-1$ } }
@Override public final RefactoringStatus checkInitialConditions(final IProgressMonitor monitor) throws CoreException, OperationCanceledException { Assert.isNotNull(monitor); final RefactoringStatus status= new RefactoringStatus(); try { monitor.beginTask("", 4); //$NON-NLS-1$ monitor.setTaskName(RefactoringCoreMessages.MoveInstanceMethodProcessor_checking); status.merge(Checks.checkIfCuBroken(fMethod)); if (!status.hasError()) { checkMethodDeclaration(new SubProgressMonitor(monitor, 1), status); if (status.isOK()) { final MethodDeclaration declaration= ASTNodeSearchUtil.getMethodDeclarationNode(fMethod, fSourceRewrite.getRoot()); checkGenericTypes(new SubProgressMonitor(monitor, 1), declaration, status); checkMethodBody(new SubProgressMonitor(monitor, 1), declaration, status); checkPossibleTargets(new SubProgressMonitor(monitor, 1), declaration, status); } } } finally { monitor.done(); } return status; }
private void validateInput() { RefactoringStatus merged= new RefactoringStatus(); merged.merge(getIntroduceIndirectionRefactoring().setIntermediaryClassName(fIntermediaryTypeName.getText())); merged.merge(getIntroduceIndirectionRefactoring().setIntermediaryMethodName(fIntermediaryMethodName.getText())); setPageComplete(!merged.hasError()); int severity= merged.getSeverity(); String message= merged.getMessageMatchingSeverity(severity); if (severity >= RefactoringStatus.INFO) { setMessage(message, severity); } else { setMessage("", NONE); //$NON-NLS-1$ } }
private void validateInput() { RefactoringStatus merged= new RefactoringStatus(); merged.merge(getIntroduceIndirectionRefactoring().setIntermediaryTypeName(fIntermediaryTypeName.getText())); merged.merge(getIntroduceIndirectionRefactoring().setIntermediaryMethodName(fIntermediaryMethodName.getText())); setPageComplete(!merged.hasError()); int severity= merged.getSeverity(); String message= merged.getMessageMatchingSeverity(severity); if (severity >= RefactoringStatus.INFO) { setMessage(message, severity); } else { setMessage("", NONE); //$NON-NLS-1$ } }
private int handleValidateMove(Object target) throws JavaModelException{ if (fMoveProcessor == null) { IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements)); if (policy.canEnable()) fMoveProcessor= new JavaMoveProcessor(policy); } if (!canMoveElements()) return DND.DROP_NONE; if (fMoveProcessor == null) return DND.DROP_NONE; RefactoringStatus moveStatus= fMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(target, getCurrentLocation())); if (moveStatus.hasError()) return DND.DROP_NONE; return DND.DROP_MOVE; }
private int handleValidateMove(Object target) throws JavaModelException{ if (fMoveProcessor == null) { IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements)); if (policy.canEnable()) fMoveProcessor= new JavaMoveProcessor(policy); } if (!canMoveElements()) return DND.DROP_NONE; if (fMoveProcessor == null) return DND.DROP_NONE; RefactoringStatus moveStatus= fMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(target, getCurrentLocation())); if (moveStatus.hasError()) return DND.DROP_NONE; return DND.DROP_MOVE; }
if (result.hasError()) { return result;