Package com.dci.intellij.dbn.language.common.psi

Examples of com.dci.intellij.dbn.language.common.psi.BasePsiElement


    public void navigateToSpecification(DBSchemaObject parentObject, DBObjectType objectType, String objectName) {
        DatabaseEditableObjectFile databaseFile = parentObject.getVirtualFile();
        PsiManager psiManager = PsiManager.getInstance(parentObject.getProject());
        PSQLFile file = (PSQLFile) psiManager.findFile(databaseFile.getContentFile(DBContentType.CODE_SPEC));
        if (file != null) {
            BasePsiElement basePsiElement = file.lookupObjectSpecification(objectType, objectName);
            if (basePsiElement != null) {
                BasicTextEditor textEditor = EditorUtil.getFileEditor(databaseFile, file.getVirtualFile());
                EditorUtil.selectEditor(databaseFile, textEditor);
                basePsiElement.navigate(true);
            }
        }
    }
View Full Code Here


    public void navigateToDeclaration(DBSchemaObject parentObject, DBObjectType objectType, String objectName) {
        DatabaseEditableObjectFile databaseFile = parentObject.getVirtualFile();
        PsiManager psiManager = PsiManager.getInstance(parentObject.getProject());
        PSQLFile file = (PSQLFile) psiManager.findFile(databaseFile.getContentFile(DBContentType.CODE_BODY));
        if (file != null) {
            BasePsiElement basePsiElement = file.lookupObjectDeclaration(objectType, objectName);
            if (basePsiElement != null) {
                BasicTextEditor textEditor = EditorUtil.getFileEditor(databaseFile, file.getVirtualFile());
                EditorUtil.selectEditor(databaseFile, textEditor);
                basePsiElement.navigate(true);
            }
        }
    }
View Full Code Here

        relevantPsiElement = psiElement;
        this.objectType = objectType;

        if (psiElement.getElementType().isVirtualObjectInsideLookup()) {
            PsiLookupAdapter lookupAdapter = new AliasDefinitionLookupAdapter(null, objectType);
            BasePsiElement relevantPsiElement = lookupAdapter.findInElement(psiElement);

            if (relevantPsiElement == null) {
                lookupAdapter = new SimpleObjectLookupAdapter(null, objectType);
                relevantPsiElement = lookupAdapter.findInElement(psiElement);
            }

            if (relevantPsiElement != null) {
                this.relevantPsiElement = relevantPsiElement;
                this.name = relevantPsiElement.getText();
            }
        }
        objectRef = new DBObjectRef(this);
    }
View Full Code Here

        SourceCodeFile sourceCodeFile = (SourceCodeFile) getMainDatabaseFile().getMainContentFile();
        PSQLFile psqlFile = (PSQLFile) sourceCodeFile.getPsiFile();
        if (psqlFile != null) {
            DBMethod method = executionInput.getMethod();
            if (method != null) {
                BasePsiElement basePsiElement = psqlFile.lookupObjectDeclaration(method.getObjectType().getGenericType(), method.getName());
                if (basePsiElement != null) {
                    BasePsiElement subject = basePsiElement.lookupFirstPsiElement(ElementTypeAttribute.SUBJECT);
                    int offset = subject.getTextOffset();
                    Document document = DocumentUtil.getDocument(psqlFile);
                    int line = document.getLineNumber(offset);

                    DBSchemaObject schemaObject = getMainDatabaseObject();
                    try {
View Full Code Here

                    PsiElement element = psiFile.findElementAt(lineOffset);
                    while (element != null && !(element instanceof BasePsiElement)) {
                        element = element.getNextSibling();
                    }
                    if (element != null) {
                        BasePsiElement basePsiElement = (BasePsiElement) element;
                        int elementLine = document.getLineNumber(basePsiElement.getTextOffset());
                        return elementLine == line;
                    }

                    /*if (element != null) {
                        BasePsiElement basePsiElement = (BasePsiElement) element;
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.language.common.psi.BasePsiElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.