Java Code Examples for org.eclipse.emf.ecore.EReference

The following examples show how to use org.eclipse.emf.ecore.EReference. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
public void lookupCrossReference(IScope scope, EObject model, EReference reference,
		ICompletionProposalAcceptor acceptor, Predicate<IEObjectDescription> filter,
		Function<IEObjectDescription, ICompletionProposal> proposalFactory) {
	Function<IEObjectDescription, ICompletionProposal> wrappedFactory = getWrappedFactory(model, reference, proposalFactory);
	Iterable<IEObjectDescription> candidates = queryScope(scope, model, reference, filter);
	for (IEObjectDescription candidate : candidates) {
		if (!acceptor.canAcceptMoreProposals())
			return;
		if (filter.apply(candidate)) {
			acceptor.accept(wrappedFactory.apply(candidate));
		}
	}
}
 
Example 2
private int getWrappedValueSize(Object val, EReference eReference) {
	if (val == null) {
		return 2;
	}
	if (val instanceof VirtualObject) {
		VirtualObject eObject = (VirtualObject) val;
		if (eReference.getEAnnotation("twodimensionalarray") != null) {
			int refSize = 6;
			EStructuralFeature eStructuralFeature = eObject.eClass().getEStructuralFeature("List");
			List<?> l = (List<?>)eObject.eGet(eStructuralFeature);
			for (Object o : l) {
				if (o instanceof VirtualObject) {
					refSize += 8;
				} else if (o instanceof WrappedVirtualObject) {
					refSize += ((WrappedVirtualObject)o).getSize();
				} else {
					refSize += getPrimitiveSize((EDataType) eStructuralFeature.getEType(), o);
				}
			}
			return refSize;
		} else if (eObject.eClass().getEAnnotation("wrapped") != null) {
			VirtualObject wrappedValue = (VirtualObject) val;
			EStructuralFeature wrappedValueFeature = wrappedValue.eClass().getEStructuralFeature("wrappedValue");
			Object wrappedVal = eObject.eGet(wrappedValueFeature);
			return 2 + getPrimitiveSize((EDataType) wrappedValueFeature.getEType(), wrappedVal);
		} else {
			return 8;
		}
	} else if (val instanceof WrappedVirtualObject) {
		WrappedVirtualObject wrappedVirtualObject = (WrappedVirtualObject)val;
		return wrappedVirtualObject.getSize();
	} else if (val instanceof Long) {
		return 8;
	} else {
		throw new RuntimeException("Programming error, should not happen " + val);
	}
}
 
Example 3
TestableDelegatingScopeProvider() {
	this(new IScopeProvider() {
		@Override
		public IScope getScope(EObject context, EReference reference) {
			return IScope.NULLSCOPE;
		}
	});
}
 
Example 4
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getAttribute_Feature()
{
  return (EReference)attributeEClass.getEStructuralFeatures().get(0);
}
 
Example 5
Source Project: xtext-web   Source File: DomainmodelPackageImpl.java    License: Eclipse Public License 2.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getOperation_Body()
{
  return (EReference)operationEClass.getEStructuralFeatures().get(1);
}
 
Example 6
Source Project: birt   Source File: TypePackageImpl.java    License: Eclipse Public License 1.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public EReference getBarSeries_RiserOutline( )
{
	return (EReference) barSeriesEClass.getEStructuralFeatures( ).get( 1 );
}
 
Example 7
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getModel_X5()
{
  return (EReference)modelEClass.getEStructuralFeatures().get(4);
}
 
Example 8
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getElement_Child()
{
  return (EReference)elementEClass.getEStructuralFeatures().get(1);
}
 
Example 9
Source Project: xtext-core   Source File: XtextTestPackageImpl.java    License: Eclipse Public License 2.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getTypeRef_Classifier()
{
  return (EReference)typeRefEClass.getEStructuralFeatures().get(1);
}
 
Example 10
Source Project: neoscada   Source File: ConfigurationPackageImpl.java    License: Eclipse Public License 1.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getRootType_Trigger ()
{
    return (EReference)rootTypeEClass.getEStructuralFeatures ().get ( 4 );
}
 
Example 11
Source Project: xtext-extras   Source File: TypesPackageImpl.java    License: Eclipse Public License 2.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getJvmArrayType_ComponentType()
{
	return (EReference)jvmArrayTypeEClass.getEStructuralFeatures().get(0);
}
 
Example 12
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getUnaryOpExpression_Expr()
{
  return (EReference)unaryOpExpressionEClass.getEStructuralFeatures().get(1);
}
 
Example 13
Source Project: sarl   Source File: SarlPackageImpl.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getSarlAction_FiredEvents()
{
	return (EReference)sarlActionEClass.getEStructuralFeatures().get(0);
}
 
Example 14
Source Project: birt   Source File: ComponentPackageImpl.java    License: Eclipse Public License 1.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public EReference getMarkerLine_Value( )
{
	return (EReference) markerLineEClass.getEStructuralFeatures( ).get( 1 );
}
 
Example 15
Source Project: birt   Source File: ComponentPackageImpl.java    License: Eclipse Public License 1.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public EReference getMarkerRange_Outline( )
{
	return (EReference) markerRangeEClass.getEStructuralFeatures( ).get( 0 );
}
 
Example 16
Source Project: xtext-extras   Source File: TypesPackageImpl.java    License: Eclipse Public License 2.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getJvmCustomAnnotationValue_Values()
{
	return (EReference)jvmCustomAnnotationValueEClass.getEStructuralFeatures().get(0);
}
 
Example 17
private EReference createRefToRoot() {
	EReference ref = EcoreFactory.eINSTANCE.createEReference();
	EcoreFactory.eINSTANCE.createEClass().getEStructuralFeatures().add(ref);
	ref.setEType(getModelRootType());
	return ref;
}
 
Example 18
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getModel_QuantityExclusion()
{
  return (EReference)modelEClass.getEStructuralFeatures().get(5);
}
 
Example 19
Source Project: neoscada   Source File: ItemPropertyDescriptor2.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public ItemPropertyDescriptor2 ( final AdapterFactory adapterFactory, final ResourceLocator resourceLocator, final String displayName, final String description, final EReference[] parentReferences, final boolean isSettable, final String category, final String[] filterFlags )
{
    super ( adapterFactory, resourceLocator, displayName, description, parentReferences, isSettable, category, filterFlags );
}
 
Example 20
Source Project: neoscada   Source File: ParserPackageImpl.java    License: Eclipse Public License 1.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getParserDriver_Components ()
{
    return (EReference)parserDriverEClass.getEStructuralFeatures ().get ( 0 );
}
 
Example 21
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getDelegation_Delegate()
{
  return (EReference)delegationEClass.getEStructuralFeatures().get(0);
}
 
Example 22
Source Project: xtext-core   Source File: XtextTestPackageImpl.java    License: Eclipse Public License 2.0 4 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getEnumLiteralDeclaration_Literal()
{
  return (EReference)enumLiteralDeclarationEClass.getEStructuralFeatures().get(1);
}
 
Example 23
protected void assertNoContainment(EStructuralFeature feat) {
	if (!(feat instanceof EAttribute) && !(feat instanceof EReference && !((EReference) feat).isContainment()))
		throw new IllegalStateException("Only EAttributes and CrossReferences allowed.");
}
 
Example 24
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getFunctionDefinition_Params()
{
  return (EReference)functionDefinitionEClass.getEStructuralFeatures().get(2);
}
 
Example 25
protected IScope delegateGetScope(EObject context, EReference reference) {
	return getDelegate().getScope(context, reference);
}
 
Example 26
/**
    * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
    * @generated
    */
public EReference getOrganization_CustomUserInfoDefinitions() {
       return (EReference)organizationEClass.getEStructuralFeatures().get(0);
   }
 
Example 27
Source Project: M2Doc   Source File: TemplatePackage.java    License: Eclipse Public License 1.0 2 votes vote down vote up
/**
 * Returns the meta object for the containment reference '{@link org.obeonetwork.m2doc.template.Conditional#getElse <em>Else</em>}'.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * 
 * @return the meta object for the containment reference '<em>Else</em>'.
 * @see org.obeonetwork.m2doc.template.Conditional#getElse()
 * @see #getConditional()
 * @generated
 */
EReference getConditional_Else();
 
Example 28
Source Project: bonita-studio   Source File: DiPackageImpl.java    License: GNU General Public License v2.0 2 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public EReference getDocumentRoot_BPMNDiagram() {
	return (EReference)documentRootEClass.getEStructuralFeatures().get(3);
}
 
Example 29
Source Project: n4js   Source File: TypeRefsPackageImpl.java    License: Eclipse Public License 1.0 2 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override
public EReference getFunctionTypeExpression_ReturnTypeRef() {
	return (EReference)functionTypeExpressionEClass.getEStructuralFeatures().get(8);
}
 
Example 30
Source Project: kieker   Source File: DeploymentPackageImpl.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public EReference getDeploymentModel_DeploymentContexts() {
	return (EReference)deploymentModelEClass.getEStructuralFeatures().get(0);
}