Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.URI.segments()


  // message Person {}
  @Test public void should_find_resource_matching_segments_if_URIs_are_not_exact_match() {
    XtextResource resource = xtext.resource();
    addToXtextIndex(resource);
    URI resourceUri = resource.getURI();
    String[] segments = resourceUri.segments();
    int segmentCount = segments.length;
    String path = segments[segmentCount - 2] + "/" + segments[segmentCount - 1]; // last two segments.
    IResourceDescription description = lookup.resourceIn(Path.fromOSString(path));
    assertThat(description.getURI(), equalTo(resourceUri));
  }
View Full Code Here


       
        if (type2 != null && type2.eIsProxy())
        {
            URI proxyURI = type2.eProxyURI();

            String fullModelName = proxyURI.segments()[proxyURI.segmentCount()-1];
            modelName = fullModelName.substring( 0, fullModelName.lastIndexOf( '.' ) );
           
        }

        return modelName;
View Full Code Here

       
        if (type2 != null && type2.eIsProxy())
        {
            URI proxyURI = type2.eProxyURI();

            String fullModelName = proxyURI.segments()[proxyURI.segmentCount()-1];
            modelName = fullModelName.substring( 0, fullModelName.lastIndexOf( '.' ) );
           
        }

        return modelName;
View Full Code Here

       
        if (type2 != null && type2.eIsProxy())
        {
            URI proxyURI = type2.eProxyURI();

            String fullModelName = proxyURI.segments()[proxyURI.segmentCount()-1];
            modelName = fullModelName.substring( 0, fullModelName.lastIndexOf( '.' ) );
           
        }

        return modelName;
View Full Code Here

  private static HashMap<URI, ModelHandler> map = new HashMap<URI, ModelHandler>();
  private static HashMap<URI, ModelHandler> diagramMap = new HashMap<URI, ModelHandler>();

  public static ModelHandler getModelHandler(Resource eResource) throws IOException {
    URI uri = eResource.getURI();
    String[] segments = uri.segments();

    return getModelHandler(uri);
  }

  public static ModelHandler getModelHandler(URI path) throws IOException {
View Full Code Here

      // set Authority to host and port of the service
      final java.net.URI location = anIServiceInfo.getLocation();
      final String authority = location.getAuthority();
      uri = URI.createHierarchicalURI(uri.scheme(), authority,
          uri.device(), uri.segments(), location.getQuery(),
          location.getFragment());

      return uri;
    }
View Full Code Here

      IWorkspaceRoot root = _workspace.getRoot();
      String _segment = uri.segment(1);
      IProject project = root.getProject(_segment);
      String projectRelativePath = "";
      int i = 0;
      String[] _segments = uri.segments();
      for (final String seg : _segments) {
        {
          boolean _greaterEqualsThan = (i >= 1);
          if (_greaterEqualsThan) {
            String _plus = (projectRelativePath + "/");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.