• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java XImportSection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.xtext.xtype.XImportSection的典型用法代码示例。如果您正苦于以下问题:Java XImportSection类的具体用法?Java XImportSection怎么用?Java XImportSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XImportSection类属于org.eclipse.xtext.xtype包,在下文中一共展示了XImportSection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setImportSection

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setImportSection(XImportSection newImportSection)
{
  if (newImportSection != importSection)
  {
    NotificationChain msgs = null;
    if (importSection != null)
      msgs = ((InternalEObject)importSection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PureXbasePackage.MODEL__IMPORT_SECTION, null, msgs);
    if (newImportSection != null)
      msgs = ((InternalEObject)newImportSection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PureXbasePackage.MODEL__IMPORT_SECTION, null, msgs);
    msgs = basicSetImportSection(newImportSection, msgs);
    if (msgs != null) msgs.dispatch();
  }
  else if (eNotificationRequired())
    eNotify(new ENotificationImpl(this, Notification.SET, PureXbasePackage.MODEL__IMPORT_SECTION, newImportSection, newImportSection));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:ModelImpl.java


示例2: checkConflicts

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
protected void checkConflicts(XImportSection importSection, final Map<String, List<XImportDeclaration>> imports,
		final Map<String, JvmType> importedNames) {
	for (JvmDeclaredType declaredType : importsConfiguration.getLocallyDefinedTypes((XtextResource)importSection.eResource())) {
		if(importedNames.containsKey(declaredType.getSimpleName())){
			JvmType importedType = importedNames.get(declaredType.getSimpleName());
			if (importedType != declaredType  && importedType.eResource() != importSection.eResource()) {
				List<XImportDeclaration> list = imports.get(importedType.getIdentifier());
				if (list != null) {
					for (XImportDeclaration importDeclaration: list ) {
						error("The import '" 
								+ importedType.getIdentifier() 
								+ "' conflicts with a type defined in the same file", 
								importDeclaration, null, IssueCodes.IMPORT_CONFLICT);
					}
				}
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:XbaseValidator.java


示例3: RewritableImportSection

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
public RewritableImportSection(XtextResource resource, IImportsConfiguration importsConfiguration, XImportSection originalImportSection,
		String lineSeparator, ImportSectionRegionUtil regionUtil, IValueConverter<String> nameConverter) {
	this.importsConfiguration = importsConfiguration;
	this.resource = resource;
	this.lineSeparator = lineSeparator;
	this.regionUtil = regionUtil;
	this.nameValueConverter = nameConverter;
	this.implicitlyImportedPackages = importsConfiguration.getImplicitlyImportedPackages(resource);
	this.importRegion = regionUtil.computeRegion(resource);
	if (originalImportSection != null) {
		for (XImportDeclaration originalImportDeclaration : originalImportSection.getImportDeclarations()) {
			this.originalImportDeclarations.add(originalImportDeclaration);
			JvmDeclaredType importedType = originalImportDeclaration.getImportedType();
			if (originalImportDeclaration.isStatic()) {
				String memberName = originalImportDeclaration.getMemberName();
				if (originalImportDeclaration.isExtension()) {
					Maps2.putIntoSetMap(importedType, memberName, staticExtensionImports);
				} else {
					Maps2.putIntoSetMap(importedType, memberName, staticImports);
				}
			} else if (importedType != null) {
				Maps2.putIntoListMap(importedType.getSimpleName(), importedType, plainImports);
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:27,代码来源:RewritableImportSection.java


示例4: update

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
public void update() {
	XImportSection importSection = importsConfiguration.getImportSection(resource);
	if (importSection == null && importsConfiguration instanceof IMutableImportsConfiguration) {
		importSection = XtypeFactory.eINSTANCE.createXImportSection();

		IMutableImportsConfiguration mutableImportsConfiguration = (IMutableImportsConfiguration) importsConfiguration;
		mutableImportsConfiguration.setImportSection(resource, importSection);
	}
	if (importSection == null) {
		return;
	}
	removeObsoleteStaticImports();

	List<XImportDeclaration> allImportDeclarations = newArrayList();
	allImportDeclarations.addAll(originalImportDeclarations);
	allImportDeclarations.addAll(addedImportDeclarations);
	allImportDeclarations.removeAll(removedImportDeclarations);

	List<XImportDeclaration> importDeclarations = importSection.getImportDeclarations();
	importDeclarations.clear();
	importDeclarations.addAll(allImportDeclarations);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:23,代码来源:RewritableImportSection.java


示例5: setImportSection

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setImportSection(XImportSection newImportSection)
{
  if (newImportSection != importSection)
  {
    NotificationChain msgs = null;
    if (importSection != null)
      msgs = ((InternalEObject)importSection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XImportSectionTestLangPackage.IMPORT_SECTION_TEST_LANGUAGE_ROOT__IMPORT_SECTION, null, msgs);
    if (newImportSection != null)
      msgs = ((InternalEObject)newImportSection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XImportSectionTestLangPackage.IMPORT_SECTION_TEST_LANGUAGE_ROOT__IMPORT_SECTION, null, msgs);
    msgs = basicSetImportSection(newImportSection, msgs);
    if (msgs != null) msgs.dispatch();
  }
  else if (eNotificationRequired())
    eNotify(new ENotificationImpl(this, Notification.SET, XImportSectionTestLangPackage.IMPORT_SECTION_TEST_LANGUAGE_ROOT__IMPORT_SECTION, newImportSection, newImportSection));
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:21,代码来源:ImportSectionTestLanguageRootImpl.java


示例6: setImports

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setImports(XImportSection newImports)
{
	if (newImports != imports)
	{
		NotificationChain msgs = null;
		if (imports != null)
			msgs = ((InternalEObject)imports).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CheckPackage.CHECK_CATALOG__IMPORTS, null, msgs);
		if (newImports != null)
			msgs = ((InternalEObject)newImports).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CheckPackage.CHECK_CATALOG__IMPORTS, null, msgs);
		msgs = basicSetImports(newImports, msgs);
		if (msgs != null) msgs.dispatch();
	}
	else if (eNotificationRequired())
		eNotify(new ENotificationImpl(this, Notification.SET, CheckPackage.CHECK_CATALOG__IMPORTS, newImports, newImports));
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:CheckCatalogImpl.java


示例7: eSet

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
	switch (featureID) {
		case MelangePackage.MODEL_TYPING_SPACE__ELEMENTS:
			getElements().clear();
			getElements().addAll((Collection<? extends Element>)newValue);
			return;
		case MelangePackage.MODEL_TYPING_SPACE__IMPORTS:
			setImports((XImportSection)newValue);
			return;
		case MelangePackage.MODEL_TYPING_SPACE__NAME:
			setName((String)newValue);
			return;
	}
	super.eSet(featureID, newValue);
}
 
开发者ID:diverse-project,项目名称:melange,代码行数:23,代码来源:ModelTypingSpaceImpl.java


示例8: eUnset

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eUnset(int featureID) {
	switch (featureID) {
		case MelangePackage.MODEL_TYPING_SPACE__ELEMENTS:
			getElements().clear();
			return;
		case MelangePackage.MODEL_TYPING_SPACE__IMPORTS:
			setImports((XImportSection)null);
			return;
		case MelangePackage.MODEL_TYPING_SPACE__NAME:
			setName(NAME_EDEFAULT);
			return;
	}
	super.eUnset(featureID);
}
 
开发者ID:diverse-project,项目名称:melange,代码行数:21,代码来源:ModelTypingSpaceImpl.java


示例9: setImports

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setImports(XImportSection newImports)
{
  if (newImports != imports)
  {
    NotificationChain msgs = null;
    if (imports != null)
      msgs = ((InternalEObject)imports).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XRobotDSLPackage.PROGRAM__IMPORTS, null, msgs);
    if (newImports != null)
      msgs = ((InternalEObject)newImports).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XRobotDSLPackage.PROGRAM__IMPORTS, null, msgs);
    msgs = basicSetImports(newImports, msgs);
    if (msgs != null) msgs.dispatch();
  }
  else if (eNotificationRequired())
    eNotify(new ENotificationImpl(this, Notification.SET, XRobotDSLPackage.PROGRAM__IMPORTS, newImports, newImports));
}
 
开发者ID:JanKoehnlein,项目名称:XRobot,代码行数:21,代码来源:ProgramImpl.java


示例10: setImportSection

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setImportSection(XImportSection newImportSection)
{
  if (newImportSection != importSection)
  {
    NotificationChain msgs = null;
    if (importSection != null)
      msgs = ((InternalEObject)importSection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - BuildPackage.BUILD_FILE__IMPORT_SECTION, null, msgs);
    if (newImportSection != null)
      msgs = ((InternalEObject)newImportSection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - BuildPackage.BUILD_FILE__IMPORT_SECTION, null, msgs);
    msgs = basicSetImportSection(newImportSection, msgs);
    if (msgs != null) msgs.dispatch();
  }
  else if (eNotificationRequired())
    eNotify(new ENotificationImpl(this, Notification.SET, BuildPackage.BUILD_FILE__IMPORT_SECTION, newImportSection, newImportSection));
}
 
开发者ID:oehme,项目名称:xtext-maven-example,代码行数:21,代码来源:BuildFileImpl.java


示例11: eSet

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
  switch (featureID)
  {
    case BuildPackage.BUILD_FILE__NAME:
      setName((String)newValue);
      return;
    case BuildPackage.BUILD_FILE__IMPORT_SECTION:
      setImportSection((XImportSection)newValue);
      return;
    case BuildPackage.BUILD_FILE__DECLARATIONS:
      getDeclarations().clear();
      getDeclarations().addAll((Collection<? extends Declaration>)newValue);
      return;
  }
  super.eSet(featureID, newValue);
}
 
开发者ID:oehme,项目名称:xtext-maven-example,代码行数:25,代码来源:BuildFileImpl.java


示例12: eUnset

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eUnset(int featureID)
{
  switch (featureID)
  {
    case BuildPackage.BUILD_FILE__NAME:
      setName(NAME_EDEFAULT);
      return;
    case BuildPackage.BUILD_FILE__IMPORT_SECTION:
      setImportSection((XImportSection)null);
      return;
    case BuildPackage.BUILD_FILE__DECLARATIONS:
      getDeclarations().clear();
      return;
  }
  super.eUnset(featureID);
}
 
开发者ID:oehme,项目名称:xtext-maven-example,代码行数:23,代码来源:BuildFileImpl.java


示例13: setImportSection

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setImportSection(XImportSection newImportSection)
{
  if (newImportSection != importSection)
  {
    NotificationChain msgs = null;
    if (importSection != null)
      msgs = ((InternalEObject)importSection).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EntitiesPackage.MODEL__IMPORT_SECTION, null, msgs);
    if (newImportSection != null)
      msgs = ((InternalEObject)newImportSection).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EntitiesPackage.MODEL__IMPORT_SECTION, null, msgs);
    msgs = basicSetImportSection(newImportSection, msgs);
    if (msgs != null) msgs.dispatch();
  }
  else if (eNotificationRequired())
    eNotify(new ENotificationImpl(this, Notification.SET, EntitiesPackage.MODEL__IMPORT_SECTION, newImportSection, newImportSection));
}
 
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:21,代码来源:ModelImpl.java


示例14: eSet

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue)
{
  switch (featureID)
  {
    case EntitiesPackage.MODEL__IMPORT_SECTION:
      setImportSection((XImportSection)newValue);
      return;
    case EntitiesPackage.MODEL__ENTITIES:
      getEntities().clear();
      getEntities().addAll((Collection<? extends Entity>)newValue);
      return;
  }
  super.eSet(featureID, newValue);
}
 
开发者ID:LorenzoBettini,项目名称:packtpub-xtext-book-examples,代码行数:22,代码来源:ModelImpl.java


示例15: basicSetImportSection

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetImportSection(XImportSection newImportSection, NotificationChain msgs)
{
  XImportSection oldImportSection = importSection;
  importSection = newImportSection;
  if (eNotificationRequired())
  {
    ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PureXbasePackage.MODEL__IMPORT_SECTION, oldImportSection, newImportSection);
    if (msgs == null) msgs = notification; else msgs.add(notification);
  }
  return msgs;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:17,代码来源:ModelImpl.java


示例16: eSet

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eSet(int featureID, Object newValue)
{
  switch (featureID)
  {
    case PureXbasePackage.MODEL__IMPORT_SECTION:
      setImportSection((XImportSection)newValue);
      return;
    case PureXbasePackage.MODEL__BLOCK:
      setBlock((XBlockExpression)newValue);
      return;
  }
  super.eSet(featureID, newValue);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:ModelImpl.java


示例17: eUnset

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public void eUnset(int featureID)
{
  switch (featureID)
  {
    case PureXbasePackage.MODEL__IMPORT_SECTION:
      setImportSection((XImportSection)null);
      return;
    case PureXbasePackage.MODEL__BLOCK:
      setBlock((XBlockExpression)null);
      return;
  }
  super.eUnset(featureID);
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:20,代码来源:ModelImpl.java


示例18: internalGetImportedNamespaceResolvers

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
protected List<ImportNormalizer> internalGetImportedNamespaceResolvers(EObject context, boolean ignoreCase) {
	if(EcoreUtil.getRootContainer(context) != context) 
		return Collections.emptyList();
	XImportSection importSection = importsConfiguration.getImportSection((XtextResource) context.eResource());
	if(importSection != null) {
		return getImportedNamespaceResolvers(importSection, ignoreCase);
	}
	return Collections.emptyList();
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:10,代码来源:XImportSectionNamespaceScopeProvider.java


示例19: getImportedNamespaceResolvers

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
protected List<ImportNormalizer> getImportedNamespaceResolvers(XImportSection importSection, boolean ignoreCase) {
	List<XImportDeclaration> importDeclarations = importSection.getImportDeclarations();
	List<ImportNormalizer> result = Lists.newArrayListWithExpectedSize(importDeclarations.size());
	for (XImportDeclaration imp: importDeclarations) {
		if (!imp.isStatic()) {
			String value = imp.getImportedNamespace();
			if(value == null)
				value = imp.getImportedTypeName();
			ImportNormalizer resolver = createImportedNamespaceResolver(value, ignoreCase);
			if (resolver != null)
				result.add(resolver);
		}
	}
	return result;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:16,代码来源:XImportSectionNamespaceScopeProvider.java


示例20: newSession

import org.eclipse.xtext.xtype.XImportSection; //导入依赖的package包/类
@Override
public IFeatureScopeSession newSession(Resource context) {
	List<JvmType> literalClasses = implicitlyImportedFeatures.getStaticImportClasses(context);
	List<JvmType> extensionClasses = implicitlyImportedFeatures.getExtensionClasses(context);
	IFeatureScopeSession result = rootSession.addTypesToStaticScope(literalClasses, extensionClasses);
	if (context.getContents().isEmpty() || !(context instanceof XtextResource))
		return result;
	final XImportSection importSection = importsConfig.getImportSection((XtextResource) context);
	if(importSection != null) {
		result = result.addImports(new ITypeImporter.Client() {

			@Override
			public void doAddImports(ITypeImporter importer) {
				List<XImportDeclaration> imports = importSection.getImportDeclarations();
				for(XImportDeclaration _import: imports) {
					if (_import.isStatic()) {
						if (_import.isWildcard()) {
							if (_import.isExtension()) {
								importer.importStaticExtension(_import.getImportedType(), false);
							} else {
								importer.importStatic(_import.getImportedType());
							}
						} else {
							if (_import.isExtension()) {
								importer.importStaticExtension(_import.getImportedType(), _import.getMemberName(), false);
							} else {
								importer.importStatic(_import.getImportedType(), _import.getMemberName());
							}
						}
					}
				}
			}
			
		});
	}
	return result;
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:38,代码来源:XbaseBatchScopeProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockUCState类代码示例发布时间:2022-05-22
下一篇:
Java TagPluginContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap