Package com.dci.intellij.dbn.object

Examples of com.dci.intellij.dbn.object.DBMethod


    private void registerDefaultBreakpoint() {
        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 {
                        defaultBreakpointInfo = getDebuggerInterface().addBreakpoint(
                                method.getSchema().getName(),
                                schemaObject.getName(),
                                schemaObject.getObjectType().getName().toUpperCase(),
                                line,
                                debugConnection);
                    } catch (SQLException e) {
View Full Code Here


        DBSchemaObject schemaObject = getMainDatabaseObject();
        return schemaObject.getVirtualFile();
    }

    private DBSchemaObject getMainDatabaseObject() {
        DBMethod method = executionInput.getMethod();
        return method.isProgramMethod() ? method.getProgram() : method;
    }
View Full Code Here

            methodArgumentsPanel.add(methodExecutionForm.getComponent(), BorderLayout.CENTER);
            if (touchForm) methodExecutionForm.touch();
            DBMethodRef methodRef = executionInput.getMethodRef();
            methodRef.getPath();
            headerIcon = executionInput.getMethod().getOriginalIcon();
            DBMethod method = methodRef.get();
            if (method != null && getEnvironmentSettings(method.getProject()).getVisibilitySettings().getDialogHeaders().value()) {
                headerBackground = method.getEnvironmentType().getColor();
            }
        }

        DBNHeaderForm headerForm = new DBNHeaderForm(
                headerTitle,
View Full Code Here

                BackgroundTask backgroundTask = new BackgroundTask(project, "Loading executable elements", false) {
                    @Override
                    public void execute(@NotNull ProgressIndicator progressIndicator) {
                        initProgressIndicator(progressIndicator, true);
                        final MethodBrowserSettings settings = MethodExecutionManager.getInstance(project).getBrowserSettings();
                        DBMethod currentMethod = configuration.getExecutionInput() == null ? null : configuration.getExecutionInput().getMethod();
                        if (currentMethod != null) {
                            settings.setConnectionHandler(currentMethod.getConnectionHandler());
                            settings.setSchema(currentMethod.getSchema());
                            settings.setMethod(currentMethod);
                        }

                        final ObjectTreeModel objectTreeModel = new ObjectTreeModel(settings.getSchema(), settings.getVisibleObjectTypes(), settings.getMethod());

                        new SimpleLaterInvocator() {
                            public void execute() {
                                final MethodExecutionBrowserDialog browserDialog = new MethodExecutionBrowserDialog(project, settings, objectTreeModel);
                                browserDialog.show();
                                if (browserDialog.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
                                    DBMethod method = browserDialog.getSelectedMethod();
                                    MethodExecutionManager methodExecutionManager = MethodExecutionManager.getInstance(project);
                                    MethodExecutionInput methodExecutionInput = methodExecutionManager.getExecutionInput(method);
                                    if (methodExecutionInput != null) {
                                        configuration.setExecutionInput(methodExecutionInput);
                                    }
View Full Code Here

        }

        @Override
        public void update(AnActionEvent e) {
            Presentation presentation = e.getPresentation();
            DBMethod method = executionInput.getMethod();
            if (method == null) {
                presentation.setIcon(Icons.DBO_METHOD);
            } else {
                presentation.setIcon(method.getOriginalIcon());
            }
            presentation.setText(NamingUtil.enhanceNameForDisplay(executionInput.getMethodRef().getPath()));
        }
View Full Code Here

    }

    @Override
    public Icon getIcon(@NotNull RunConfiguration configuration) {
        DBProgramRunConfiguration runConfiguration = (DBProgramRunConfiguration) configuration;
        DBMethod method = runConfiguration.getMethod();
        return method == null ? super.getIcon() : method.getIcon();
    }
View Full Code Here

    }

    public int compareTo(@NotNull Object o) {
        if (o instanceof DBArgument) {
            DBArgument argument = (DBArgument) o;
            DBMethod thisMethod = getMethod();
            DBMethod thatMethod = argument.getMethod();
            if (thisMethod.equals(thatMethod)) {
                return getPosition() - argument.getPosition();
            } else {
                return thisMethod.compareTo(thatMethod);
            }
View Full Code Here

    private DBProgramRunConfiguration runConfiguration;

    public CompileDebugDependenciesDialog(DBProgramRunConfiguration runConfiguration, List<DBSchemaObject> compileList) {
        super(runConfiguration.getProject(), "Compile Object Dependencies", true);
        this.runConfiguration = runConfiguration;
        DBMethod method = runConfiguration.getMethod();
        DBProgram program = method.getProgram();
        DBSchemaObject selectedObject = program == null ? method : program;
        this.dependenciesForm = new CompileDebugDependenciesForm(compileList, selectedObject);
        init();
    }
View Full Code Here

                public void execute(@NotNull ProgressIndicator progressIndicator) {
                    DatabaseDebuggerManager debuggerManager = DatabaseDebuggerManager.getInstance(project);
                    initProgressIndicator(progressIndicator, true, "Loading dependencies of " + runProfile.getMethod().getQualifiedNameWithType());
                    if (!project.isDisposed() && !progressIndicator.isCanceled()) {

                        DBMethod method = executionInput.getMethod();
                        List<DBSchemaObject> dependencies = debuggerManager.loadCompileDependencies(method, progressIndicator);
                        if (!progressIndicator.isCanceled()) {
                            if (dependencies.size() > 0) {
                                performCompile(
                                        executionInput,
View Full Code Here

        T method = getMethod();
        return method == null ? new ArrayList<DBArgument>() : method.getArguments();
    }

    public DBArgument getReturnArgument() {
        DBMethod method = getMethod();
        if (method instanceof DBFunction) {
            DBFunction function = (DBFunction) method;
            return function.getReturnArgument();
        }
        return null;
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.object.DBMethod

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.