Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IScriptFolder


      return;
    }
   
    List<INamespaceResolver> resolvers = ExtensionManager.getDefault().getNamespaceResolvers();

    IScriptFolder folder = getScriptFolder();

    // try to find a namespaceresolver and inject the resolved namespace
    for (INamespaceResolver resolver : resolvers) {
      try {
        String ns = resolver.resolve(folder);
View Full Code Here


  abstract protected String generateFileContent();
 
  @Override
  public IScriptFolder getScriptFolder() {

    IScriptFolder folder = super.getScriptFolder();
   
    if (folder == null && initialFolder != null) {
      setScriptFolder(initialFolder, true);
      folder = initialFolder;
    }
View Full Code Here

          for (Iterator<Object> iterator = strucSelection.iterator(); iterator.hasNext();) {
           
            try {
              Object element = iterator.next();
              if (element instanceof IScriptFolder) {
                IScriptFolder folder = (IScriptFolder) element;
                processFolder(folder, monitor);
              } else if (element instanceof ISourceModule) {
                runFixer((ISourceModule) element, monitor);
              } else if (element instanceof ElementImplForPhp) {
               
View Full Code Here

//    if (pack == null) {
//      pack = findProjectFragment(type);
//    }
//    getScriptFolderLabel(pack, (flags & QUALIFIER_FLAGS), buf);
   
    IScriptFolder pkg = type.getScriptFolder();
    if(pkg.isRootFolder()) {
      return;
    }
    buf.append(pkg.getElementName().replaceAll("/", ".") + ".");
  }
View Full Code Here

  }
 
  @Override
  protected void getSourceModule(ISourceModule module, long flags, StringBuffer buf) {
    if (getFlag(flags, CU_QUALIFIED)) {
      IScriptFolder pack = (IScriptFolder) module.getParent();
      if(!pack.isRootFolder()) {
        getScriptFolderLabel(pack, (flags & QUALIFIER_FLAGS), buf);
        buf.append("/");
      }
    }
    buf.append(module.getElementName());
   
    if (getFlag(flags, CU_POST_QUALIFIED) && !((IScriptFolder) module.getParent()).isRootFolder()) {
      IScriptFolder pack = (IScriptFolder) module.getParent();
      buf.append(CONCAT_STRING);
      getScriptFolderLabel(pack, flags & QUALIFIER_FLAGS, buf);
    }
  }
View Full Code Here

  }

  @Override
  protected String getFileContent() {
    StringBuilder sb = new StringBuilder();
    IScriptFolder scriptFolder = getScriptFolder();
    IScriptProject scriptProject = scriptFolder.getScriptProject();

   
    IFolder folder = null;
    try {
      folder = getScriptFolderOf(scriptFolder, scriptProject);
    } catch (ModelException e) {
      RutaIdeUIPlugin.error(e);
    }
    if(folder == null)  {
      return "";
    }
   
    IPath path = scriptFolder.getPath();
    IPath fullPath = folder.getFullPath();
    IPath relativeTo = path.makeRelativeTo(fullPath);
    if(!relativeTo.isEmpty()) {
    sb.append("PACKAGE ");
    String pathString = "";
View Full Code Here

      IScriptModel model = DLTKUtils.getDLTKModel();
      IScriptProject scriptProj = model.getScriptProject("#__PreviewProject");
     
      IProjectFragment projectFragment = scriptProj.getProjectFragment(scriptProj.getProject().getFolder("src"));
      assertNotNull(projectFragment);
      IScriptFolder scriptFolder = projectFragment.getScriptFolder("pack.sub");
      String[] ns = array("pack", "sub");
      assertNotNull(scriptFolder);
      ISourceModule sourceModule1 = scriptFolder.getSourceModule("sourceModule.d");
      assertNotNull(sourceModule1);

//      FakeMember.FakeType primitive_
//        = new FakeMember.FakeType(sourceModule1, "primitive", FLAG_KIND_STRUCT, ns);
     
View Full Code Here

  protected static IProjectFragment getSrcFolder(IScriptProject scriptProject, String folderName) {
    return scriptProject.getProjectFragment(scriptProject.getProject().getFolder(folderName));
  }
 
  protected static ISourceModule getModule(IScriptProject project, String srcFolder, String pkg, String module) {
    IScriptFolder scriptFolder = getSrcFolder(project, srcFolder).getScriptFolder(pkg);
    return scriptFolder.getSourceModule(module + ".d");
  }
View Full Code Here

    return foundSourceModule;
  }
 
  @Override
  protected boolean visitSourceContainer(IProjectFragment srcFolder) {
    IScriptFolder scriptFolder = srcFolder.getScriptFolder(packagesPath);
   
    if(scriptFolder.exists()) {
      foundSourceModule = getExistingSourceModule(scriptFolder, moduleName);
      if(foundSourceModule != null) {
        return true;
      }
    }
    // search for package.d
    scriptFolder = srcFolder.getScriptFolder(packagesPath.append(moduleName));
    if(scriptFolder.exists()) {
      foundSourceModule = getExistingSourceModule(scriptFolder, "package");
      if(foundSourceModule != null) {
        return true;
      }
    }
View Full Code Here

  @Override
  protected String getFileContent() {
    StringBuilder sb = new StringBuilder();
    sb.append("PACKAGE ");
    IScriptFolder scriptFolder = getScriptFolder();
    IPath path =  scriptFolder.getPath().removeFirstSegments(1);
    String pathString = "";
    for (int i = 1; i < path.segments().length; i++) {
      pathString += path.segments()[i];
      if (i < path.segments().length - 1) {
        pathString += ".";
View Full Code Here

TOP

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

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.