Package com.dubture.composer.ui.job

Examples of com.dubture.composer.ui.job.CreateProjectJob$DummyResource


    // let the create-project command handle folder creation
    if (firstPage.isInLocalServer()) {
      location = location.removeLastSegments(1);
    }
   
    CreateProjectJob projectJob = new CreateProjectJob(location, firstPage.nameGroup.getName(), filterItem.getPackage().getName(), filterItem.getSelectedVersion());
    projectJob.setJobListener(new JobListener() {
      @Override
      public void jobStarted() {
        latch.countDown();
      }

      @Override
      public void jobFinished(String projectName) {
        latch.countDown();
        refreshProject(projectName);
      }

      @Override
      public void jobFailed() {
        latch.countDown();
      }
    });
   
    projectJob.schedule();
   
    // we need to wait until the first page has started the
    // create-project composer command and the command actually
    // wrote something to disk, otherwise the command will fail
    //
View Full Code Here


    if (symfonyPage.isInLocalServer()) {
      path = symfonyPage.getPath().removeLastSegments(1);
    } else {
      path = Platform.getLocation();
    }
    CreateProjectJob projectJob = new CreateProjectJob(path, firstPage.nameGroup.getName(), SymfonyCoreConstants.SYMFONY_STANDARD_EDITION, symfonyPage.getSymfonyVersion());
    projectJob.setJobListener(new JobListener() {
      @Override
      public void jobStarted() {
        latch.countDown();
      }

      @Override
      public void jobFinished(final String projectName) {
        latch.countDown();
      }

      @Override
      public void jobFailed() {
        latch.countDown();
      }
    });

    projectJob.addJobChangeListener(new JobChangeAdapter() {

      @Override
      public void done(IJobChangeEvent event) {

        if (event.getResult() == null || event.getResult().getCode() == Status.ERROR) {
          Logger.log(Logger.ERROR, "Could not run composer create-project");
          return;
        }

        if (getProject() == null || getProject().getName() == null) {
          Logger.log(Logger.ERROR, "Unable to initialize symfony project, cannot retrieve project");
          return;
        }

        IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(getProject().getName());
        if (project == null) {
          Logger.log(Logger.WARNING, "Unable to retrieve project for running the console after project initialization");
          return;
        }

        refreshProject(getProject().getName());
        NopJob job = new NopJob();
        job.setProject(project);
        job.addJobChangeListener(new JobChangeAdapter() {
          @Override
          public void done(IJobChangeEvent event) {
            //now that the container has been dumped...
            IProject project = getProject();
            if (project == null) {
              Logger.log(Logger.WARNING, "Could not retrieve project for saving the debug container");
              return;
            }

            IFile dumpedContainer = project.getFile(SymfonyCoreConstants.DEFAULT_CONTAINER);

            if (dumpedContainer == null || dumpedContainer.exists() == false) {
              Logger.log(Logger.WARNING, "Could not retrieve project for saving the debug container");
              return;
            }

            try {
              Logger.debugMSG("Setting dumped service container");
              IEclipsePreferences node = new ProjectScope(project).getNode(SymfonyCorePlugin.ID);
              node.put(Keys.DUMPED_CONTAINER, dumpedContainer.getFullPath().removeFirstSegments(1).toOSString());
              node.flush();
            } catch (BackingStoreException e) {
              Logger.logException(e);
            }
          }
        });

        job.schedule();
      }
    });

    projectJob.schedule();

    try {
      latch.await();
    } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of com.dubture.composer.ui.job.CreateProjectJob$DummyResource

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.