Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IScriptProject


  /*
   * @see ViewerFilter
   */
  public boolean select(Viewer viewer, Object parent, Object element) {
    if (element instanceof IScriptProject){
      IScriptProject sp = (IScriptProject)element;
      if(DLTKLanguageManager.getLanguageToolkit(sp) instanceof
          PHPLanguageToolkit){
        return true;
      }else{
        return false;
View Full Code Here


  protected void tearDown() throws Exception {
    project.delete(true, null);
  }

  public void testIncludePathGet() throws Exception {
    IScriptProject scriptProject = DLTKCore.create(project);
    scriptProject.setRawBuildpath(new IBuildpathEntry[0], null);

    IncludePath[] includePath = IncludePathManager.getInstance()
        .getIncludePaths(project);
    Assert.assertTrue(includePath.length == 0);
  }
View Full Code Here

  // path:
  public void testIncludePathGetAfterBPChange1() throws Exception {
    IFolder folder = project.getFolder("a");
    folder.create(true, true, null);

    IScriptProject scriptProject = DLTKCore.create(project);
    scriptProject.setRawBuildpath(new IBuildpathEntry[] { DLTKCore
        .newSourceEntry(folder.getFullPath()) }, null);

    IncludePath[] includePath = IncludePathManager.getInstance()
        .getIncludePaths(project);
    Assert.assertTrue(includePath.length == 0);
View Full Code Here

  // path:
  public void testIncludePathGetAfterBPChange2() throws Exception {
    String libraryPath = Platform.OS_WIN32.equals(Platform.getOS()) ? "C:\\Projects\\MyLibrary"
        : "/var/www/MyLibrary";

    IScriptProject scriptProject = DLTKCore.create(project);
    scriptProject.setRawBuildpath(
        new IBuildpathEntry[] { DLTKCore
            .newExtLibraryEntry(EnvironmentPathUtils.getFullPath(
                LocalEnvironment.getInstance(), new Path(
                    libraryPath))) }, null);
View Full Code Here

    }
    return resources.toArray();
  }

  public static boolean isPHPSource(ISourceModule element) {
    IScriptProject scriptProject = element.getScriptProject();
    if (scriptProject != null) {
      IProject project = scriptProject.getProject();
      if (project != null) {
        try {
          IProjectNature nature = project.getNature(PHPNature.ID);
          if (nature != null)
            return true;
View Full Code Here

          result.add(element);
        } else {
          IProject project = (IProject) element
              .getAdapter(IProject.class);
          if (project != null && project.exists()) {
            IScriptProject jp = DLTKCore.create(project);
            if (jp != null && jp.exists()) {
              result.add(jp);
            } else {
              result.add(project);
            }
          }
View Full Code Here

  }

  private IProject getProject(IModelElement element) {
    if (element == null)
      return null;
    IScriptProject project = element.getScriptProject();
    if (project == null)
      return null;
    return project.getProject();
  }
View Full Code Here

      IProjectFragment root = ScriptModelUtil.getProjectFragment(element);

      if (root != null && root != element && root.isArchive()) {
        return null;
      }
      IScriptProject project = element.getScriptProject();
      if (project != null) {
        return project.getProject();
      }
      return null;
    } else if (firstElement instanceof IncludePath) {
      return ((IncludePath) firstElement).getProject();
    } else if (firstElement instanceof IncludePathContainer) {
View Full Code Here

   * workspace
   */
  public IProjectFragment getProjectFragment(String projectName,
      String fragmentPath) throws ModelException {

    IScriptProject project = getScriptProject(projectName);
    if (project == null) {
      return null;
    }
    IPath path = new Path(fragmentPath);
    if (path.isAbsolute()) {
      IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace()
          .getRoot();
      IResource resource = workspaceRoot.findMember(path);
      IProjectFragment root;
      // resource in the workspace
      root = project.getProjectFragment(resource);
      return root;
    } else {
      IProjectFragment[] roots = project.getProjectFragments();
      if (roots == null || roots.length == 0) {
        return null;
      }
      for (int i = 0; i < roots.length; i++) {
        IProjectFragment root = roots[i];
View Full Code Here

        for (int i = 0; i < containersLength; i++) {
          entries[sourceLength + projectLength + i] = DLTKCore
              .newContainerEntry(new Path(containers[i]));
        }
        // set buildpath and output location
        IScriptProject scriptProject = DLTKCore.create(project);
        scriptProject.setRawBuildpath(entries, null);

        result[0] = scriptProject;
      }
    };
    getWorkspace().run(create, null);
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.IScriptProject

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.