@Override protected CellEditor getCellEditor(Object element) { List<String> availableTypes = new ArrayList<>(); availableTypes.add(TemplateCustomProperties.STRING_TYPE); availableTypes.add(TemplateCustomProperties.INTEGER_TYPE); availableTypes.add(TemplateCustomProperties.REAL_TYPE); availableTypes.add(TemplateCustomProperties.BOOLEAN_TYPE); final List<String> availiablesTypes = new ArrayList<>(); availableTypes.addAll(getEClassifiers(EcorePackage.eINSTANCE)); if (templateCustomProperties != null) { for (String nsURI : templateCustomProperties.getPackagesURIs()) { final EPackage ePkg = EPackageRegistryImpl.INSTANCE.getEPackage(nsURI); availableTypes.addAll(getEClassifiers(ePkg)); } } Collections.sort(availiablesTypes); availableTypes.addAll(availiablesTypes); editor.setInput(availableTypes); return editor; }
public static void main(String[] args) { try { EPackage.Registry registry = new EPackageRegistryImpl(); registry.put(LRBACPackage.eNS_URI, LRBACPackage.eINSTANCE); EcoreEnvironmentFactory environmentFactory = new EcoreEnvironmentFactory(registry); OCL ocl = OCL.newInstance(environmentFactory); URL url = new URL("file:/media/data/dev/k3/k3Projects/fr.inria.triskell.kompren.oclSlicer/fr.inria.triskell.kompren.oclSlicer/src/main/resources/models/PaperCst.ocl"); InputStream in = url.openConnection().getInputStream(); try { OCLInput document = new OCLInput(in); ResourceSet resSet = new ResourceSetImpl(); resSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); Resource res = resSet.createResource(URI.createURI("out.xmi")); res.getContents().addAll(ocl.parse(document)); res.save(Collections.emptyMap()); res.unload(); } finally { in.close(); } } catch (Exception e) { e.printStackTrace(); } }
/** * Load the Extension point */ private void loadExtensions() { IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(Activator.PLUGIN_ID, "Generators"); for (IExtension extension : extensionPoint.getExtensions()) { for (IConfigurationElement configurationElement : extension.getConfigurationElements()) { try { if ("generator".equals(configurationElement.getName())) { String nameSpace = configurationElement.getAttribute("namespace"); String eClassName = configurationElement.getAttribute("eclass"); IGenerator lts = (IGenerator) configurationElement.createExecutableExtension("generator"); EPackage ePackage = EPackageRegistryImpl.INSTANCE.getEPackage(nameSpace); EClassifier eClassifier = ePackage.getEClassifier(eClassName); if (eClassifier instanceof EClass) { this.generatorsMap.put((EClass) eClassifier, lts); } } } catch (CoreException ce) { ce.printStackTrace(); } } } }
/** * Creates an instance of the resource factory. <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ public persistenceResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, persistencePackage.eINSTANCE); }
@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()); }
/** * The main method. * * @param args * Arguments for the command line program. Must contain addresses for announce, multicast and listen, a * classpath for a .blocks file and either --create or --deploy to determine whether to only create or * also deploy a distribution. */ public static void main(String args[]) { InternalLoggerFactory.setDefaultFactory(new Log4j2LoggerFactory()); if (args.length > 0) { LOGGER.debug("argument 0 is \"{}\"", args[0]); if (args[0].equals("--help") || args[0].equals("-h")) { System.out.println("Parameters: [--help| $pathToConfig]"); System.out.println("\t--help: print this message"); System.out.println("\t$pathToConfig the path to the used config file."); System.exit(0); } else { parseArguments(args); } } else { exitFalseInput(); } ResourceSet newSet = new ResourceSetImpl(); newSet.setPackageRegistry(new EPackageRegistryImpl()); newSet.getPackageRegistry().put(ModelPackage.eNS_URI, ModelPackage.eINSTANCE); FunctionBlockLoader blockLoader = new FunctionBlockLoader(path); blockLoader.loadBlocks(); functionBlocks = blockLoader.getBlocks(); serverManager = new TCPUDPServerManager(); serverManager.startServer(new SimpleAddressBasedServerConfig(moduleID, Collections.singletonList(listen), Collections.singletonList(multicast), Collections.singletonList(announce), announceInterval)); ModuleRegistrator moduleRegistrator = new ModuleRegistrator(); serverManager.getModuleManager().addListener(moduleRegistrator); CommandLoop loop = new CommandLoop(functionBlocks, blockLoader.getApplicationName(), serverManager); loop.loop(createOrDeploy); exit(); }
@Override protected IStatus run(final IProgressMonitor monitor) { if (EmfToolsPlugin.trace) { System.out.println(Messages.ProjectAnalyzer_1 + project.getProject().getProject().getName()); } // load models rs = ConverterUtil.createResourceSet(); mapping = new HashMap<IStorage, Resource>(); // TODO: ensure that the packages map contains the ePackages from reexported projects as well packages = new HashMap<String, EPackage>(); loadMetamodelsForProject(project, rs, monitor); // always add ecore packages.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE); EPackage.Registry registry = new EPackageRegistryImpl(rs.getPackageRegistry()); registry.putAll(packages); rs.setPackageRegistry(registry); // done. now trigger build for the project. // only do this if it is an Xpand project // do not build referencing projects. the EmfToolsPlugin will take care // of this if (Activator.getExtXptModelManager().findProject(project.getProject()) != null) { new BuildJob(project.getProject(), null).schedule(); } return Status.OK_STATUS; }
/** * Read all the registered extensions for Ecore's extension points. */ private static void internalProcessExtensions() { new RegistryReader (RegistryFactory.getRegistry(), EcorePlugin.INSTANCE.getSymbolicName(), PACKAGE_REGISTRY_IMPLEMENTATION_PPID) { IConfigurationElement previous; @Override protected boolean readElement(IConfigurationElement element) { if (element.getName().equals("registry")) { String implementationClass = element.getAttribute("class"); if (implementationClass == null) { logMissingAttribute(element, "class"); } else { if (defaultRegistryImplementation != null) { if (previous != null) { INSTANCE.log("Both '" + previous.getContributor().getName() + "' and '" + element.getContributor().getName() + "' register a package registry implementation"); } if (defaultRegistryImplementation instanceof EPackageRegistryImpl.Delegator) { return false; } } try { defaultRegistryImplementation = (EPackage.Registry)element.createExecutableExtension("class"); previous = element; } catch (CoreException exception) { INSTANCE.log(exception); } return true; } } return false; } }.readRegistry(); new GeneratedPackageRegistryReader(getEPackageNsURIToGenModelLocationMap(false)).readRegistry(); new DynamicPackageRegistryReader().readRegistry(); new FactoryOverrideRegistryReader().readRegistry(); new ExtensionParserRegistryReader().readRegistry(); new ProtocolParserRegistryReader().readRegistry(); new ContentParserRegistryReader().readRegistry(); new ContentHandlerRegistryReader().readRegistry(); new URIMappingRegistryReader().readRegistry(); new ValidationDelegateRegistryReader().readRegistry(); new SettingDelegateFactoryRegistryReader().readRegistry(); new InvocationDelegateFactoryRegistryReader().readRegistry(); new QueryDelegateFactoryRegistryReader().readRegistry(); new ConversionDelegateFactoryRegistryReader().readRegistry(); }
/** * Creates a non-delegating instance. */ public ObservableEPackageRegistryImpl() { map = new EPackageRegistryImpl(); }
/** * Creates a delegating instance. */ public ObservableEPackageRegistryImpl(EPackage.Registry delegateRegistry) { map = new EPackageRegistryImpl(delegateRegistry); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public persistenceXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, persistencePackage.eINSTANCE); }
/** * 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); }
/** * 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); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Qt48XmlschemaQwtEnhancedXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, Qt48XmlschemaQwtEnhancedPackage.eINSTANCE); }
/** * Creates an instance of the resource factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Qt48XmlschemaQwtEnhancedResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, Qt48XmlschemaQwtEnhancedPackage.eINSTANCE); }
/** * Creates an instance of the resource factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Qt48XmlSchemaResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, Qt48XmlSchemaPackage.eINSTANCE); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Qt48XmlSchemaXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, Qt48XmlSchemaPackage.eINSTANCE); }
/** * Creates an instance of the resource factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Qt48XmlschemaResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, Qt48XmlschemaPackage.eINSTANCE); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Qt48XmlschemaXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, Qt48XmlschemaPackage.eINSTANCE); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EsmConfigXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, EsmConfigPackage.eINSTANCE); }
/** * Creates an instance of the resource factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EsmConfigResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, EsmConfigPackage.eINSTANCE); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NupnXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, NupnPackage.eINSTANCE); }
/** * Creates an instance of the resource factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public NupnResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, NupnPackage.eINSTANCE); }
/** * Creates an instance of the resource factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public CatalogResourceFactoryImpl() { super(); extendedMetaData = new BasicExtendedMetaData(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, CatalogPackage.eINSTANCE); }
/** * Public constructor to instantiate the helper. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public CatalogXMLProcessor() { super(new EPackageRegistryImpl(EPackage.Registry.INSTANCE)); extendedMetaData.putPackage(null, CatalogPackage.eINSTANCE); }