Package de.fu_berlin.inf.dpp.util

Examples of de.fu_berlin.inf.dpp.util.BlockingProgressMonitor


     * be <code>null</code> to set <em>no</em> encoding on project level.
     */
    protected void setEncoding(IProject project, @Nullable String encoding) {
        if (!project.exists())
            return;
        BlockingProgressMonitor monitor = new BlockingProgressMonitor();
        try {
            project.setDefaultCharset(encoding, monitor);
            monitor.await();
        } catch (CoreException e) {
            log.error("Could not set encoding on project.", e);
        } catch (InterruptedException e) {
            log.error("Code not designed to be interruptible", e);
            Thread.currentThread().interrupt();
View Full Code Here


        }

        if (editor == null)
            return true;

        final BlockingProgressMonitor monitor = new BlockingProgressMonitor();

        // save document
        Utils.runSafeSWTSync(log, new Runnable() {
            public void run() {
                editor.doSave(monitor);
            }
        });

        // Wait for saving or canceling to be done
        try {
            monitor.await();
        } catch (InterruptedException e) {
            log.warn("Code not designed to handle InterruptedException");
            Thread.currentThread().interrupt();
        }

        return !monitor.isCanceled();
    }
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.util.BlockingProgressMonitor

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.