Examples of IRunnableWithProgress


Examples of org.eclipse.jface.operation.IRunnableWithProgress

        boolean result = super.performFinish();
        if (result) {
            final IJavaProject javaProj = (IJavaProject) getCreatedElement();
            try {
                // Run using the progress bar from the wizard dialog
                getContainer().run(false, false, new IRunnableWithProgress() {
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        try {
                            SubMonitor progress = SubMonitor.convert(monitor, 3);

                            // Generate the Bnd model
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

                return Collections.emptyList();

            try {
                final List<IContentProposal> result = new ArrayList<IContentProposal>();

                final IRunnableWithProgress runnable = new IRunnableWithProgress() {
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        try {
                            IType activatorType = javaProject.findType(BundleActivator.class.getName());
                            if (activatorType != null) {
                                ITypeHierarchy hierarchy = activatorType.newTypeHierarchy(javaProject, monitor);
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

    @Override
    public boolean performFinish() {

        try {
            getContainer().run(true, false, new IRunnableWithProgress() {

                @Override
                public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    final ResourceChangeCommandFactory factory = new ResourceChangeCommandFactory(Activator
                            .getDefault().getSerializationManager());
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

                result.add(new PkgPatternProposal(pkg, false, replaceFromPos));
                result.add(new PkgPatternProposal(pkg, true, replaceFromPos));
            }
        };
        IRunnableWithProgress runnable = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    new SearchEngine().search(pattern, new SearchParticipant[] {
                        SearchEngine.getDefaultSearchParticipant()
                    }, scope, requestor, monitor);
                } catch (CoreException e) {
                    throw new InvocationTargetException(e);
                }
            }
        };

        try {
            IRunnableContext runContext = searchContext.getRunContext();
            if (runContext != null) {
                runContext.run(false, false, runnable);
            } else {
                runnable.run(new NullProgressMonitor());
            }
            return result;
        } catch (InvocationTargetException e) {
            logger.logError("Error searching for packages.", e);
            return Collections.emptyList();
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

public class EditorUtils {
    public static boolean saveEditorIfDirty(final IEditorPart editor, String dialogTitle, String message) {
        if (editor.isDirty()) {
            if (MessageDialog.openConfirm(editor.getEditorSite().getShell(), dialogTitle, message)) {
                IRunnableWithProgress saveRunnable = new IRunnableWithProgress() {
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        editor.doSave(monitor);
                    }
                };
                IWorkbenchWindow window = editor.getSite().getWorkbenchWindow();
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

            return;

        if (editor.isDirty()) {
            if (MessageDialog.openConfirm(parentShell, "Export", "The editor content must be saved before exporting. Save now?")) {
                try {
                    editor.getSite().getWorkbenchWindow().run(false, false, new IRunnableWithProgress() {
                        public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                            editor.doSave(monitor);
                        }
                    });
                } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

                if (!status.isOK())
                    throw new CoreException(status);
            }
        };
        IRunnableWithProgress uiOperation = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    ResourcesPlugin.getWorkspace().run(wsOperation, monitor);
                } catch (CoreException e) {
                    throw new InvocationTargetException(e);
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

                return Collections.emptyList();

            try {
                final List<IContentProposal> result = new ArrayList<IContentProposal>();

                final IRunnableWithProgress runnable = new IRunnableWithProgress() {
                    @Override
                    public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                        try {
                            IType activatorType = javaProject.findType(BundleActivator.class.getName());
                            if (activatorType != null) {
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

     * the UI thread.
     *
     * @return the runnable to create the new type
     */
    public IRunnableWithProgress getRunnable() {
        return new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                try {
                    IProgressMonitor monitorInternal = monitor;
                    if (monitorInternal == null) {
                        monitorInternal = new NullProgressMonitor();
View Full Code Here

Examples of org.eclipse.jface.operation.IRunnableWithProgress

            indirectResources.removeAll(result);
        } else {
            indirectResources = Collections.<ResourceDescriptor> emptySet();
        }
        final MultiStatus status = new MultiStatus(Plugin.PLUGIN_ID, 0, "Errors occurred while processing JPM4J dependencies.", null);
        IRunnableWithProgress runnable = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                SubMonitor progress = SubMonitor.convert(monitor, result.size() + indirectResources.size());
                progress.setTaskName("Processing dependencies...");

                // Process all resources (including non-selected ones) into the repository
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.