Package org.eclipse.emf.common.util

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


  String cssColorFromObject(Object object) {
    URI colorURI = toColorURI(object);

    if (colorURI != null)
      return "rgb(" + colorURI.segment(0) + ", " + colorURI.segment(1) + ", " + colorURI.segment(2) + ")";

    return null;
  }

  URI toColorURI(Object object) {
View Full Code Here


  String cssColorFromObject(Object object) {
    URI colorURI = toColorURI(object);

    if (colorURI != null)
      return "rgb(" + colorURI.segment(0) + ", " + colorURI.segment(1) + ", " + colorURI.segment(2) + ")";

    return null;
  }

  URI toColorURI(Object object) {
View Full Code Here

  String cssColorFromObject(Object object) {
    URI colorURI = toColorURI(object);

    if (colorURI != null)
      return "rgb(" + colorURI.segment(0) + ", " + colorURI.segment(1) + ", " + colorURI.segment(2) + ")";

    return null;
  }

  URI toColorURI(Object object) {
View Full Code Here

    URI uri = URI.createURI(file.getExecutionURI());
   
    if( "bundleclass".equals(uri.scheme()) ) {
      Bundle b = Platform.getBundle(uri.host());
      try {
        Class<?> cl = b.loadClass(uri.segment(0));
        Generator<DynamicFile> g = (Generator<DynamicFile>) cl.newInstance();
        return g.generate(file, data);
      } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

      public List<URL> exec(XtextResource resource) throws Exception {
        List<URL> extraPaths = new ArrayList<URL>();
        EList<EObject> contents = resource.getContents();
        if (!contents.isEmpty()) {
          URI uri = resource.getURI();
          IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(uri.segment(1));
          IJavaProject jp = JavaCore.create(p);
          EObject rootObject = contents.get(0);
          if (rootObject instanceof Model) {
            ComponentDefinition def = ((Model) rootObject).getComponentDef();
           
View Full Code Here

      URI uri = URI.createURI(decorationFXML);

      if (uri != null) {
        stage.initStyle(StageStyle.UNDECORATED);

        Bundle b = org.eclipse.core.runtime.Platform.getBundle(uri.segment(1));
        if (b != null) {
          try {
            StringBuilder sb = new StringBuilder();
            for (int i = 2; i < uri.segmentCount(); i++) {
              if (sb.length() != 0) {
View Full Code Here

            StringBuilder sb = new StringBuilder();
            for (int i = 2; i < uri.segmentCount(); i++) {
              if (sb.length() != 0) {
                sb.append("/");
              }
              sb.append(uri.segment(i));
            }
           
            InjectingFXMLLoader<Node> loader = InjectingFXMLLoader.create(context, b, sb.toString());
            loader.resourceBundle(localizationService.getLocalization(b, Locale.getDefault().toString()));
           
View Full Code Here

  public void validateModel(Model model) {
    if( model.getPackage() == null ) {
      warning("You should add a package declaration to use a namespace", FXGraphPackage.Literals.MODEL__PACKAGE);
    } else {
      URI uri = model.eResource().getURI();
      IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(uri.segment(1));
     
      IPath path = null;
      for( int i = 2; i < uri.segmentCount() - 1; i++ ) {
        if( path == null ) {
          path = new Path(uri.segment(i));
View Full Code Here

      IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(uri.segment(1));
     
      IPath path = null;
      for( int i = 2; i < uri.segmentCount() - 1; i++ ) {
        if( path == null ) {
          path = new Path(uri.segment(i));
        } else {
          path = path.append(uri.segment(i));
        }
      }
     
View Full Code Here

      IPath path = null;
      for( int i = 2; i < uri.segmentCount() - 1; i++ ) {
        if( path == null ) {
          path = new Path(uri.segment(i));
        } else {
          path = path.append(uri.segment(i));
        }
      }
     
      IJavaElement e = JavaCore.create(p.getFolder(path));
      if( e instanceof IPackageFragment ) {
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.