⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 abstractpythonrefactoring.java

📁 Python Development Environment (Python IDE plugin for Eclipse). Features editor, code completion, re
💻 JAVA
字号:
package org.python.pydev.refactoring.core;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.NullChange;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.python.pydev.refactoring.core.change.CompositeChangeProcessor;
import org.python.pydev.refactoring.core.change.IChangeProcessor;
import org.python.pydev.refactoring.ui.UITexts;

public abstract class AbstractPythonRefactoring extends Refactoring {

	protected RefactoringStatus status;

	protected String name;

	protected Collection<IWizardPage> pages;

	protected RefactoringInfo req;

	public AbstractPythonRefactoring(String name, RefactoringInfo req) {
		status = new RefactoringStatus();
		pages = new ArrayList<IWizardPage>();
		this.req = req;
		this.name = name;
	}

	@Override
	public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
		return status;
	}

	@Override
	public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
		return status;
	}

	@Override
	public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
		IChangeProcessor changeProcessor = new CompositeChangeProcessor(name, getChangeProcessors());
		if (changeProcessor == null) {
			status.addFatalError(UITexts.errorUnexpected);
			return new NullChange();
		}
		return changeProcessor.createChange();
	}

	protected abstract List<IChangeProcessor> getChangeProcessors();

	@Override
	public String getName() {
		return name;
	}

	public Collection<IWizardPage> getPages() {
		return pages;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -