Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.URI$URICache


        MapReference ref = null;
        if (!mapReferences.containsKey(map.getID())) {
            // TODO fix this when IProject has a getID() method
            Project project = (Project) map.getProject();
            if (project != null) {
                URI projectURI = project.eResource().getURI();
                ref = new MapReference(map.getID(), projectURI, map.getName());
                mapReferences.put(map.getID(), ref);
            }
        } else {
            ref = mapReferences.get(map.getID());
View Full Code Here


  /**
   * The constructor.
   */
  public Activator() {
    final URI sysMLProfilesURI = URI.createURI(SYSML_PROFILES_PATHMAP);
    sysMLProfileURI = sysMLProfilesURI.appendSegment(SYSML_PROFILE_PATH);
    loadSysMLProfile();

    final URI standardProfilesURI = URI.createURI(STANDARD_PROFILES_PATHMAP);
    standardProfileURI = standardProfilesURI.appendSegment(STANDARD_PROFILE_PATH);
    loadStandardProfile();
  }
View Full Code Here

                }
                DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
                fileDialog.setMessage(Messages.SaveProject_Destination);
                String path = fileDialog.open();

                URI origURI = project.eResource().getURI();
                File file = new File(origURI.toFileString());

                String destinationUdigFolder = path + File.separator + project.getName() + ".udig";
                String destinationProject = destinationUdigFolder + File.separator + file.getName();

                File dest = new File(destinationUdigFolder);
View Full Code Here

  @Override public URIConverter getURIConverter() {
    if (uriConverter == null) {
      uriConverter = new ExtensibleURIConverterImpl() {
        @Override public URI normalize(URI uri) {
          if (isClasspathUri(uri)) {
            URI result = resolveClasspathURI(uri);
            if (isClasspathUri(result)) {
              throw new ClasspathUriResolutionException(result);
            }
            result = super.normalize(result);
            return result;
View Full Code Here

    }
    return segmentMatching(path);
  }

  private IResourceDescription lookup(IPath path) {
    URI uri = URI.createPlatformResourceURI(path.toPortableString(), true);
    return xtextIndex.getResourceDescription(uri);
  }
View Full Code Here

    return xtextIndex.getResourceDescription(uri);
  }

  private IResourceDescription segmentMatching(IPath path) {
    for (IResourceDescription description : xtextIndex.getAllResourceDescriptions()) {
      URI resourceUri = description.getURI();
      if (areReferringToSameFile(path, resourceUri)) {
        return description;
      }
    }
    return null;
View Full Code Here

    for (Import anImport : allImports) {
      if (imports.isImportingDescriptor(anImport)) {
        descriptions.addAll(strategy.inDescriptor(anImport, criteria));
        continue;
      }
      URI resolvedUri = imports.resolvedUriOf(anImport);
      if (resolvedUri == null) {
        continue;
      }
      Resource imported = resourceSets.findResource(resourceSet, resolvedUri);
      if (imported == null) {
View Full Code Here

  @Singleton private static class ProtobufsStub extends Protobufs {
    String nonProto2FileName;

    @Override public boolean isProto2(Protobuf protobuf) {
      URI resourceUri = protobuf.eResource().getURI();
      if (resourceUri.toString().endsWith(nonProto2FileName)) {
        return false;
      }
      return super.isProto2(protobuf);
    }
View Full Code Here

  @Override public void run(IAction action) {
    if (editor == null) {
      return;
    }
    URI foundUri = uriFinder.findProtobufElementLocationFromSelectionOf(editor);
    if (foundUri != null) {
      editorOpener.open(foundUri, true);
    }
  }
View Full Code Here

  // syntax = "proto2";
  //
  // message Person {}
  @Test public void should_return_uri_of_model_object() {
    Message message = xtext.find("Person", Message.class);
    URI expected = xtext.resource().getURI();
    expected = expected.appendFragment(xtext.resource().getURIFragment(message));
    assertThat(objects.uriOf(message), equalTo(expected));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.URI$URICache

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.