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

📄 extractmethodrequest.java

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

import java.util.List;
import java.util.Map;

import org.eclipse.jface.text.ITextSelection;
import org.python.pydev.refactoring.ast.adapters.AbstractScopeNode;
import org.python.pydev.refactoring.ast.adapters.FunctionDefAdapter;
import org.python.pydev.refactoring.ast.adapters.IASTNodeAdapter;
import org.python.pydev.refactoring.ast.adapters.ModuleAdapter;
import org.python.pydev.refactoring.core.request.IRefactoringRequest;

public class ExtractMethodRequest implements IRefactoringRequest {

	private AbstractScopeNode<?> scopeAdapter;

	private int offsetStrategy;

	private String methodName;

	private ModuleAdapter parsedSelection;

	private List<String> parameters;

	private List<String> returnVariables;

	private Map<String, String> renamedVariables;

	private ITextSelection selection;

    private String endLineDelim;

	public ExtractMethodRequest(String methodName, ITextSelection selection, AbstractScopeNode<?> scopeAdapter,
			ModuleAdapter parsedSelection, List<String> callParameters, List<String> returnVariables, Map<String, String> renamedVariables,
			int offsetStrategy, String endLineDelim) {
		this.methodName = methodName;
		this.selection = selection;
		this.scopeAdapter = scopeAdapter;
		this.parsedSelection = parsedSelection;
		this.offsetStrategy = offsetStrategy;

		this.parameters = callParameters;
		this.returnVariables = returnVariables;
		this.renamedVariables = renamedVariables;
        this.endLineDelim = endLineDelim;
	}

	public ITextSelection getSelection() {
		return selection;
	}

	public List<String> getParameters() {
		return parameters;
	}

	public Map<String, String> getRenamedVariables() {
		return renamedVariables;
	}

	public List<String> getReturnVariables() {
		return returnVariables;
	}

	public int getOffsetStrategy() {
		return offsetStrategy;
	}

	public AbstractScopeNode<?> getScopeAdapter() {
		return scopeAdapter;
	}

	public IASTNodeAdapter getOffsetNode() {
		IASTNodeAdapter offsetNode = scopeAdapter;
		while (offsetNode instanceof FunctionDefAdapter)
			offsetNode = offsetNode.getParent();

		return offsetNode;
	}

	public String getMethodName() {
		return methodName;
	}

	public ModuleAdapter getParsedSelection() {
		return parsedSelection;
	}

    public String getNewLineDelim() {
        return endLineDelim;
    }

}

⌨️ 快捷键说明

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