Package org.eclipse.dltk.core

Examples of org.eclipse.dltk.core.IScriptProject


  private Collection<String> getDependencies(ILaunchConfiguration configuration)
          throws CoreException {
    Collection<String> result = new TreeSet<String>();

    IScriptProject scriptProject = AbstractScriptLaunchConfigurationDelegate
            .getScriptProject(configuration);
    IProject[] referencedProjects = scriptProject.getProject().getReferencedProjects();
    for (IProject eachProject : referencedProjects) {
      // for each java project
      extendClasspathWithProject(result, eachProject, new HashSet<IProject>());
    }
    return result;
View Full Code Here


  @Override
  public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch,
          IProgressMonitor monitor) throws CoreException {
    this.mode = mode;
    IResource ouputFolder = null;
    IScriptProject proj = AbstractScriptLaunchConfigurationDelegate.getScriptProject(configuration);
    IPath projectPath = proj.getResource().getLocation();
    IPath outputDirPath = projectPath.append(RutaProjectUtils.getDefaultOutputLocation());
    String outputFolderPath = configuration.getAttribute(RutaLaunchConstants.ARG_OUTPUT_FOLDER,
            outputDirPath.toPortableString());
    if (outputFolderPath.length() != 0) {
      IPath path = Path.fromPortableString(outputFolderPath);
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

    if (marker.getAttribute(IScriptModelMarker.ID, 0) == RutaProblems.UNKNOWN_REQUIRED_PACKAGE) {
      final String[] args = CorrectionEngine.getProblemArguments(marker);
      if (args != null && args.length != 0 && args[0] != null) {
        IResource resource = marker.getResource();
        IProject project = resource.getProject();
        IScriptProject scriptProject = DLTKCore.create(project);
        if (isFixable(args[0], scriptProject)) {
          return true;
        }
      }
    }
View Full Code Here

  public static void doRunImpl(InterpreterConfig config, ILaunch launch,
          IRutaInterpreterRunnerConfig iconfig, IProgressMonitor monitor)
          throws CoreException {
    String launchMode = launch.getLaunchMode();
    IScriptProject proj = AbstractScriptLaunchConfigurationDelegate.getScriptProject(launch
            .getLaunchConfiguration());

    IPath projectPath = proj.getResource().getLocation();
    IPath inputDirPath = projectPath.append(RutaProjectUtils.getDefaultInputLocation());
    IPath outputDirPath = projectPath.append(RutaProjectUtils.getDefaultOutputLocation());
    String engine = RutaProjectUtils.getEngineDescriptorPath(config.getScriptFilePath(),
            proj.getProject()).toPortableString();
    IPath rootPath = RutaProjectUtils.getDescriptorRootPath(proj.getProject());

    File inputDir = inputDirPath.makeAbsolute().toFile();
    File outputDir = outputDirPath.makeAbsolute().toFile();

    if(!inputDir.exists()) {
      inputDir.mkdirs();
      IFolder folder = proj.getProject().getFolder(RutaProjectUtils.getDefaultInputLocation());
      folder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
    }
    IFolder outputFolder = proj.getProject().getFolder(RutaProjectUtils.getDefaultOutputLocation());
  if(!outputDir.exists()) {
      outputDir.mkdirs();
      outputFolder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
    }
   
View Full Code Here

        IPath path = fei.getPath();
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot workspaceRoot = workspace.getRoot();
        IFile iFile = workspaceRoot.getFileForLocation(path);
        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]), RutaEngine.SCRIPT_FILE_EXTENSION);
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("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

    String fileNameWithExtension = fileNameWithoutExtension + RutaEngine.SCRIPT_FILE_EXTENSION;
    ISourceModule sourceModule = null;
    boolean found = false;
    for (IFolder eachFolder : scriptFolders) {

      IScriptProject sp = DLTKCore.create(eachFolder.getProject());
      IScriptFolder[] scriptFolders2 = sp.getScriptFolders();
      for (IScriptFolder iScriptFolder : scriptFolders2) {
        sourceModule = iScriptFolder.getSourceModule(fileNameWithExtension);
        if (sourceModule.exists() && sourceModule.getResource() != null
                && sourceModule.getResource().exists()) {
          found = true;
View Full Code Here

  @Override
  public void doInitializeForm(ILaunchConfiguration config) {
    super.doInitializeForm(config);
   
   
    IScriptProject proj = null;
    try {
      proj = AbstractScriptLaunchConfigurationDelegate.getScriptProject(config);
    } catch (CoreException e) {
      RutaIdePlugin.error(e);
    }
    String defaultInputLocation = RutaProjectUtils.getDefaultInputLocation();
    String defaultOutputLocation = RutaProjectUtils.getDefaultOutputLocation();
    IResource inputFolder = proj.getProject().findMember(defaultInputLocation);
    IResource outputFolder = proj.getProject().findMember(defaultOutputLocation);
   
   
    try {
      recursivelyButton.setSelection(config.getAttribute(RutaLaunchConstants.RECURSIVE, false));
    } catch (CoreException e) {
View Full Code Here

  }

  @Override
  public void setDefaults(ILaunchConfigurationWorkingCopy config) {
    super.setDefaults(config);
    IScriptProject proj = null;
    try {
      proj = AbstractScriptLaunchConfigurationDelegate.getScriptProject(config);
    } catch (CoreException e) {
      RutaIdePlugin.error(e);
    }
    String defaultInputLocation = RutaProjectUtils.getDefaultInputLocation();
    String defaultOutputLocation = RutaProjectUtils.getDefaultOutputLocation();
    IResource inputFolder = proj.getProject().findMember(defaultInputLocation);
    IResource outputFolder = proj.getProject().findMember(defaultOutputLocation);
    config.setAttribute(RutaLaunchConstants.RECURSIVE, false);
    config.setAttribute(RutaLaunchConstants.INPUT_FOLDER, inputFolder.getFullPath().toPortableString());
    config.setAttribute(RutaLaunchConstants.OUTPUT_FOLDER, outputFolder.getFullPath().toPortableString());
  }
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.