当前位置: 首页>>代码示例>>Java>>正文


Java EPackageRegistryImpl类代码示例

本文整理汇总了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;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:25,代码来源:M2DocTemplateEditor.java

示例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();
	}
}
 
开发者ID:arnobl,项目名称:kompren,代码行数:25,代码来源:OCLToXMI.java

示例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();
			}
		}
	}
}
 
开发者ID:awltech,项目名称:eclipse-optimus,代码行数:26,代码来源:GeneratorManager.java

示例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);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:12,代码来源:persistenceResourceFactoryImpl.java

示例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());
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:13,代码来源:XtextPlatformResourceURIHandlerTest.java

示例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();

}
 
开发者ID:DesignAndDeploy,项目名称:dnd,代码行数:46,代码来源:CommandMain.java

示例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;
}
 
开发者ID:markus1978,项目名称:clickwatch,代码行数:30,代码来源:ProjectAnalyzer.java

示例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();
}
 
开发者ID:LangleyStudios,项目名称:eclipse-avro,代码行数:67,代码来源:EcorePlugin.java

示例9: ObservableEPackageRegistryImpl

import org.eclipse.emf.ecore.impl.EPackageRegistryImpl; //导入依赖的package包/类
/**
 * Creates a non-delegating instance.
 */
public ObservableEPackageRegistryImpl() {
	map = new EPackageRegistryImpl();
}
 
开发者ID:abelgomez,项目名称:emf.utils,代码行数:7,代码来源:ObservableEPackageRegistryImpl.java

示例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);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:11,代码来源:persistenceXMLProcessor.java

示例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);
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:12,代码来源:BeansResourceFactoryImpl.java

示例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);
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:11,代码来源:BeansXMLProcessor.java

示例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);
}
 
开发者ID:pedromateo,项目名称:tug_qt_unit_testing_fw,代码行数:11,代码来源:Qt48XmlschemaQwtEnhancedXMLProcessor.java

示例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);
}
 
开发者ID:pedromateo,项目名称:tug_qt_unit_testing_fw,代码行数:12,代码来源:Qt48XmlSchemaResourceFactoryImpl.java


注:本文中的org.eclipse.emf.ecore.impl.EPackageRegistryImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。