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


Java XImportSection类代码示例

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


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


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