Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IProjectFragment


    // .getSourceModule();
    IScriptProject scriptProject = sourceModule.getScriptProject();
    if (scriptProject != null) {
      return SearchEngine.createSearchScope(scriptProject);
    }
    IProjectFragment projectFragment = (IProjectFragment) sourceModule
        .getAncestor(IModelElement.PROJECT_FRAGMENT);
    if (projectFragment != null) {
      return SearchEngine.createSearchScope(projectFragment);
    }
    // XXX: add language model here
View Full Code Here


   * a project relative path. The empty path refers to the default package
   * fragment.
   */
  public IScriptFolder getScriptFolder(String projectName,
      String fragmentPath, IPath path) throws ModelException {
    IProjectFragment root = getProjectFragment(projectName, fragmentPath);
    if (root == null) {
      return null;
    }
    return root.getScriptFolder(path);
  }
View Full Code Here

    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];
        if (root.getUnderlyingResource().getProjectRelativePath()
            .equals(path)) {
          return root;
        }
      }
    }
View Full Code Here

        .getSourceModule();
    IScriptProject scriptProject = sourceModule.getScriptProject();
    if (scriptProject != null) {
      return SearchEngine.createSearchScope(scriptProject);
    }
    IProjectFragment projectFragment = (IProjectFragment) sourceModule
        .getAncestor(IModelElement.PROJECT_FRAGMENT);
    if (projectFragment != null) {
      return SearchEngine.createSearchScope(projectFragment);
    }
    // XXX: add language model here
View Full Code Here

    IProject project = file.getProject();
    IScriptProject scriptProject = DLTKCore.create(project);
    IProjectFragment[] roots = scriptProject.getProjectFragments();
    ISourceModule module = null;
    for (int j = 0, rootCount = roots.length; j < rootCount; j++) {
      final IProjectFragment root = roots[j];
      IPath rootPath = root.getPath();

      if (rootPath.isPrefixOf(path) && !Util.isExcluded(path, root, false)) {
        IPath localPath = path.setDevice(null).removeFirstSegments(
            rootPath.segmentCount());
        if (localPath.segmentCount() >= 1) {
          final IScriptFolder folder;
          if (localPath.segmentCount() > 1) {
            folder = root.getScriptFolder(localPath.removeLastSegments(1));
          } else {
            folder = root.getScriptFolder(Path.EMPTY);
          }
          module = folder.getSourceModule(localPath.lastSegment());
          break;
        }
      }
View Full Code Here

                } catch (ModelException e) {
                    Logger.logException(e);
                }
            } else if (obj instanceof ProjectFragment) {

                IProjectFragment fragment = (IProjectFragment) obj;
                Logger.debugMSG("Selection is projectfragment");

                try {
                    String fullPath = fragment.getUnderlyingResource().getFullPath().toString();
                    Logger.debugMSG("Setting container text to " + fullPath);
                    containerText.setText(fullPath);
                } catch (ModelException e) {
                    Logger.logException(e);
                }
View Full Code Here

TOP

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

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.