Examples of IEnvironment


Examples of memory.IEnvironment

    @Test(groups = "1s")
    public void AssignmentTest2() {
        int n = 100;

        Solver s = new Solver();
        IEnvironment env = s.getEnvironment();

        AbstractStrategy[] asgs = new AbstractStrategy[n];

        IntVar[] variables = new IntVar[n];
        for (int i = 0; i < n; i++) {
            variables[i] = VariableFactory.enumerated("V" + i, i, n + i, s);
            asgs[i] = IntStrategyFactory.lexico_LB(variables[i]);
        }

        AbstractStrategy sts = ISF.sequencer(asgs);

        s.set(sts);

        env.worldPush();
        Decision decision = sts.getDecision();
        for (int i = 0; i < n; i++) {
            decision.buildNext();
            try {
                decision.apply();
            } catch (ContradictionException e) {
                e.printStackTrace();
            }
            Assert.assertTrue(variables[i].isInstantiated());
            Assert.assertEquals(variables[i].getValue(), i);
            Decision tmp = decision;
            decision = sts.getDecision();
            if (decision != null) {
                decision.setPrevious(tmp);
            } else {
                decision = tmp;
            }
            env.worldPush();
        }
        env.worldPop();
        for (int i = n - 1; i >= 0; i--) {
            env.worldPop();
            decision.buildNext();
            try {
                decision.apply();
            } catch (ContradictionException e) {
                e.printStackTrace();
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    return FileLocator.toFileURL(url).getFile();
  }

  private void checkRutaInterpreter() throws IOException, CoreException {
    // TODO move this method... it is called way too early when eclipse starts
    IEnvironment localEnv = LocalEnvironment.getInstance();
    DefaultInterpreterEntry defaultInterpreterEntry = new DefaultInterpreterEntry(
            RutaNature.NATURE_ID, localEnv.getId());
    IInterpreterInstall defaultInterpreterInstall = null;
    try {
      defaultInterpreterInstall = ScriptRuntime
              .getDefaultInterpreterInstall(defaultInterpreterEntry);
    } catch (Exception e) {
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    checkLibLocations(libLocations, compilerPath.removeLastSegments(3),
      "include/d/dmd/druntime/import", "include/d/dmd/phobos")
  }
 
  public static LibraryLocation[] getLibraryLocations(CommonInstallType dmdInstallType, Path compilerPath) {
    IEnvironment env = LocalEnvironment.getInstance();
    IFileHandle file = PlatformFileUtils.findAbsoluteOrEclipseRelativeFile(env, compilerPath);
    return dmdInstallType.getDefaultLibraryLocations(file);
  }
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    return new CommonDeeInstall(this, id);
  }
 
  @Override
  protected void addDefaultLibraryLocations(IFileHandle executableLocation, List<LibraryLocation> locs) {
    IEnvironment env = executableLocation.getEnvironment();
   
    final IPath exePath = executableLocation.getPath();
    final IPath dmdZipInstallPath = exePath.removeLastSegments(3);
   
    if(checkForDMD2InstallLocation(locs, env, dmdZipInstallPath.append("src")))
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    }
  }
 
  @Override
  protected void addDefaultLibraryLocations(IFileHandle executableLocation, List<LibraryLocation> locs) {
    IEnvironment env = executableLocation.getEnvironment();
    IPath installPath = executableLocation.getPath().removeLastSegments(2);
   
    if(tryDLibFolder(locs, env, installPath.append("include/d"))) {
      return;
    }
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    return new CommonDeeInstall(this, id);
  }
 
  @Override
  protected void addDefaultLibraryLocations(IFileHandle executableLocation, List<LibraryLocation> locs) {
    IEnvironment env = executableLocation.getEnvironment();
    IPath installPath = executableLocation.getPath().removeLastSegments(2);
   
    tryLDCLibFolder(locs, env, installPath);
  }
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    return file.canWrite();
  }
 
  public URI getLocationURI() {
    IEnvironment environment = getEnvironment();
    return environment.getURI(PHPLocationGroup.getLocation());
  }
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    fireEvent();
  }

  @Override
  public void changeControlPressed(DialogField field) {
    IEnvironment environment = this.composerProjectWizardFirstPage.getEnvironment();
    IEnvironmentUI environmentUI = (IEnvironmentUI) environment.getAdapter(IEnvironmentUI.class);
    if (environmentUI != null) {
      String selectedDirectory = environmentUI.selectFolder(this.composerProjectWizardFirstPage.getShell());

      if (selectedDirectory != null) {
        DLTKUIPlugin.getDefault().getDialogSettings().put(DIALOGSTORE_LAST_EXTERNAL_LOC, selectedDirectory);
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

      IPath location = fPHPLocationGroup.getLocation();
      if (fPHPLocationGroup.isInWorkspace()) {
        if (!isValidProjectName(fGroupName.getName())) {
          fDetect = false;
        } else {
          IEnvironment environment = fPHPLocationGroup
              .getEnvironment();
          final IFileHandle directory = environment.getFile(location
              .append(fGroupName.getName()));
          fDetect = directory.isDirectory();
        }
      } else {
        IEnvironment environment = fPHPLocationGroup.getEnvironment();
        if (location.toPortableString().length() > 0) {
          final IFileHandle directory = environment.getFile(location);
          fDetect = directory.isDirectory()
              && directory.getPath().toFile().exists();
        }
      }
      if (oldDetectState != fDetect) {
View Full Code Here

Examples of org.eclipse.dltk.core.environment.IEnvironment

    setChanged();
    notifyObservers();
  }

  protected String getDefaultPath(String name) {
    IEnvironment environment = this.getEnvironment();
    if (environment != null && environment.isLocal()) {
      final IPath path = Platform.getLocation().append(name);
      return path.toOSString();
    } else {
      return ""; //$NON-NLS-1$
    }
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.