Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IScriptProject


        StructuredSelection selection = (StructuredSelection) currentSelection;
        Iterator<?> iter = selection.iterator();
        while (iter.hasNext()) {
          Object object = iter.next();
          if (object instanceof IScriptProject) {
            IScriptProject p = (IScriptProject) object;
            projects.add(p.getProject());
          } else if (object instanceof IProject) {
            projects.add((IProject) object);
          }
        }
      }
      monitor.beginTask("Updating UIMA Ruta project...", projects.size());
      for (IProject each : projects) {
        // update old projects
        try {
          IProjectDescription description = each.getDescription();
          String[] natureIds = description.getNatureIds();
          int counter = 0;
          boolean oldProject = false;
          for (String id : Arrays.asList(natureIds)) {
            if (id.equals("org.apache.uima.textmarker.ide.nature")) {
              natureIds[counter] = RutaNature.NATURE_ID;
              oldProject = true;
            }
            counter++;
          }
          if (oldProject) {
            description.setNatureIds(natureIds);
            each.setDescription(description, monitor);
            List<File> files = getFiles(new File(each.getLocation().toPortableString()));
            for (File file : files) {
              String absolutePath = file.getAbsolutePath();
              if (file.getName().endsWith(".tm")) {
                File newFile = new File(absolutePath.substring(0, absolutePath.length() - 3)
                        + ".ruta");
                file.renameTo(newFile);
              }
            }
            IScriptProject sp = DLTKCore.create(each);
            List<IFolder> scriptFolders = RutaProjectUtils.getScriptFolders(sp);
            for (IFolder iFolder : scriptFolders) {
              iFolder.refreshLocal(IResource.DEPTH_INFINITE, monitor);
            }
          }
View Full Code Here


        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot workspaceRoot = workspace.getRoot();
        IFile iFile = workspaceRoot.getFileForLocation(path);
        IProject project = iFile.getProject();
        if (iFile != null) {
          IScriptProject scriptProject = DLTKCore.create(project);
          List<IFolder> allScriptFolders;
          try {
            allScriptFolders = RutaProjectUtils.getAllScriptFolders(scriptProject);
            List<String> folders = RutaProjectUtils.getFolderLocations(allScriptFolders);
            String locate = RutaEngine.locate(script, folders.toArray(new String[0]),
View Full Code Here

        StructuredSelection selection = (StructuredSelection) currentSelection;
        Iterator<?> iter = selection.iterator();
        while (iter.hasNext()) {
          Object object = iter.next();
          if (object instanceof IScriptProject) {
            IScriptProject p = (IScriptProject) object;
            projects.add(p.getProject());
          } else if (object instanceof IProject) {
            projects.add((IProject) object);
          }
        }
      }
      monitor.beginTask("Converting to UIMA Ruta project...", projects.size());
      for (IProject each : projects) {
        try {
          IScriptProject scriptProject = DLTKCore.create(each);
          ResourceUtil.addNature(each, monitor, RutaNature.NATURE_ID);
          RutaProjectCreationWizard.createRutaProject(scriptProject, null, monitor);
        } catch (CoreException e) {
          RutaAddonsPlugin.error(e);
        }
View Full Code Here

            IWorkspace workspace = ResourcesPlugin.getWorkspace();
            IWorkspaceRoot workspaceRoot = workspace.getRoot();
            IFile iFile = workspaceRoot.getFileForLocation(path);
            if (iFile != null) {
              IProject project = iFile.getProject();
              IScriptProject scriptProject = DLTKCore.create(project);
              List<IFolder> allScriptFolders;
              try {
                allScriptFolders = RutaProjectUtils.getAllScriptFolders(scriptProject);
                List<String> folders = RutaProjectUtils.getFolderLocations(allScriptFolders);
                String locate = RutaEngine.locate(script, folders.toArray(new String[0]),
View Full Code Here

          Collection<IProject> visited) throws CoreException {
    List<IFolder> result = new ArrayList<IFolder>();
    IProject[] referencedProjects = proj.getProject().getReferencedProjects();
    for (IProject eachProject : referencedProjects) {
      if (!visited.contains(eachProject)) {
        IScriptProject scriptProject = DLTKCore.create(eachProject);
        result.addAll(RutaProjectUtils.getScriptFolders(scriptProject));
        visited.add(eachProject);
        result.addAll(getReferencedScriptFolders(scriptProject, visited));
      }
    }
View Full Code Here

 
  private static void extendClasspathWithProject(Collection<String> result, IProject project,
          Collection<IProject> visited) throws CoreException, JavaModelException {
    IProjectNature rutaNature = project.getNature(RutaNature.NATURE_ID);
    if (rutaNature != null) {
      IScriptProject sp = DLTKCore.create(project);
      List<IFolder> scriptFolders = RutaProjectUtils.getScriptFolders(sp);
      for (IFolder each : scriptFolders) {
        result.add(each.getLocation().toPortableString());
      }
      List<IFolder> descriptorFolders = RutaProjectUtils.getDescriptorFolders(project);
View Full Code Here

      RutaModuleDeclaration tmmd = (RutaModuleDeclaration) moduleDeclaration;
      DescriptorManager sm = tmmd.descriptorInfo;
      IPath pathToModule = sourceModule.getResource().getLocation();
      String elementName = RutaProjectUtils.getModuleName(pathToModule);

      IScriptProject proj = sourceModule.getScriptProject();
      // TODO: dont use desc path!
      IPath descPath = RutaProjectUtils.getDescriptorRootPath(proj.getProject());
      IPath scriptPath = RutaProjectUtils.getScriptRootPath(proj.getProject());
      IPath descPackagePath = RutaProjectUtils.getDescriptorPackagePath(sourceModule.getResource()
              .getLocation(), proj.getProject());

      String typeSystem = descPackagePath.append(elementName + "TypeSystem.xml").toPortableString();
      String engine = descPackagePath.append(elementName + "Engine.xml").toPortableString();
      String basicTS = descPath.append("BasicTypeSystem.xml").toPortableString();
      String basicE = descPath.append("BasicEngine.xml").toPortableString();

      // TODO: may not work with other script folders
      IPath relativeTo = pathToModule.makeAbsolute().makeRelativeTo(scriptPath);
      List<String> scriptPathList = new ArrayList<String>();
      List<String> descriptorPathList = new ArrayList<String>();

      // add all folders
      try {
        List<IFolder> scriptFolders = RutaProjectUtils.getAllScriptFolders(proj);
        scriptPathList.addAll(RutaProjectUtils.getFolderLocations(scriptFolders));
      } catch (CoreException e) {
        RutaIdeCorePlugin.error(e);
      }

      try {
        List<IFolder> descriptorFolders = RutaProjectUtils.getAllDescriptorFolders(proj
                .getProject());
        descriptorPathList.addAll(RutaProjectUtils.getFolderLocations(descriptorFolders));
      } catch (Exception e) {
        RutaIdeCorePlugin.error(e);
      }

      String[] descriptorPaths = descriptorPathList.toArray(new String[0]);
      String[] scriptPaths = scriptPathList.toArray(new String[0]);
      String mainScript = relativeTo.toPortableString();
      mainScript = mainScript.replaceAll("/", ".");
      if (mainScript.endsWith(RutaEngine.SCRIPT_FILE_EXTENSION)) {
        mainScript = mainScript.substring(0, mainScript.length() - 5);
      }
      Collection<String> dependencies = RutaProjectUtils.getClassPath(proj
              .getProject());
      URL[] urls = new URL[dependencies.size()];
      int counter = 0;
      for (String dep : dependencies) {
        try {
View Full Code Here

      }
    }

    private void referenceEngineCall(String name) {
      // name = "";
      IScriptProject scriptProject = sourceModule.getScriptProject();
      IFile engine = getEngine(name, scriptProject);
      if (engine == null) {
        return;
      }
      results.add(engine);
View Full Code Here

    // 090813:
    RutaModuleDeclaration parsed = (RutaModuleDeclaration) this.parser.parse(module);

    // types = getShortNames(types);
    if (classloader == null) {
      IScriptProject scriptProject = sourceModule.getModelElement().getScriptProject();
      try {
        Collection<String> dependencies = RutaProjectUtils.getClassPath(scriptProject.getProject());
        URL[] urls = new URL[dependencies.size()];
        int counter = 0;
        for (String dep : dependencies) {
          urls[counter] = new File(dep).toURI().toURL();
          counter++;
View Full Code Here

    final Annotation[] annotations = fAssistant.getAnnotationsAtOffset();
    final ScriptEditor editor = (ScriptEditor) this.fAssistant.getEditor();
    final IAnnotationModel model = DLTKUIPlugin.getDocumentProvider().getAnnotationModel(
            editor.getEditorInput());
    final IModelElement element = editor.getInputModelElement();
    final IScriptProject scriptProject = element.getScriptProject();
    List proposals = null;
    for (int i = 0; i < annotations.length; i++) {
      final Annotation annotation = annotations[i];
      ICompletionProposal proposal = null;
      if (annotation instanceof MarkerAnnotation) {
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.