Package org.openide.util

Examples of org.openide.util.Cancellable


        public RunningLongTask(LongTask task, Runnable runnable, String taskName) {
            this.task = task;
            this.runnable = runnable;
            ProgressTicketProvider progressProvider = Lookup.getDefault().lookup(ProgressTicketProvider.class);
            if (progressProvider != null) {
                this.progress = progressProvider.createTicket(taskName, new Cancellable() {

                    public boolean cancel() {
                        LongTaskExecutor.this.cancel();
                        return true;
                    }
View Full Code Here


            this.handleRef = new AtomicReference<>(null);
            this.cancelController = cancelController;
        }

        public void start(String displayName) {
            ProgressHandle newHandle = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
                @Override
                public boolean cancel() {
                    cancelController.cancel();
                    return true;
                }
View Full Code Here

        }
    }

    private ProgressHandle createProgress(final CancellationController cancelController) {
        String caption = NbStrings.getDeleteProjectProgress(project.getDisplayName());
        return ProgressHandleFactory.createHandle(caption, new Cancellable() {
            @Override
            public boolean cancel() {
                cancelController.cancel();
                return true;
            }
View Full Code Here

        }

        @Override
        public void actionPerformed(final ActionEvent e) {
            final CancellationSource cancel = Cancellation.createCancellationSource();
            final ProgressHandle progress = ProgressHandleFactory.createHandle(NbStrings.getJumpToSource(), new Cancellable() {
                @Override
                public boolean cancel() {
                    cancel.getController().cancel();
                    return true;
                }
View Full Code Here

        public RunningLongTask(LongTask task, Runnable runnable, String taskName) {
            this.task = task;
            this.runnable = runnable;
            ProgressTicketProvider progressProvider = Lookup.getDefault().lookup(ProgressTicketProvider.class);
            if (progressProvider != null) {
                this.progress = progressProvider.createTicket(taskName, new Cancellable() {
                    @Override
                    public boolean cancel() {
                        LongTaskExecutor.this.cancel();
                        return true;
                    }
View Full Code Here

        // display progress bar
        RequestProcessor.getDefault().post(new Runnable() {
            @Override
            public void run() {
                ProgressHandle handle = ProgressHandleFactory.createHandle("Createing theme", new Cancellable() {
                    @Override
                    public boolean cancel() {
                        return true;
                    }
                });
View Full Code Here

        // display progress bar
        RequestProcessor.getDefault().post(new Runnable() {
            @Override
            public void run() {
                ProgressHandle handle = ProgressHandleFactory.createHandle(Bundle.LBL_CreatingTheme(), new Cancellable() {
                    @Override
                    public boolean cancel() {
                        return true;
                    }
                });
View Full Code Here

                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {
                final Thread currentThread = Thread.currentThread();
                final ProgressHandle progress = ProgressHandleFactory.createHandle(taskName, new Cancellable() {
                public boolean cancel() {
                    currentThread.interrupt();
                    return true;
                }
                });
View Full Code Here

    protected Object doInBackground() throws Exception {
        logger.log(Level.INFO, "Starting background processing for file search by MD5 hash."); //NON-NLS
           
        // Setup progress bar
        final String displayName = NbBundle.getMessage(this.getClass(), "HashDbSearchThread.name.searching");
        progress = ProgressHandleFactory.createHandle(displayName, new Cancellable() {
            @Override
            public boolean cancel() {
                if (progress != null)
                    progress.setDisplayName(
                            NbBundle.getMessage(this.getClass(), "HashDbSearchThread.progress.cancellingSearch",
View Full Code Here

        @Override
        protected Object doInBackground() throws Exception {
            final String displayName = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.doInBackGround.displayName")
                    + (finalRun ? (" - " + NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.doInBackGround.finalizeMsg")) : "");
            final String pgDisplayName = displayName + (" (" + NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.doInBackGround.pendingMsg") + ")");
            progressGroup = AggregateProgressFactory.createSystemHandle(pgDisplayName, null, new Cancellable() {
                @Override
                public boolean cancel() {
                    logger.log(Level.INFO, "Cancelling the searcher by user."); //NON-NLS
                    if (progressGroup != null) {
                        progressGroup.setDisplayName(displayName + " " + NbBundle.getMessage(this.getClass(), "SearchRunner.doInBackGround.cancelMsg"));
View Full Code Here

TOP

Related Classes of org.openide.util.Cancellable

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.