use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class OverridingRuleRefactoringParticipant method getRenamedElementsOrProxies.
@Override
protected List<EObject> getRenamedElementsOrProxies(EObject originalTarget) {
if (originalTarget instanceof AbstractRule) {
List<IEObjectDescription> overridingRules = ruleOverrideUtil.getOverridingRules((AbstractRule) originalTarget);
List<EObject> result = newArrayList();
for (IEObjectDescription overridingRule : overridingRules) {
result.add(overridingRule.getEObjectOrProxy());
}
return result;
}
return null;
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class RuleOverrideUtil method getOverriddenRules.
public List<IEObjectDescription> getOverriddenRules(final AbstractRule originalRule) {
Grammar grammar = GrammarUtil.getGrammar(originalRule);
final List<IEObjectDescription> overriddenRules = newArrayList();
IAcceptor<AbstractRule> acceptor = new IAcceptor<AbstractRule>() {
@Override
public void accept(AbstractRule overriddenRule) {
if (overriddenRule != null) {
IEObjectDescription description = EObjectDescription.create(qualifiedNameProvider.getFullyQualifiedName(overriddenRule), overriddenRule);
overriddenRules.add(description);
}
}
};
findOverriddenRule(originalRule, grammar.getUsedGrammars(), acceptor);
return overriddenRules;
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractConstructorScopeTest method testGetElementByInstance_03.
@Test
public void testGetElementByInstance_03() {
JvmAnnotationReference annotationReference = TypesFactory.eINSTANCE.createJvmAnnotationReference();
IEObjectDescription element = getConstructorScope().getSingleElement(annotationReference);
assertNull(element);
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractConstructorScopeTest method testGetElementByName_01.
@Test
public void testGetElementByName_01() {
IEObjectDescription objectElement = getConstructorScope().getSingleElement(QualifiedName.create(Object.class.getName()));
assertNotNull(objectElement);
assertFalse(objectElement.getEObjectOrProxy().eIsProxy());
assertEquals(TypesPackage.Literals.JVM_CONSTRUCTOR, objectElement.getEClass());
assertEquals(QualifiedName.create("java.lang.Object"), objectElement.getName());
}
use of org.eclipse.xtext.resource.IEObjectDescription in project xtext-eclipse by eclipse.
the class AbstractConstructorScopeTest method testGetElementByName_03.
@Test
public void testGetElementByName_03() {
IEObjectDescription objectElement = getConstructorScope().getSingleElement(QualifiedName.create(int.class.getName()));
assertNull(objectElement);
}
Aggregations