Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspace


      throw new RuntimeException("Project '" + getProjectName() + "' was already created");
   
    IProgressMonitor monitor = getMonitor();
   
    // create a new project automatically
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IWorkspaceRoot root = workspace.getRoot();
    root.refreshLocal(5, monitor);
    project = root.getProject(getProjectName());
    // delete any existing ones
    if (project.exists()) {
      project.delete(true, monitor);
View Full Code Here


      public void run(IProgressMonitor monitor) throws CoreException {
        IPackageFragment pack = testProject.createPackage("paket1") ;
        IType type= testProject.createType(pack, "AClass.java", "public class AClass {public voi m(){}}");
      }
    };
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    workspace.run(runnable,null);
    Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
    IMarker[] markers = workspace.getRoot().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
    assertEquals(1, markers.length);
  }  
View Full Code Here

      public void run(IProgressMonitor monitor) throws CoreException {
        IPackageFragment pack = testProject.createPackage("paket1") ;
        IType type= testProject.createType(pack, "AClass.java", "public class AClass {public void m(){}}")
      }
    };
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    workspace.run(runnable,null);
    Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);

    IMarker[] markers = workspace.getRoot().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
    assertEquals(0, markers.length);
  }
View Full Code Here

        IType type= testProject.createType(pack, "AClass.java", "public class AClass {public void m(){}}")
        IType testClass = testProject.createType(pack, "AClassBehaviour.java", "public class AClassBehaviour extends org.jbehave.core.mock.UsingMatchers{public void shouldAddUp(){ensureThat(2,eq(1+1));}}");
     
      }
    };
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    workspace.run(runnable,null);
    Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);

    IMarker[] markers = workspace.getRoot().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
    assertEquals(0, markers.length);
  }
View Full Code Here

        IPackageFragment pack = testProject.createPackage("paket1") ;
        IType type= testProject.createType(pack, "AClass.java", "public class AClass {public void m(){}}")
        IType testClass = testProject.createType(pack, "AClassBehaviour.java", "public class AClassBehaviour extends org.jbehave.core.mock.UsingMatchers{public void shouldAddUp(){ensureThat(2,eq(1+1));}}");
      }
    };
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    workspace.run(runnable,null);
    Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);

    IMarker[] markers = workspace.getRoot().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
    assertEquals(0, markers.length);
    ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
    ILaunchConfigurationType configType = lm.getLaunchConfigurationType(JBehaveLaunchConfiguration.ID_JBEHAVE_APPLICATION)
 
    ConfigurationState state=new ConfigurationState();
View Full Code Here

    setErrorMessage(null);
    setMessage(null);
   
    String name = projectText.getText().trim();
    if (name.length() > 0) {
      IWorkspace workspace = ResourcesPlugin.getWorkspace();
      IStatus status = workspace.validateName(name, IResource.PROJECT);
      if (status.isOK()) {
        IProject project= ResourcesPlugin.getWorkspace().getRoot().getProject(name);
        if (!project.exists()) {
          setErrorMessage(MessageFormat.format(BEHAVIOUR_CHOOSING_ERROR, new String[] {name})); //$NON-NLS-1$
          return false;
View Full Code Here

        if (progressMonitor != null)
          progressMonitor.setCanceled(true);
        return;
      }
     
      IWorkspace workspace= ResourcesPlugin.getWorkspace();
      IFile file= workspace.getRoot().getFile(filePath);
      newInput= new FileEditorInput(file);

    }
   
    if (provider == null) {
View Full Code Here

   *
   * @param fileEditorInput the input of an text editor
   * @param path the path of the new location of the file
   */
  protected void handleElementMoved(IFileEditorInput fileEditorInput, IPath path) {
    IWorkspace workspace= ResourcesPlugin.getWorkspace();
    IFile newFile= workspace.getRoot().getFile(path);
    fireElementMoved(fileEditorInput, newFile == null ? null : new FileEditorInput(newFile));
  }
View Full Code Here

      IFileEditorInput input= (IFileEditorInput) element;
      FileInfo info= (FileInfo) getElementInfo(input);
      if (info != null) {
        IFile file= input.getFile();
        if (file.isReadOnly()) { // do not use cached state here
          IWorkspace workspace= file.getWorkspace();
          info.fStatus= workspace.validateEdit(new IFile[] { file }, computationContext);
        }
        if (isDerived(file)) {
          IStatus status= new Status(IStatus.WARNING, EditorsUI.PLUGIN_ID, EditorsUI.DERIVED_FILE, TextEditorMessages.FileDocumentProvider_warning_fileIsDerived, null);
          if (info.fStatus == null || info.fStatus.isOK())
            info.fStatus= status;
View Full Code Here

    /*
     * @see org.eclipse.core.buffer.text.IBufferedFileListener#underlyingFileMoved(org.eclipse.core.buffer.text.IBufferedFile, org.eclipse.core.runtime.IPath)
     */
    public void underlyingFileMoved(IFileBuffer file, IPath newLocation) {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      IFile newFile= workspace.getRoot().getFile(newLocation);
      IEditorInput input= newFile == null ? null : new FileEditorInput(newFile);
      List list= new ArrayList(fElementStateListeners);
      Iterator e= list.iterator();
      while (e.hasNext()) {
        IElementStateListener l= (IElementStateListener) e.next();
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IWorkspace

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.