use of org.eclipse.jdt.internal.corext.refactoring.reorg.IConfirmQuery in project eclipse.jdt.ls by eclipse.
the class OverwriteHelper method confirmOverwritting.
private void confirmOverwritting(IReorgQueries reorgQueries) {
IConfirmQuery overwriteQuery = reorgQueries.createYesYesToAllNoNoToAllQuery(RefactoringCoreMessages.OverwriteHelper_0, true, IReorgQueries.CONFIRM_OVERWRITING);
IConfirmQuery skipQuery = reorgQueries.createSkipQuery(RefactoringCoreMessages.OverwriteHelper_2, IReorgQueries.CONFIRM_SKIPPING);
confirmFileOverwritting(overwriteQuery, skipQuery);
confirmFolderOverwritting(skipQuery);
confirmCuOverwritting(overwriteQuery);
confirmPackageFragmentRootOverwritting(skipQuery, overwriteQuery);
confirmPackageOverwritting(overwriteQuery);
}
use of org.eclipse.jdt.internal.corext.refactoring.reorg.IConfirmQuery in project eclipse.jdt.ls by eclipse.
the class MoveHandler method move.
public static WorkspaceEdit move(IResource[] resources, IJavaElement[] javaElements, IReorgDestination destination, boolean updateReferences, IProgressMonitor monitor) throws CoreException {
IMovePolicy policy = ReorgPolicyFactory.createMovePolicy(resources, javaElements);
if (policy.canEnable()) {
JavaMoveProcessor processor = new JavaMoveProcessor(policy);
Refactoring refactoring = new MoveRefactoring(processor);
processor.setDestination(destination);
processor.setUpdateReferences(updateReferences);
processor.setReorgQueries(new IReorgQueries() {
@Override
public IConfirmQuery createSkipQuery(String queryTitle, int queryID) {
return yesQuery;
}
@Override
public IConfirmQuery createYesNoQuery(String queryTitle, boolean allowCancel, int queryID) {
return yesQuery;
}
@Override
public IConfirmQuery createYesYesToAllNoNoToAllQuery(String queryTitle, boolean allowCancel, int queryID) {
return yesQuery;
}
private final IConfirmQuery yesQuery = new IConfirmQuery() {
@Override
public boolean confirm(String question) throws OperationCanceledException {
return true;
}
@Override
public boolean confirm(String question, Object[] elements) throws OperationCanceledException {
return true;
}
};
});
CheckConditionsOperation check = new CheckConditionsOperation(refactoring, CheckConditionsOperation.ALL_CONDITIONS);
final CreateChangeOperation create = new CreateChangeOperation(check, RefactoringStatus.FATAL);
create.run(monitor);
Change change = create.getChange();
return ChangeUtil.convertToWorkspaceEdit(change);
}
return null;
}
Aggregations