Package org.springframework.ide.eclipse.roo.core.model

Examples of org.springframework.ide.eclipse.roo.core.model.RooInstallManager


      }
      return "org.springframework.roo.bundle.development";
    }
   
    public IRooInstall getRooInstall() throws IOException {
      RooInstallManager installManager = RooCoreActivator.getDefault().getInstallManager();
      String path = location.getCanonicalPath();
      for (IRooInstall existingInstall : installManager.getAllInstalls()) {
        if (new File(existingInstall.getHome()).getCanonicalPath().equals(path)) {
          return existingInstall;
        }
      }
      return null;
View Full Code Here


      return null;
    }

    @Override
    public IStatus configure(IProgressMonitor monitor) {
      RooInstallManager installManager = RooCoreActivator.getDefault().getInstallManager();
      try {
        String path = location.getCanonicalPath();
       
        // Check existing installs if path is already configured
        if (getRooInstall() != null) {           
          return new Status(IStatus.INFO, RooCoreActivator.PLUGIN_ID, NLS.bind("Roo runtime already configured at {0}", path));
        }

        // Save the old install path for later
        oldDefaultPath = (installManager.getDefaultRooInstall() != null ? installManager.getDefaultRooInstall()
            .getHome() : null);

        /*
         * Generate the name for new install
         * spring-roo-1.0.2.RELEASE -> Roo 1.0.2.RELEASE
         * roo-1.0.2.RELASE -> Roo 1.0.2.RELEASE
         * spring-roo-1.0.2.BUILD-201005061233 -> Roo 1.0.2.BUILD-201005061233
         * roo-1.0.2.BUILD-201005061233 -> Roo 1.0.2.BUILD-201005061233
         */
        String name = getName(location.getName());

        // Create a new install and make it default
        IRooInstall newInstall = new DefaultRooInstall(path, name, true);

        // Set installs
        Set<IRooInstall> installs = new HashSet<IRooInstall>();
        installs.add(newInstall);
        for (IRooInstall install : installManager.getAllInstalls()) {
          installs.add(new DefaultRooInstall(install.getHome(), install.getName(), false));
        }
        installManager.setRooInstalls(installs);
       
        setConfigured(true);
        return new Status(IStatus.OK, RooCoreActivator.PLUGIN_ID, NLS.bind("Roo runtime successfully configured at {0}", location));
      }
      catch (IOException e) {
View Full Code Here

      }
    }

    @Override
    public IStatus unConfigure(IProgressMonitor monitor) {
      RooInstallManager installManager = RooCoreActivator.getDefault().getInstallManager();
      try {
        String path = location.getCanonicalPath();

        Set<IRooInstall> installs = new HashSet<IRooInstall>();
        for (IRooInstall install : installManager.getAllInstalls()) {
          if (!path.equals(install.getHome())) {
            installs.add(new DefaultRooInstall(install.getHome(), install.getHome(), install.getHome().equals(
                oldDefaultPath)));
          }
        }

        installManager.setRooInstalls(installs);
      }
      catch (IOException e) {
        RooCoreActivator.log(e);
      }
      return new Status(IStatus.OK, RooCoreActivator.PLUGIN_ID, NLS.bind("Roo runtime successfully unconfigured at {0}", location));
View Full Code Here

   */
  @Override
  public void start(final BundleContext context) throws Exception {
    super.start(context);
    plugin = this;
    this.installManager = new RooInstallManager();
    this.installManager.start();
   
    Job registerJob = new Job("Initializing Spring Roo Tooling") {

      @Override
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.roo.core.model.RooInstallManager

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.