本文整理汇总了Java中org.eclipse.emf.ecore.impl.EPackageRegistryImpl类的典型用法代码示例。如果您正苦于以下问题:Java EPackageRegistryImpl类的具体用法?Java EPackageRegistryImpl怎么用?Java EPackageRegistryImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EPackageRegistryImpl类属于org.eclipse.emf.ecore.impl包,在下文中一共展示了EPackageRegistryImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCellEditor
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
@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;
}
示例2: main
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
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();
}
}
示例3: loadExtensions
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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();
}
}
}
}
示例4: persistenceResourceFactoryImpl
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}
示例5: testDontDeresolvePackageNamesEvenThoughTheyLookLikeRelativeURIs
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
@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());
}
示例6: main
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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();
}
示例7: run
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
@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;
}
示例8: internalProcessExtensions
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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();
}
示例9: ObservableEPackageRegistryImpl
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* Creates a non-delegating instance.
*/
public ObservableEPackageRegistryImpl() {
map = new EPackageRegistryImpl();
}
示例10: persistenceXMLProcessor
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}
示例11: BeansResourceFactoryImpl
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}
示例12: BeansXMLProcessor
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}
示例13: Qt48XmlschemaQwtEnhancedXMLProcessor
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}
示例14: Qt48XmlschemaQwtEnhancedResourceFactoryImpl
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}
开发者ID:pedromateo,项目名称:tug_qt_unit_testing_fw,代码行数:12,代码来源:Qt48XmlschemaQwtEnhancedResourceFactoryImpl.java
示例15: Qt48XmlSchemaResourceFactoryImpl
import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
* 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);
}