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

📄 pyprojectionannotation.java

📁 Python Development Environment (Python IDE plugin for Eclipse). Features editor, code completion, re
💻 JAVA
字号:
/*
 * Created on Jul 19, 2004
 *
 * @author Fabio Zadrozny
 */
package org.python.pydev.editor.codefolding;

import org.eclipse.jface.text.source.projection.ProjectionAnnotation;
import org.python.pydev.parser.visitors.scope.ASTEntry;

/**
 * This class was created so that we can check if some annotation reappears
 * (if this happens, we don't want to delete it).
 * 
 * @author Fabio Zadrozny
 */
public class PyProjectionAnnotation extends ProjectionAnnotation{

    public ASTEntry node;

    public PyProjectionAnnotation(ASTEntry node){
        this.node = node;
    }

    /**
     * @param node2
     * @param model 
     * @return
     */
    public boolean appearsSame(ASTEntry node2) {
        
        if(node2.getClass().equals(node.getClass()) == false)
            return false;

        if(getCompleteName(node2).equals(getCompleteName(node)) == false)
            return false;
        
        return true;
    }

    /**
     * @param node2
     */
    private String getCompleteName(ASTEntry node2) {
        
        String ret = node2.getName();
        
        while(node2.parent != null){
            ret = node2.parent.getName() + "."+ ret;
            node2 = node2.parent;
        }
        
        return ret;
    }

}

⌨️ 快捷键说明

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