/** * Returns a resolved resource available outside of the resource set. * It is called by {@link #getResource(URI, boolean) getResource(URI, boolean)} * after it has determined that the URI cannot be resolved * based on the existing contents of the resource set. * This implementation looks up the URI in the {#getPackageRegistry() local} package registry. * Clients may extend this as appropriate. * @param uri the URI * @param loadOnDemand whether demand loading is required. */ protected Resource delegatedGetResource(URI uri, boolean loadOnDemand) { EPackage ePackage = getPackageRegistry().getEPackage(uri.toString()); return ePackage == null ? null : ePackage.eResource(); }
@PostConstruct void init() { resourceSetImpl = new ResourceSetImpl(); resourceSetImpl.getResourceFactoryRegistry().getExtensionToFactoryMap() .put(Resource.Factory.Registry.DEFAULT_EXTENSION, new E4XMIResourceFactory()); resourceSetImpl.getPackageRegistry().put(ApplicationPackageImpl.eNS_URI, ApplicationPackageImpl.eINSTANCE); resourceSetImpl.getPackageRegistry().put(CommandsPackageImpl.eNS_URI, CommandsPackageImpl.eINSTANCE); resourceSetImpl.getPackageRegistry().put(UiPackageImpl.eNS_URI, UiPackageImpl.eINSTANCE); resourceSetImpl.getPackageRegistry() .put(MenuPackageImpl.eNS_URI, MenuPackageImpl.eINSTANCE); resourceSetImpl.getPackageRegistry().put(BasicPackageImpl.eNS_URI, BasicPackageImpl.eINSTANCE); resourceSetImpl.getPackageRegistry().put(AdvancedPackageImpl.eNS_URI, AdvancedPackageImpl.eINSTANCE); resourceSetImpl .getPackageRegistry() .put(org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicPackageImpl.eNS_URI, org.eclipse.e4.ui.model.application.descriptor.basic.impl.BasicPackageImpl.eINSTANCE); }
/** * Returns a resolved resource available outside of the resource set. * It is called by {@link #getResource(URI, boolean) getResource(URI, boolean)} * after it has determined that the URI cannot be resolved * based on the existing contents of the resource set. * This implementation looks up the URI in the {#getPackageRegistry() local} package registry. * Clients may extend this as appropriate. * @param uri the URI * @param loadOnDemand whether demand loading is required. */ protected Resource delegatedGetResource(URI uri, boolean loadOnDemand) { EPackage ePackage = getPackageRegistry().getEPackage(uri.toString()); return ePackage == null ? null : ePackage.eResource(); }