Skip to content

nloke/emfjson-gwt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GWT version of emfjson meant to be use on the client side of a GWT application.

Maven repository

<repository>
  <id>emfgwt-repository</id>
	<url>http://repository-ghillairet.forge.cloudbees.com/snapshot</url>
	<snapshots>
		<enabled>true</enabled>
		<updatePolicy>always</updatePolicy>
	</snapshots>
</repository>

<dependency>
	<groupId>org.eclipselabs</groupId>
	<artifactId>org.eclipselabs.emfjson.gwt</artifactId>
	<version>0.5.2-SNAPSHOT</version>
</dependency>

Getting started

Initialize a ResourceSet

import org.eclipselabs.emfjson.gwt.resource.JsResourceImpl;
import org.eclipse.emf.ecore.resource.URIService;
import org.eclipse.emf.ecore.resource.URIServiceAsync;
import org.eclipse.emf.ecore.resource.URIServiceCallback;

...

final URIServiceAsync modelService = GWT.create(URIService.class);
final URIServiceCallback modelCallback = new URIServiceCallback(modelService);
    
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new ResourceFactoryImpl(){
  @Override
  public Resource createResource(URI uri) {
    return new JsResourceImpl(uri);
  }
});

resourceSet.getURIConverter().getURIHandlers().add(modelCallback);

Create a Resource

Resource resource = resourceSet.createResource(URI.createURI("uriService/model.json"));

About

EMFJSON GWT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published