Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IWorkspaceRoot


    }
  }
 
  private static IResource getResource(final IPath fullPath, final int resourceType) {
    IWorkspace _workspace = ResourcesPlugin.getWorkspace();
    final IWorkspaceRoot root = _workspace.getRoot();
    switch (resourceType) {
      case IResource.ROOT:
        return root;
      case IResource.PROJECT:
        String _lastSegment = fullPath.lastSegment();
        return root.getProject(_lastSegment);
      case IResource.FOLDER:
        return root.getFolder(fullPath);
      case IResource.FILE:
        return root.getFile(fullPath);
      default:
        return null;
    }
  }
View Full Code Here


  public void setUp() throws Exception {
    this.tearDown();
    ModelActivator.initModel();
    ErlModelManager.INSTANCE.startup();
    this.setAutoBuilding(false);
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
    _workspaceRoot.setDefaultCharset("UTF-8", null);
  }
View Full Code Here

   * @param name
   *            the name of the project
   * @return the project (never <code>null</code>)
   */
  protected IProject getProject(final String name) {
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
    return _workspaceRoot.getProject(name);
  }
View Full Code Here

    Assert.assertNotNull(sourceRoot);
    final File source = new File(sourceRoot, path);
    String _plus = (source + " doesn\'t exist");
    boolean _exists = source.exists();
    Assert.assertTrue(_plus, _exists);
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
    IPath _location = _workspaceRoot.getLocation();
    final File targetRoot = _location.toFile();
    final File target = new File(targetRoot, path);
    this.copy(source, target);
  }
View Full Code Here

    return _classLoader.getResource("workspace");
  }
 
  protected IErlProject getErlProject(final String name) {
    IErlModel _model = this.getModel();
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
    IProject _project = _workspaceRoot.getProject(name);
    return _model.getErlangProject(_project);
  }
View Full Code Here

   * Deletes all resources in the workspace.
   *
   * @throws CoreException
   */
  protected void cleanUpWorkspace() throws CoreException {
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
    _workspaceRoot.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT, null);
    IWorkspaceRoot _workspaceRoot_1 = this.getWorkspaceRoot();
    IPath _location = _workspaceRoot_1.getLocation();
    String _portableString = _location.toPortableString();
    final File file = new File(_portableString, "tmp");
    this.deleteDirectory(file);
  }
View Full Code Here

    erlProject.open(null);
    return erlProject;
  }
 
  public IErlProject getExistingProject(final String name) {
    IWorkspaceRoot _workspaceRoot = this.getWorkspaceRoot();
    final IProject project = _workspaceRoot.getProject(name);
    IErlModel _model = this.getModel();
    return _model.getErlangProject(project);
  }
View Full Code Here

      final List<IErlFolder> result = CollectionLiterals.<IErlFolder>newArrayList();
      Collection<IPath> _sourceDirs = this.properties.getSourceDirs();
      for (final IPath path : _sourceDirs) {
        {
          IWorkspace _workspace = ResourcesPlugin.getWorkspace();
          IWorkspaceRoot _root = _workspace.getRoot();
          IPath _baseDir = this.properties.getBaseDir();
          IPath _append = _baseDir.append(path);
          IResource _findMember = _root.findMember(_append);
          final IErlElement element = ErlModelCore.create(_findMember);
          if ((element instanceof IErlFolder)) {
            StringConcatenation _builder = new StringConcatenation();
            _builder.append("ADD FOLDER ");
            _builder.append(((IErlFolder)element), "");
View Full Code Here

    public void start(final BundleContext context) throws Exception {
        super.start(context);
        ErlLogger.debug("Core starting");

        final IWorkspace workspace = ResourcesPlugin.getWorkspace();
        final IWorkspaceRoot workspaceRoot = workspace.getRoot();
        ErlideEventTracer.getInstance().traceSession(
                workspaceRoot.getLocation().toPortableString());

        final IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
        final String logDir = workspaceRoot.getLocation().toPortableString();
        final ErlangDebugOptionsManager erlangDebugOptionsManager = new ErlangDebugOptionsManager();

        core = new ErlangCore(this, workspace, extensionRegistry, logDir,
                erlangDebugOptionsManager);
        core.start();
View Full Code Here

public class BackendUtils {

    public static String getErlideNodeNameTag() {
        String fUniqueId;
        final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
        final String location = root.getLocation().toPortableString();
        final String user = System.getProperty("user.name");
        final String timestamp = Long.toHexString(System.currentTimeMillis() & 0xFFFFFF);
        fUniqueId = Long.toHexString(location.hashCode() & 0xFFFFF) + "_" + user + "_"
                + timestamp;
        return fUniqueId.replaceAll("[^a-zA-Z0-9_-]", "");
View Full Code Here

TOP

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

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.