本文整理汇总了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));
}
示例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);
}
}
}
}
}
}
示例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);
}
}
}
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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;
}