Package org.eclipse.emf.common.util

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


    // uri can be platform-specific or not ...
    if (oFileURI.isPlatform()) {
      // leaving out the first ("resource") and the last (the file name)
      StringBuffer sLocalDirectory = new StringBuffer();
      for (int i = 1; i < oFileURI.segmentCount() - 1; ++i) {
        sLocalDirectory.append(oFileURI.segment(i) + "/");
      }

      Configuration.setLocalSourceDirectory(sLocalDirectory.toString());
      Configuration.setWorkspacePath(ResourcesPlugin.getWorkspace()
          .getRoot().getLocation().toString()
View Full Code Here


        sLocalDirectory.append("/");
      } else {
        sLocalDirectory.append(oFileURI.device() + "/");
      }
      for (int i = 0; i < oFileURI.segmentCount() - 1; ++i) {
        sLocalDirectory.append(oFileURI.segment(i) + "/");
      }
      // replace placeholder with empty space
      while (true) {
        int i = sLocalDirectory.indexOf("%20");
        if (i != -1)
View Full Code Here

    URI uri = resource.getURI();

    if (uri.segmentCount() != 3)
      return null;

    return uri.segment(2);
  }

  private static void checkObject(EObject expected, EObject actual, Set<EStructuralFeature> excludeFeatures, Set<EObject> visited)
  {
    if (expected == null)
View Full Code Here

    URI uri = resource.getURI();

    if (uri.segmentCount() != 3)
      return null;

    return uri.segment(2);
  }

  private static void checkObject(EObject expected, EObject actual, Set<EStructuralFeature> excludeFeatures, Set<EObject> visited)
  {
    if (expected == null)
View Full Code Here

  private static final String EXCLUDES = "excludes"; //$NON-NLS-1$

  @Override
public boolean canResolve(IVirtualComponent component, ReferencedComponent referencedComponent) {
    URI uri = referencedComponent.getHandle();
    return uri != null && (uri.segmentCount() > 2) && (uri.segment(0).equals("overlay")); //$NON-NLS-1$
  }

  @Override
public IVirtualReference resolve(IVirtualComponent component, ReferencedComponent referencedComponent) {
  String type = referencedComponent.getHandle().segment(1);
View Full Code Here

      String fontNameSpecification = fontURI.authority();
      if ("".equals(fontNameSpecification))
        fontNameSpecification = null;

      // font height
      String heightSpecification = fontURI.segment(0);
      boolean delta;
      int height;
      if (heightSpecification.startsWith("+")) {
        delta = true;
        height = Integer.parseInt(heightSpecification.substring(1));
View Full Code Here

        height = Integer.parseInt(heightSpecification);
        delta = height < 0;
      }

      // font style
      String styleSpecification = fontURI.segment(1);
      boolean italic = false;
      boolean bold = false;
      if ("bold".equals(styleSpecification))
        bold = true;
      else if ("italic".equals(styleSpecification))
View Full Code Here

  Color colorFromObject(Object object) {
    URI colorURI = toColorURI(object);

    if (colorURI != null) {
      try {
        int red = Integer.parseInt(colorURI.segment(0));
        int green = Integer.parseInt(colorURI.segment(1));
        int blue = Integer.parseInt(colorURI.segment(2));
        return Color.rgb(red, green, blue);
      } catch (NumberFormatException e) {
        throw new IllegalArgumentException("Cannot parse color values " + colorURI + ". " + e.getMessage());
View Full Code Here

    URI colorURI = toColorURI(object);

    if (colorURI != null) {
      try {
        int red = Integer.parseInt(colorURI.segment(0));
        int green = Integer.parseInt(colorURI.segment(1));
        int blue = Integer.parseInt(colorURI.segment(2));
        return Color.rgb(red, green, blue);
      } catch (NumberFormatException e) {
        throw new IllegalArgumentException("Cannot parse color values " + colorURI + ". " + e.getMessage());
      }
View Full Code Here

    if (colorURI != null) {
      try {
        int red = Integer.parseInt(colorURI.segment(0));
        int green = Integer.parseInt(colorURI.segment(1));
        int blue = Integer.parseInt(colorURI.segment(2));
        return Color.rgb(red, green, blue);
      } catch (NumberFormatException e) {
        throw new IllegalArgumentException("Cannot parse color values " + colorURI + ". " + e.getMessage());
      }
    }
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.