Package com.dci.intellij.dbn.common.thread

Examples of com.dci.intellij.dbn.common.thread.BackgroundTask


        executionInput.setExecutionCancelled(!getStatus().PROCESS_STOPPED_NORMALLY);
        final Project project = getSession().getProject();

        if (getStatus().PROCESS_IS_TERMINATING) return;

        new BackgroundTask(project, "Stopping debugger", true) {
            public void execute(@NotNull ProgressIndicator progressIndicator) {
                progressIndicator.setText("Cancelling / resuming method execution.");
                try {
                    getStatus().PROCESS_IS_TERMINATING = true;
                    unregisterBreakpoints();
View Full Code Here


        int response = Messages.showYesNoDialog(
                "Are you sure you want to drop the " + object.getQualifiedNameWithType() + "?",
                Constants.DBN_TITLE_PREFIX + "Drop object",
                Messages.getQuestionIcon());
        if (response == 0) {
            new BackgroundTask(object.getProject(), "Dropping " + object.getQualifiedNameWithType(), false) {
                public void execute(@NotNull ProgressIndicator progressIndicator) throws InterruptedException {
                    try {
                        initProgressIndicator(progressIndicator, true);
                        ddlInterface.dropObject(object.getTypeName(), object.getQualifiedName(), connectionHandler.getStandaloneConnection());
View Full Code Here

        @Override
        public void actionPerformed(AnActionEvent e) {
            final Project project = ActionUtil.getProject(e);
            if (project != null) {
                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);
                                    }
                                }
                            }
                        }.start();

                    }
                };
                backgroundTask.start();
            }
        }
View Full Code Here

    public void setObject(final DBObject object) {
        if (!object.equals(this.object)) {
            this.object = object;

            new BackgroundTask(object.getProject(), "Rendering object properties", true) {
                @Override
                public void execute(@NotNull ProgressIndicator progressIndicator) {
                    initProgressIndicator(progressIndicator, true);
                    final ObjectPropertiesTableModel tableModel = new ObjectPropertiesTableModel(object.getPresentableProperties());
View Full Code Here

        super("Reload", null, Icons.ACTION_REFRESH);
        this.objectList = objectList;
    }

    public void actionPerformed(AnActionEvent anActionEvent) {
        new BackgroundTask(objectList.getProject(), "Reloading " + objectList.getContentDescription() + ".", false) {
            @Override
            public void execute(@NotNull final ProgressIndicator progressIndicator) throws InterruptedException {
                initProgressIndicator(progressIndicator, true);
                objectList.reload();
            }
View Full Code Here

            RunContentDescriptor contentToReuse,
            final ExecutionEnvironment environment) throws ExecutionException {

        final DBProgramRunConfiguration runProfile = (DBProgramRunConfiguration) environment.getRunProfile();

        new BackgroundTask(runProfile.getProject(), "Checking debug privileges", false, true) {
            public void execute(@NotNull ProgressIndicator progressIndicator) {
                initProgressIndicator(progressIndicator, true);
                performPrivilegeCheck(
                        runProfile.getExecutionInput(),
                        executor,
View Full Code Here

        if (runProfile.isCompileDependencies()) {
            final ConnectionHandler connectionHandler = runProfile.getMethod().getConnectionHandler();
            final Project project = connectionHandler.getProject();


            new BackgroundTask(project, "Initializing debug environment", false, true) {
                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()) {
View Full Code Here

                dependenciesDialog.show();
                final List<DBSchemaObject> selectedDependencies =  dependenciesDialog.getSelection();

                if (dependenciesDialog.getExitCode() == DialogWrapper.OK_EXIT_CODE){
                    if (selectedDependencies.size() > 0) {
                        new BackgroundTask(project, "Compiling dependencies", false, true){
                            @Override
                            public void execute(@NotNull ProgressIndicator progressIndicator) {
                                initProgressIndicator(progressIndicator, true);
                                DatabaseCompilerManager compilerManager = DatabaseCompilerManager.getInstance(project);
                                for (DBSchemaObject schemaObject : selectedDependencies) {
View Full Code Here

        openEditor(object, false);
    }

    public void openEditor(final DBObject object, final boolean scroll) {
        final Project project = object.getProject();
        new BackgroundTask(project, "Opening editor", false, true) {
            @Override
            public void execute(@NotNull ProgressIndicator progressIndicator) {
                initProgressIndicator(progressIndicator, true);
                if (object.getProperties().is(DBObjectProperty.SCHEMA_OBJECT)) {
                    DBObjectListContainer childObjects = object.getChildObjects();
View Full Code Here

    }

    public void actionPerformed(final AnActionEvent e) {
        Project project = ActionUtil.getProject(e);
        if (project != null && !project.isDisposed()) {
            new BackgroundTask(project, "Reverting local changes", false) {
                @Override
                protected void execute(@NotNull ProgressIndicator progressIndicator) throws InterruptedException {
                    final Editor editor = getEditor(e);
                    final SourceCodeFile sourceCodeFile = getSourcecodeFile(e);
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.common.thread.BackgroundTask

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.