Package com.dci.intellij.dbn.vfs

Examples of com.dci.intellij.dbn.vfs.DatabaseEditableObjectFile


    /**
     * @deprecated
     */
    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);
View Full Code Here


            }
        }.start();
    }

    public BasePsiElement getObjectNavigationElement(DBSchemaObject parentObject, DBContentType contentType, DBObjectType objectType, CharSequence objectName) {
        DatabaseEditableObjectFile databaseFile = parentObject.getVirtualFile();
        PsiManager psiManager = PsiManager.getInstance(parentObject.getProject());
        DatabaseContentFile contentFile = databaseFile.getContentFile(contentType);
        if (contentFile != null) {
            PSQLFile file = (PSQLFile) psiManager.findFile(contentFile);
            if (file != null) {
                return
                    contentType == DBContentType.CODE_BODY ? file.lookupObjectDeclaration(objectType, objectName) :
View Full Code Here

        }
        return null;
    }

    public void navigateToObject(DBSchemaObject parentObject, BasePsiElement basePsiElement) {
        DatabaseEditableObjectFile databaseFile = parentObject.getVirtualFile();
        FileEditor fileEditor = EditorUtil.getFileEditor(databaseFile, basePsiElement.getFile().getVirtualFile());
        EditorUtil.selectEditor(databaseFile, fileEditor);
        basePsiElement.navigate(true);
    }
View Full Code Here

* This way the breakpoints get updated as soon as the file is opened.
*/
public class BreakpointUpdaterFileEditorListener implements FileEditorManagerListener{
    public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
        if (file instanceof DatabaseEditableObjectFile) {
            DatabaseEditableObjectFile databaseFile = (DatabaseEditableObjectFile) file;
            XBreakpointManagerImpl breakpointManager = (XBreakpointManagerImpl) XDebuggerManager.getInstance(source.getProject()).getBreakpointManager();
            for (XBreakpoint breakpoint : breakpointManager.getAllBreakpoints()) {
                if (breakpoint instanceof XLineBreakpoint) {
                    XLineBreakpoint lineBreakpoint = (XLineBreakpoint) breakpoint;
                    lineBreakpoint.putUserData(DBProgramBreakpointHandler.BREAKPOINT_ID_KEY, null);
                    DatabaseEditableObjectFile breakpointDatabaseFile = DBProgramBreakpointHandler.getDatabaseFile(lineBreakpoint);
                    if (databaseFile == breakpointDatabaseFile) {
                        breakpointManager.getLineBreakpointManager().registerBreakpoint((XLineBreakpointImpl) lineBreakpoint, true);
                    }
                }
            }
View Full Code Here

            try {
                backtraceInfo = getDebuggerInterface().getExecutionBacktraceInfo(debugConnection);
            } catch (SQLException e) {
                showErrorDialog(e);
            }
            DatabaseEditableObjectFile databaseFile = getDatabaseFile(runtimeInfo);
            DBProgramDebugSuspendContext suspendContext = new DBProgramDebugSuspendContext(this);
            getSession().positionReached(suspendContext);
            navigateInEditor(databaseFile, runtimeInfo.getLineNumber());
        }
    }
View Full Code Here

    public static @Nullable DBSchemaObject getObject(@Nullable XSourcePosition sourcePosition) {
        if (sourcePosition != null) {
            VirtualFile virtualFile = sourcePosition.getFile();
            if (virtualFile instanceof DatabaseEditableObjectFile) {
                DatabaseEditableObjectFile databaseFile = (DatabaseEditableObjectFile) virtualFile;
                return databaseFile.getObject();
            }

            if (virtualFile instanceof SourceCodeFile) {
                SourceCodeFile sourceCodeFile = (SourceCodeFile) virtualFile;
                return sourceCodeFile.getDatabaseFile().getObject();
View Full Code Here

    public static SourceCodeFile getSourceCodeFile(XSourcePosition sourcePosition) {
        if (sourcePosition != null) {
            VirtualFile virtualFile = sourcePosition.getFile();
            if (virtualFile instanceof DatabaseEditableObjectFile) {
                DatabaseEditableObjectFile databaseFile = (DatabaseEditableObjectFile) virtualFile;
                return (SourceCodeFile) databaseFile.getMainContentFile();
            }

            if (virtualFile instanceof SourceCodeFile) {
                return (SourceCodeFile) virtualFile;
            }
View Full Code Here

    @Override
    public void registerBreakpoint(@NotNull XLineBreakpoint<DBProgramBreakpointProperties> breakpoint) {
        if (!debugProcess.getStatus().CAN_SET_BREAKPOINTS) return;

        ConnectionHandler connectionHandler = debugProcess.getConnectionHandler();
        DatabaseEditableObjectFile databaseFile = getDatabaseFile(breakpoint);
        if (databaseFile == null) {
            XDebuggerManager.getInstance(session.getProject()).getBreakpointManager().removeBreakpoint(breakpoint);
        } else {
            DBSchemaObject object = databaseFile.getObject();
            if (object.getConnectionHandler() == connectionHandler) {
                DatabaseDebuggerInterface debuggerInterface = connectionHandler.getInterfaceProvider().getDebuggerInterface();

                Connection debugConnection = debugProcess.getDebugConnection();
                try {
View Full Code Here

    @Override
    public void unregisterBreakpoint(@NotNull XLineBreakpoint<DBProgramBreakpointProperties> breakpoint, boolean temporary) {
        if (!debugProcess.getStatus().CAN_SET_BREAKPOINTS) return;
       
        DatabaseEditableObjectFile databaseFile = getDatabaseFile(breakpoint);
        DBSchemaObject object = databaseFile.getObject();
        if (object.getConnectionHandler() == debugProcess.getConnectionHandler()) {
            DatabaseDebuggerInterface debuggerInterface = object.getConnectionHandler().getInterfaceProvider().getDebuggerInterface();
            Integer breakpointId = breakpoint.getUserData(BREAKPOINT_ID_KEY);

            if (breakpointId != null) {
View Full Code Here

        XBreakpoint<?>[] breakpoints = breakpointManager.getAllBreakpoints();

        for (XBreakpoint breakpoint : breakpoints) {
            if (breakpoint.getType() instanceof DBProgramBreakpointType) {
                XLineBreakpoint lineBreakpoint = (XLineBreakpoint) breakpoint;
                DatabaseEditableObjectFile databaseFile = getDatabaseFile(lineBreakpoint);
                if (databaseFile != null && databaseFile.getConnectionHandler() == debugProcess.getConnectionHandler()) {
                    lineBreakpoint.putUserData(BREAKPOINT_ID_KEY, null);
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.vfs.DatabaseEditableObjectFile

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.