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

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


    }

    public void actionPerformed(AnActionEvent e) {
        getMessagesTree().grabFocus();
        StatementExecutionMessageNode execMessageNode = (StatementExecutionMessageNode) getMessagesTree().getSelectionPath().getLastPathComponent();
        StatementExecutionResult executionResult = execMessageNode.getExecutionMessage().getExecutionResult();
        StatementViewerPopup statementViewer = new StatementViewerPopup(executionResult);
        statementViewer.show((Component) e.getInputEvent().getSource());
    }
View Full Code Here


            ExecutionResultForm resultComponent = executionResult.getResultPanel();
            TabInfo tabInfo = resultTabs.findInfo(resultComponent.getComponent());
            if (resultTabs.getTabs().contains(tabInfo)) {
                resultTabs.removeTab(tabInfo);
                if (executionResult instanceof StatementExecutionResult) {
                    StatementExecutionResult statementExecutionResult = (StatementExecutionResult) executionResult;
                    StatementExecutionInput executionInput = statementExecutionResult.getExecutionInput();
                    if (executionInput != null && !executionInput.isDisposed()) {
                        DBLanguageFile file = executionInput.getExecutablePsiElement().getFile();
                        DocumentUtil.refreshEditorAnnotations(file);
                    }
                }
View Full Code Here

    public StatementExecutionVariablesBundle getExecutionVariables() {
        return executionVariables;
    }

    protected StatementExecutionResult createExecutionResult(Statement statement, StatementExecutionInput executionInput) throws SQLException {
        StatementExecutionResult executionResult = new StatementExecutionBasicResult(getResultName(), executionInput);
        String message = executablePsiElement.getPresentableText() + " executed successfully";
        int updateCount = statement.getUpdateCount();
        if (updateCount > -1) {
            message = message + ": " + updateCount + (updateCount != 1 ? " rows" : " row") + " affected";
        }
        executionResult.updateExecutionMessage(MessageType.INFO, message);
        executionResult.setExecutionStatus(StatementExecutionResult.STATUS_SUCCESS);
        return executionResult;
    }
View Full Code Here

        executionResult.setExecutionStatus(StatementExecutionResult.STATUS_SUCCESS);
        return executionResult;
    }

    public StatementExecutionResult createErrorExecutionResult(StatementExecutionInput executionInput, String cause) {
        StatementExecutionResult executionResult = new StatementExecutionBasicResult(getResultName(), executionInput);
        executionResult.updateExecutionMessage(MessageType.ERROR, "Could not execute " + getStatementName() + ".", cause);
        executionResult.setExecutionStatus(StatementExecutionResult.STATUS_ERROR);
        return executionResult;
    }
View Full Code Here

    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 {
View Full Code Here

        }
    }

    @NotNull
    public Icon getIcon() {
        StatementExecutionResult executionResult = executionProcessor.getExecutionResult();
        if (executionResult == null) {
            return Icons.STMT_EXECUTION_RUN;
        } else {
            if (executionResult.getExecutionStatus() == StatementExecutionResult.STATUS_SUCCESS){
                if (executionProcessor instanceof StatementExecutionCursorProcessor) {
                    return executionResult.getExecutionInput().isObsolete() ?
                            Icons.STMT_EXEC_RESULTSET_RERUN :
                            Icons.STMT_EXEC_RESULTSET;
                } else {
                    return Icons.EXEC_MESSAGES_INFO;
                }
            } else if (executionResult.getExecutionStatus() == StatementExecutionResult.STATUS_ERROR){
                return Icons.STMT_EXECUTION_ERROR_RERUN;
            }
        }

        return Icons.CHECK;
View Full Code Here

    @Nullable
    public String getTooltipText() {
        if (executionProcessor.canExecute()) {
            return "<html>Execute <b>" + executionProcessor.getStatementName() + "</b></html>";
        } else {
            StatementExecutionResult executionResult = executionProcessor.getExecutionResult();
            if (executionResult.getExecutionStatus() == StatementExecutionResult.STATUS_SUCCESS) {
                return "<html>Show execution result <br> <b>" + executionResult.getResultName() + "</b></html>";
            } else if (executionResult.getExecutionStatus() == StatementExecutionResult.STATUS_ERROR) {
                return "<html>Error executing statement <br> <font color='red'>" + executionResult.getExecutionMessage().getCauseMessage() + "</font></html>";
            }

        }
        return null;
    }
View Full Code Here

    }

    public StatementExecutionCursorResult getExecutionResult(AnActionEvent e) {
        Project project = ActionUtil.getProject(e);
        if (project != null) {
            StatementExecutionResult result = e.getData(DBNDataKeys.STATEMENT_EXECUTION_RESULT);
            if (result == null) {
                ExecutionManager executionManager = ExecutionManager.getInstance(project);
                ExecutionResult executionResult = executionManager.getSelectedExecutionResult();
                if (executionResult instanceof StatementExecutionCursorResult) {
                    return (StatementExecutionCursorResult) executionResult;
View Full Code Here

            if (selectionPath != null) {
                if (event.getClickCount() > 1 ) {
                    Object value = selectionPath.getLastPathComponent();
                    if (value instanceof StatementExecutionMessageNode) {
                        StatementExecutionMessageNode execMessageNode = (StatementExecutionMessageNode) value;
                        StatementExecutionResult executionResult = execMessageNode.getExecutionMessage().getExecutionResult();
                        StatementViewerPopup statementViewer = new StatementViewerPopup(executionResult);
                        statementViewer.show(event.getComponent(), event.getPoint());
                        event.consume();
                    }
                } else {
View Full Code Here

TOP

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

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.