Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubMonitor.newChild()


    SubMonitor subMonitor = null;
    try {
      if (workspaceVersion != getCurrentFormatVersion()) {
        progressMonitor.beginLongOperation();
        subMonitor = SubMonitor.convert(progressMonitor, "Please wait while RSSOwl migrates data to the new version", 100);
        reindexRequired = migrate(workspaceVersion, getCurrentFormatVersion(), subMonitor.newChild(10));
      }

      fObjectContainer = createObjectContainer(config);

      fireDatabaseEvent(new DatabaseEvent(fObjectContainer, fLock), true);
View Full Code Here


       * but we have the check anyway to
       */
      if (subMonitor != null && reindexRequired) {
        IModelSearch modelSearch = InternalOwl.getDefault().getPersistenceService().getModelSearch();
        modelSearch.startup();
        modelSearch.reindexAll(subMonitor.newChild(90));
      }
    } finally {
      /*
       * If we perform the migration, the subMonitor is not null. Otherwise we
       * don't show progress.
View Full Code Here

        progressMonitor.beginLongOperation(false);
        subMonitor = SubMonitor.convert(progressMonitor, Messages.DBManager_RSSOWL_MIGRATION, 100);

        //TODO Have a better way to allocate the ticks to the child. We need
        //to be able to do it dynamically based on whether a reindex is required or not.
        migrationResult = migrate(workspaceVersion, getCurrentFormatVersion(), subMonitor.newChild(70));
      }

      /* Perform Defrag if necessary */
      if (!defragmentIfNecessary(progressMonitor, subMonitor)) {

View Full Code Here

            /* Create Marker that Reindexing is Performed */
            if (!marker.exists())
              safeCreate(marker);

            /* Reindex Search Index */
            modelSearch.reindexAll(subMonitor != null ? subMonitor.newChild(20) : new NullProgressMonitor());
          } finally {
            safeDelete(marker);
          }

          if (progressMonitor.isCanceled())
View Full Code Here

                registerLaunchPropertiesRegenerator(model, launch);
        } catch (Exception e) {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error obtaining OSGi project launcher.", e));
        }

        super.launch(configuration, mode, launch, progress.newChild(1, SubMonitor.SUPPRESS_NONE));
    }

    private void configureLauncher(ILaunchConfiguration configuration) throws CoreException {
        boolean clean = configuration.getAttribute(LaunchConstants.ATTR_CLEAN, LaunchConstants.DEFAULT_CLEAN);
View Full Code Here

        is = replacer.getStream();
      }

      if (dst.exists()) {
        dst.setContents(is, false, true,
            progress.newChild(2, SubMonitor.SUPPRESS_NONE));
      } else {
        FileUtils.recurseCreate(dst.getParent(),
            progress.newChild(1, SubMonitor.SUPPRESS_NONE));
        dst.create(is, false,
            progress.newChild(1, SubMonitor.SUPPRESS_NONE));
View Full Code Here

      if (dst.exists()) {
        dst.setContents(is, false, true,
            progress.newChild(2, SubMonitor.SUPPRESS_NONE));
      } else {
        FileUtils.recurseCreate(dst.getParent(),
            progress.newChild(1, SubMonitor.SUPPRESS_NONE));
        dst.create(is, false,
            progress.newChild(1, SubMonitor.SUPPRESS_NONE));
      }

      if (replacer != null) {
View Full Code Here

            progress.newChild(2, SubMonitor.SUPPRESS_NONE));
      } else {
        FileUtils.recurseCreate(dst.getParent(),
            progress.newChild(1, SubMonitor.SUPPRESS_NONE));
        dst.create(is, false,
            progress.newChild(1, SubMonitor.SUPPRESS_NONE));
      }

      if (replacer != null) {
        try {
          replacer.join();
View Full Code Here

                    if (locations != null && locations.length > 0) {
                        IFile pkgInfoFile = locations[0].getFile(new Path(PACKAGEINFO));

                        try {
                            ByteArrayInputStream input = new ByteArrayInputStream("version 1.0".getBytes("UTF-8"));
                            pkgInfoFile.create(input, false, progress.newChild(1, 0));
                        } catch (CoreException e) {
                            status.add(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error creating file " + pkgInfoFile.getFullPath(), e));
                        } catch (UnsupportedEncodingException e) {
                            /* just ignore, should never happen */
                        }
View Full Code Here

        SubMonitor progress = SubMonitor.convert(monitor);

        switch (operation.getType()) {
        case Import :
            progress.setWorkRemaining(2);
            importCnf(progress.newChild(1, SubMonitor.SUPPRESS_NONE));
            rebuildWorkspace(progress.newChild(1, SubMonitor.SUPPRESS_NONE));
            break;
        case Open :
            progress.setWorkRemaining(2);
            openProject(progress.newChild(1, SubMonitor.SUPPRESS_NONE));
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.