org.eclipse.emf.ecore.impl.EPackageRegistryImpl Java Examples

The following examples show how to use org.eclipse.emf.ecore.impl.EPackageRegistryImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: M2DocTypeSelectionDialog.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Gets the {@link List} of available types for the given {@link List} of regitered {@link EPackage#getNsURI() nsURI}.
 * 
 * @param uris
 *            the {@link List} of regitered {@link EPackage#getNsURI() nsURI}
 * @return the {@link List} of available types for the given {@link List} of regitered {@link EPackage#getNsURI() nsURI}
 */
List<String> getAvailableTypes(List<String> uris) {
    final Set<String> types = new HashSet<>();

    types.add(TemplateCustomProperties.STRING_TYPE);
    types.add(TemplateCustomProperties.INTEGER_TYPE);
    types.add(TemplateCustomProperties.REAL_TYPE);
    types.add(TemplateCustomProperties.BOOLEAN_TYPE);

    types.addAll(getEClassifiers(EcorePackage.eINSTANCE));
    if (uris != null) {
        for (String nsURI : uris) {
            final EPackage ePkg = EPackageRegistryImpl.INSTANCE.getEPackage(nsURI);
            if (ePkg != null) {
                types.addAll(getEClassifiers(ePkg));
            }
        }
    }

    final List<String> res = new ArrayList<>(types.size() * 3);
    for (String type : types) {
        res.add(type);
        res.add("Sequence(" + type + ")");
        res.add("OrderedSet(" + type + ")");
    }
    Collections.sort(res);

    return res;
}
 
Example #2
Source File: XtextPlatformResourceURIHandlerTest.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Test
public void testDontDeresolvePackageNamesEvenThoughTheyLookLikeRelativeURIs() {
	EPackageRegistryImpl registry = new EPackageRegistryImpl(uriHandler.getResourceSet().getPackageRegistry());
	uriHandler.getResourceSet().setPackageRegistry(registry);
	registry.put("foo.bar", EcorePackage.eINSTANCE);

	uriHandler.setBaseURI(URI.createURI("platform:/resource/org.eclipse.xtext/src/org/eclipse/xtext/Xtext.ecore"));
	assertEquals("foo.bar", uriHandler.resolve(URI.createURI("foo.bar")).toString());
	assertEquals("/foo.bar", uriHandler.resolve(URI.createURI("/foo.bar")).toString());
	assertEquals("foo.bar#/baz", uriHandler.resolve(URI.createURI("foo.bar#/baz")).toString());
	assertEquals("/foo.bar#/baz", uriHandler.resolve(URI.createURI("/foo.bar#/baz")).toString());
}
 
Example #3
Source File: BeansResourceFactoryImpl.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 2 votes vote down vote up
/**
 * Creates an instance of the resource factory.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public BeansResourceFactoryImpl() {
	super();
	extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
	extendedMetaData.putPackage(null, BeansPackage.eINSTANCE);
}
 
Example #4
Source File: BeansXMLProcessor.java    From hybris-commerce-eclipse-plugin with Apache License 2.0 2 votes vote down vote up
/**
 * Public constructor to instantiate the helper.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public BeansXMLProcessor() {
	super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
	extendedMetaData.putPackage(null, BeansPackage.eINSTANCE);
}
 
Example #5
Source File: jpdl32XMLProcessor.java    From bonita-studio with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Public constructor to instantiate the helper.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public jpdl32XMLProcessor() {
	super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
	extendedMetaData.putPackage(null, jpdl32Package.eINSTANCE);
}
 
Example #6
Source File: jpdl32ResourceFactoryImpl.java    From bonita-studio with GNU General Public License v2.0 2 votes vote down vote up
/**
 * Creates an instance of the resource factory.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public jpdl32ResourceFactoryImpl() {
	super();
	extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE));
	extendedMetaData.putPackage(null, jpdl32Package.eINSTANCE);
}