Package org.eclipse.core.internal.resources

Examples of org.eclipse.core.internal.resources.Workspace


            public void doubleClick(DoubleClickEvent event)
            {

                IPath path = new Path(suiteStatus.getSuitePath());

                Workspace w = (Workspace) ResourcesPlugin.getWorkspace();

                File file = (File) w.newResource(path, IResource.FILE);

                FileEditorInput input = new FileEditorInput(file);

                try
                {
View Full Code Here


   
    File folder = null;
    if(location != null) {
      folder = FileUtil.toPath(FileUtil.canonicalURI(location)).toFile();
    } else {
      Workspace workspace = (Workspace)ResourcesPlugin.getWorkspace();
      folder = workspace.getRoot().getLocation().append(name).toFile();
    }
   
    if(folder.exists()) {
      if(folder.isDirectory()) {
        File[] files = folder.listFiles();
View Full Code Here

        }
          else if(element instanceof CFJavaFileEditorInput)
        {
              String filepath = ((CFJavaFileEditorInput)element).getPath(element).toString();
              IPath path = new Path(filepath);
              Workspace workspace = (Workspace)CFMLPlugin.getWorkspace();
              IFile file = new ExternalFile(path,workspace);
              model = ((ExternalFile)file).getAnnotationModel();
       
          document.setParserResource(file);
          document.clearAllMarkers();
          document.parseDocument();
        }
          else if (element instanceof RemoteFileEditorInput)
        {
              String filepath = ((RemoteFileEditorInput)element).getPath(element).toString();
              Path path = new Path(filepath);
              Workspace workspace = (Workspace)CFMLPlugin.getWorkspace();
              ExternalFile file = new ExternalFile(path,workspace);
              model = file.getAnnotationModel();
              document.setParserResource(file);
              document.clearAllMarkers();
              document.parseDocument();
        }
          else if(element instanceof FileStoreEditorInput)
        {
              String filepath = ((FileStoreEditorInput)element).getURI().getPath().toString();
              IPath path = new Path(filepath);
              Workspace workspace = (Workspace)CFMLPlugin.getWorkspace();
              IFile file = new ExternalFile(path,workspace);
              model = ((ExternalFile)file).getAnnotationModel();
       
          document.setParserResource(file);
          document.clearAllMarkers();
View Full Code Here

      }
    }

    @Override
    public void run() {
      Workspace workspace = (Workspace) ResourcesPlugin.getWorkspace();
      IJavaProject javaProject= m_workingProject != null ? m_workingProject : JDTUtil.getJavaProjectContext();
      if(null == javaProject) {
        return;
      }
      PreferenceStoreUtil storage= TestNGPlugin.getPluginPreferenceStore();
      IPath filePath= new Path(storage.getOutputDirectoryPath(javaProject).toOSString() + "/index.html");
      boolean isAbsolute= storage.isOutputAbsolutePath(javaProject.getElementName(), false);

      IProgressMonitor progressMonitor= new NullProgressMonitor();
      if(isAbsolute) {
        IFile file = javaProject.getProject().getFile("temp-testng-index.html");
        try {
          file.createLink(filePath, IResource.NONE, progressMonitor);
          if(null == file) return;
          try {
            openEditor(file);
          }
          finally {
            file.delete(true, progressMonitor);
          }
        }
        catch(CoreException cex) {
          ; // TODO: is there any other option?
        }
      }
      else {
        IFile file= (IFile) workspace.newResource(filePath, IResource.FILE);
        if(null == file) return;
        try {
          file.refreshLocal(IResource.DEPTH_ZERO, progressMonitor);
          openEditor(file);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.core.internal.resources.Workspace

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.