Package com.dci.intellij.dbn.execution.statement.result

Examples of com.dci.intellij.dbn.execution.statement.result.StatementExecutionCursorResult


    protected StatementExecutionResult createExecutionResult(Statement statement, StatementExecutionInput executionInput) throws SQLException {
        ResultSet resultSet = statement.getResultSet();
        if (resultSet == null) {
            statement.close();

            StatementExecutionResult executionResult = new StatementExecutionCursorResult(getResultName(), executionInput);
            executionResult.updateExecutionMessage(MessageType.INFO, getStatementName() + " executed successfully.");
            return executionResult;
        } else {
            if (executionResult == null) {
                return new StatementExecutionCursorResult(getResultName(), executionInput, resultSet);
            } else {
                // if executionResult exists, just update it with the new resultSet data
                if (executionResult instanceof StatementExecutionCursorResult){
                    StatementExecutionCursorResult executionCursorResult = (StatementExecutionCursorResult) executionResult;
                    executionCursorResult.setExecutionInput(executionInput);
                    executionCursorResult.loadResultSet(resultSet);
                    return executionResult;
                } else {
                    return new StatementExecutionCursorResult(getResultName(), executionInput, resultSet);
                }
            }
        }
    }
View Full Code Here


                executionResult.getExecutionInput().isObsolete() || isDirty();
    }

    public void navigateToResult() {
        if (executionResult instanceof StatementExecutionCursorResult) {
            StatementExecutionCursorResult executionCursorResult = (StatementExecutionCursorResult) executionResult;
            executionCursorResult.navigateToResult();
        }

    }
View Full Code Here

        super("Close", Icons.EXEC_RESULT_CLOSE);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        StatementExecutionCursorResult executionResult = getExecutionResult(e);
        if (executionResult != null && executionResult.getProject() != null) {
            Project project = executionResult.getProject();
            ExecutionManager executionManager = ExecutionManager.getInstance(project);
            executionManager.removeResultTab(executionResult);
        }
    }
View Full Code Here

        super("Fetch next records", Icons.EXEC_RESULT_RESUME);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        StatementExecutionCursorResult executionResult = getExecutionResult(e);
        if (executionResult != null) {
            executionResult.fetchNextRecords();
        }

    }
View Full Code Here

    }

    @Override
    public void update(AnActionEvent e) {
        StatementExecutionCursorResult executionResult = getExecutionResult(e);

        boolean enabled = executionResult != null &&
                executionResult.hasResult() &&
                !executionResult.getResultTable().isLoading() &&
                !executionResult.getTableModel().isResultSetExhausted();

        Presentation presentation = e.getPresentation();
        presentation.setEnabled(enabled);
        presentation.setText("Fetch next records");
    }
View Full Code Here

        super("Find data", Icons.ACTION_FIND);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        StatementExecutionCursorResult executionResult = getExecutionResult(e);
        if (executionResult != null) {
            executionResult.getResultPanel().showSearchHeader();
        }
    }
View Full Code Here

        super("Rerun statement", Icons.EXEC_RESULT_RERUN);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        StatementExecutionCursorResult executionResult = getExecutionResult(e);
        if (executionResult != null) {
            executionResult.reload();
        }
    }
View Full Code Here

        }
    }

    @Override
    public void update(AnActionEvent e) {
        StatementExecutionCursorResult executionResult = getExecutionResult(e);
        Presentation presentation = e.getPresentation();
        presentation.setEnabled(
                executionResult != null &&
                !executionResult.getResultTable().isLoading());
       
        presentation.setText("Rerun statement");
    }
View Full Code Here

        super("Open variables dialog", Icons.EXEC_RESULT_OPEN_EXEC_DIALOG);
    }

    @Override
    public void actionPerformed(AnActionEvent e) {
        final StatementExecutionCursorResult executionResult = getExecutionResult(e);
        if (executionResult != null) {
            boolean continueExecution = executionResult.getExecutionProcessor().promptVariablesDialog();
            if (continueExecution) {
                new BackgroundTask(executionResult.getProject(), "Executing statement", false, true) {
                    protected void execute(@NotNull ProgressIndicator progressIndicator) {
                        initProgressIndicator(progressIndicator, true);
                        StatementExecutionCursorProcessor executionProcessor = executionResult.getExecutionProcessor();
                        executionProcessor.execute(progressIndicator);
                    }
                }.start();
            }
        }
View Full Code Here

    }

    @Override
    public void update(AnActionEvent e) {
        boolean visible = false;
        StatementExecutionCursorResult executionResult = getExecutionResult(e);
        if (executionResult != null) {
            StatementExecutionCursorProcessor executionProcessor = executionResult.getExecutionProcessor();
            if (executionProcessor != null) {
                StatementExecutionVariablesBundle executionVariables = executionProcessor.getExecutionVariables();
                visible = executionVariables != null && executionVariables.getVariables().size() > 0;
            }
        }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.execution.statement.result.StatementExecutionCursorResult

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.