Package org.eclipse.jface.operation

Examples of org.eclipse.jface.operation.IRunnableWithProgress


      final List<IProject> selectedProjects = wizard.getSelectedProjects();
      if (selectedProjects == null || selectedProjects.size()==0) {
        // no project was selected
        return;
      }
      IRunnableWithProgress r = new IRunnableWithProgress() {
       
        @Override
        public void run(IProgressMonitor monitor) throws InvocationTargetException,
            InterruptedException {
          try {
View Full Code Here


                    deployProjectsOnServer(projects[0], monitor);
                }
            });

            // ensure server is started and all modules are published
            getContainer().run(false, false, new IRunnableWithProgress() {

                @Override
                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    try {
                        publishModules(createdProjects, monitor);
View Full Code Here

        IResource resource = mainPage.getResource();
        final IProject project = resource.getProject();
        final IPath projectRelativePath = resource.getProjectRelativePath();

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

                @Override
                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    // wrap the import action in a IWorkspaceRunnable to make sure that changes are only
                    // published once at the end. This is especially important since the import action
View Full Code Here

            });
            if (dialog.open() == ContainerSelectionDialog.OK) {
                Object[] result = dialog.getResult();
                if (result != null && result.length > 0) {
                    final IContainer container = (IContainer) result[0];
                    IRunnableWithProgress r = new IRunnableWithProgress() {

                        @Override
                        public void run(IProgressMonitor monitor)
                                throws InvocationTargetException,
                                InterruptedException {
View Full Code Here

            public void linkActivated(HyperlinkEvent e) {

                ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
                dialog.setCancelable(true);
                try {
                    dialog.run(true, false, new IRunnableWithProgress() {

                        @Override
                        public void run(IProgressMonitor monitor) throws InvocationTargetException,
                                InterruptedException {
                            final Version remoteVersion;
View Full Code Here

        final Location location = ((Location) model);
        final String uri = location.getUri();
        TargetPlatformActivator _instance = TargetPlatformActivator.getInstance();
        IWorkbench _workbench = _instance.getWorkbench();
        final IWorkbenchWindow window = _workbench.getActiveWorkbenchWindow();
        final IRunnableWithProgress _function = new IRunnableWithProgress() {
          public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            Shell _shell = window.getShell();
            Display _display = _shell.getDisplay();
            ReadAndDispatchProgressMonitorWrapper _readAndDispatchProgressMonitorWrapper = new ReadAndDispatchProgressMonitorWrapper(monitor, _display);
            final SubMonitor wpm = SubMonitor.convert(_readAndDispatchProgressMonitorWrapper, ("Creating content assist for " + uri), 100);
            try {
              Object _service = TargetPlatformProposalProvider.this.provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
              final IMetadataRepositoryManager repositoryManager = ((IMetadataRepositoryManager) _service);
              URI _uRI = new URI(uri);
              SubMonitor _newChild = wpm.newChild(90);
              final IMetadataRepository metadataRepository = repositoryManager.loadRepository(_uRI, _newChild);
              IQuery<IInstallableUnit> _iUAssistQuery = TargetPlatformProposalProvider.this.getIUAssistQuery();
              SubMonitor _newChild_1 = wpm.newChild(5);
              IQueryResult<IInstallableUnit> _query = metadataRepository.query(_iUAssistQuery, _newChild_1);
              final Set<IInstallableUnit> results = _query.toUnmodifiableSet();
              final Function1<IInstallableUnit, Boolean> _function = new Function1<IInstallableUnit, Boolean>() {
                public Boolean apply(final IInstallableUnit it) {
                  EList<IU> _ius = location.getIus();
                  final Function1<IU, String> _function = new Function1<IU, String>() {
                    public String apply(final IU it) {
                      return it.getID();
                    }
                  };
                  List<String> _map = ListExtensions.<IU, String>map(_ius, _function);
                  String _id = it.getId();
                  boolean _contains = _map.contains(_id);
                  return Boolean.valueOf((!_contains));
                }
              };
              Iterable<IInstallableUnit> _filter = IterableExtensions.<IInstallableUnit>filter(results, _function);
              final Procedure1<IInstallableUnit> _function_1 = new Procedure1<IInstallableUnit>() {
                public void apply(final IInstallableUnit it) {
                  String _id = it.getId();
                  IQuery<IInstallableUnit> _createIUQuery = QueryUtil.createIUQuery(_id);
                  SubMonitor _newChild = wpm.newChild(5);
                  final IQueryResult<IInstallableUnit> allVersions = metadataRepository.query(_createIUQuery, _newChild);
                  String _id_1 = it.getId();
                  Iterator<IInstallableUnit> _iterator = allVersions.iterator();
                  final Function1<IInstallableUnit, String> _function = new Function1<IInstallableUnit, String>() {
                    public String apply(final IInstallableUnit it) {
                      Version _version = it.getVersion();
                      return _version.toString();
                    }
                  };
                  Iterator<String> _map = IteratorExtensions.<IInstallableUnit, String>map(_iterator, _function);
                  String _join = IteratorExtensions.join(_map, ", ");
                  ICompletionProposal _createCompletionProposal = TargetPlatformProposalProvider.this.createCompletionProposal(_id_1, _join, TargetPlatformProposalProvider.IU, 0, context);
                  acceptor.accept(_createCompletionProposal);
                }
              };
              IterableExtensions.<IInstallableUnit>forEach(_filter, _function_1);
            } catch (final Throwable _t) {
              if (_t instanceof Exception) {
                final Exception e = (Exception)_t;
              } else {
                throw Exceptions.sneakyThrow(_t);
              }
            }
          }
        };
        final IRunnableWithProgress op = _function;
        window.run(false, true, op);
      }
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
View Full Code Here

        TargetPlatformActivator _instance = TargetPlatformActivator.getInstance();
        IWorkbench _workbench = _instance.getWorkbench();
        final IWorkbenchWindow window = _workbench.getActiveWorkbenchWindow();
        Shell _shell = window.getShell();
        Display _display = _shell.getDisplay();
        final IRunnableWithProgress op = this.versionProposalRunnable(uri, iu, prefix, _display, context, acceptor);
        window.run(false, true, op);
      }
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
View Full Code Here

 
  public void complete_STRING(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
  }
 
  private IRunnableWithProgress versionProposalRunnable(final String uri, final IU iu, final String prefix, final Display display, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    final IRunnableWithProgress _function = new IRunnableWithProgress() {
      public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        try {
          ReadAndDispatchProgressMonitorWrapper _readAndDispatchProgressMonitorWrapper = new ReadAndDispatchProgressMonitorWrapper(monitor, display);
          final SubMonitor wpm = SubMonitor.convert(_readAndDispatchProgressMonitorWrapper, ("Creating content assist for " + uri), 100);
          try {
View Full Code Here

    @Override
    public boolean performFinish() {
        final IPath containerFullPath = fPage.getContainerFullPath();
        final String fileName = fPage.getFileName();
        final IRunnableWithProgress op = new IRunnableWithProgress() {

            @Override
            public void run(final IProgressMonitor monitor)
                    throws InvocationTargetException {
                try {
View Full Code Here

        if (referencedProjects != null) {
            description.setReferencedProjects(referencedProjects);
        }

        // create the new project operation
        final IRunnableWithProgress op = new IRunnableWithProgress() {
            @Override
            public void run(final IProgressMonitor monitor)
                    throws InvocationTargetException {

                final CreateProjectOperation op1 = new CreateProjectOperation(
View Full Code Here

TOP

Related Classes of org.eclipse.jface.operation.IRunnableWithProgress

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.