Java Code Examples for org.eclipse.emf.ecore.util.EcoreEList

The following are top voted examples for showing how to use org.eclipse.emf.ecore.util.EcoreEList. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: OpenSPIFe   File: TooltipShellBuilder.java   View source code 6 votes vote down vote up
private static String getReferenceParameter(EPlanElement ePlanElement, EReferenceParameter eStructuralFeature) {
	IItemPropertySource source = EMFUtils.adapt(ePlanElement, IItemPropertySource.class);
	IItemPropertyDescriptor startPD = source.getPropertyDescriptor(ePlanElement, eStructuralFeature);
	// First check the instance name
	if (startPD != null) {
		Object value = EMFUtils.getPropertyValue(startPD, ePlanElement);
		if (value != null && StringifierRegistry.hasRegisteredStringifier(eStructuralFeature.getName())) {
			IStringifier stringifier = StringifierRegistry.getStringifier(eStructuralFeature.getName());
			return stringifier.getDisplayString(value);
		}
		if(value instanceof EcoreEList) {
			List<String> valueList = new ArrayList<String>();
			for (Object o : ((EcoreEList) value).toArray()) {
				valueList.add(getChoiceText(eStructuralFeature, o));
			}
			return EEnumStringifier.formatString(valueList.toString());
		}
	}
	return "";
}
 
Example 2
Project: OpenSPIFe   File: FeatureTransactionAddOperation.java   View source code 6 votes vote down vote up
public static <T> void execute(String label, EcoreEList<T> list, T object) {
	if (list.getEStructuralFeature().isUnique() && list.contains(object)) {
		return;
	}
	IUndoableOperation op = new FeatureTransactionAddOperation<T>(label, list, object);
	IUndoContext context = TransactionUtils.getUndoContext(list);
	if (context != null) {
		op.addContext(context);
		try {
	        IOperationHistory history = OperationHistoryFactory.getOperationHistory();
	    	history.execute(op, null, null);
	    } catch (Exception e) {
	    	LogUtil.error("execute", e);
	    }
	}
}
 
Example 3
Project: OpenSPIFe   File: FeatureTransactionRemoveAllOperation.java   View source code 6 votes vote down vote up
public FeatureTransactionRemoveAllOperation(String label, EcoreEList<T> list, List<T> objects) {
	super(label);
	this.list = list;
	this.objects = objects;
	int i = 0;
	List<T> matches = new ArrayList<T>();
	int matchIndex = -1;
	for (T object : list) {
		if (objects.contains(object)) {
			matches.add(object);
			if (matchIndex == -1) {
				matchIndex = i;
			}
		} else if (matchIndex != -1) {
			indexObjects.put(matchIndex, matches);
			matches = new ArrayList<T>();
			matchIndex = -1;
		}
		i++;
	}
	if (matchIndex != -1) {
		indexObjects.put(matchIndex, matches);
		matches = new ArrayList<T>();
		matchIndex = -1;
	}
}
 
Example 4
Project: OpenSPIFe   File: FeatureTransactionRemoveAllOperation.java   View source code 6 votes vote down vote up
public static <T> void execute(String label, EcoreEList<T> list, List<T> objects) {
	boolean containsOne = false;
	for (T item : list) {
		if (objects.contains(item)) {
			containsOne = true;
			break;
		}
	}
	if (!containsOne) {
		return;
	}
	IUndoableOperation op = new FeatureTransactionRemoveAllOperation<T>(label, list, objects);
	IUndoContext context = TransactionUtils.getUndoContext(list);
	if (context != null) {
		op.addContext(context);
		try {
	        IOperationHistory history = OperationHistoryFactory.getOperationHistory();
	    	history.execute(op, null, null);
	    } catch (Exception e) {
	    	LogUtil.error("execute", e);
	    }
	}
}
 
Example 5
Project: OpenSPIFe   File: FeatureTransactionAddAllOperation.java   View source code 6 votes vote down vote up
public static <T> void execute(String label, EcoreEList<T> list, List<T> objects) {
	if (list.getEStructuralFeature().isUnique() && list.containsAll(objects)) {
		return;
	}
	IUndoableOperation op = new FeatureTransactionAddAllOperation<T>(label, list, objects);
	IUndoContext context = TransactionUtils.getUndoContext(list);
	if (context != null) {
		op.addContext(context);
		try {
	        IOperationHistory history = OperationHistoryFactory.getOperationHistory();
	    	history.execute(op, null, null);
	    } catch (Exception e) {
	    	LogUtil.error("execute", e);
	    }
	}
}
 
Example 6
Project: OpenSPIFe   File: FeatureTransactionRemoveOperation.java   View source code 6 votes vote down vote up
public static <T> void execute(String label, EcoreEList<T> list, T object) {
	if (!list.contains(object)) {
		return;
	}
	IUndoableOperation op = new FeatureTransactionRemoveOperation<T>(label, list, object);
	IUndoContext context = TransactionUtils.getUndoContext(list);
	if (context != null) {
		op.addContext(context);
		try {
	        IOperationHistory history = OperationHistoryFactory.getOperationHistory();
	    	history.execute(op, null, null);
	    } catch (Exception e) {
	    	LogUtil.error("execute", e);
	    }
	}
}
 
Example 7
Project: OpenSPIFe   File: FlightRuleViolation.java   View source code 6 votes vote down vote up
private void suggestTogglingWaiverOfRuleForElement(Set<Suggestion> suggestions, EPlanElement element) {
	EcoreEList<String> oldRuleNames = RuleUtils.getWaivedRuleNames(element);
	String name = rule.getName();
	if (!oldRuleNames.contains(name)) {
		String label;
		IUndoableOperation operation;
		String description;
		if (RuleUtils.isWaived(element, rule)) {
			label = "waive " + rule.getPrintName();
			operation = new FeatureTransactionAddOperation<String>(label, oldRuleNames, name);
			description = "Waive " + rule.getPrintName();
		} else {
			label = "unwaive " + rule.getPrintName();
			operation = new FeatureTransactionRemoveOperation<String>(label, oldRuleNames, name);
			description = "Unwaive " + rule.getPrintName();
		}
		if (element instanceof EPlan) {
			description += " for this plan";
		} else {
			description += " for " + element.getName();
		}
		suggestions.add(new Suggestion(description, operation));
	}
}
 
Example 8
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 6 votes vote down vote up
private Suggestion createAddConstraintSuggestion() {
	IUndoableOperation operation = null;
	if (constraint instanceof ProfileConstraint) {
		EcoreEList<ProfileConstraint> currentConstraints = (EcoreEList)target.getMember(ProfileMember.class).getConstraints();
		// Need to make a copy so it doesn't get removed from the template
		ProfileConstraint constraintCopy = (ProfileConstraint) EMFUtils.copy(constraint);
		operation = new FeatureTransactionAddOperation("Add Profile Constraint", currentConstraints, constraintCopy);
	} else if (constraint instanceof BinaryTemporalConstraint) {
		operation = new CreateTemporalRelationOperation((BinaryTemporalConstraint)constraint);
	} else if (constraint instanceof PeriodicTemporalConstraint) {
		operation = new CreateTemporalBoundOperation((PeriodicTemporalConstraint)constraint);
	} else if (constraint instanceof TemporalChain) {
		List<EPlanChild> linked = CommonUtils.castList(EPlanChild.class, ((TemporalChain)constraint).getElements());
		operation = new ChainOperation(PlanStructureModifier.INSTANCE, linked, false);
	}
	if (operation != null) {
		return new Suggestion(UPDATE_ACTIVITY_ICON, "Add Constraint to Plan", operation);
	}
	return null;
}
 
Example 9
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 6 votes vote down vote up
private Suggestion createRemoveConstraintSuggestion() {
	IUndoableOperation operation = null;
	if (constraint instanceof ProfileConstraint) {
		EcoreEList<ProfileConstraint> currentConstraints = (EcoreEList)target.getMember(ProfileMember.class).getConstraints();
		operation = new FeatureTransactionRemoveOperation("Remove Profile Constraint", currentConstraints, constraint);
	} else if (constraint instanceof BinaryTemporalConstraint) {
		operation = new DeleteTemporalRelationOperation((BinaryTemporalConstraint)constraint);
	} else if (constraint instanceof PeriodicTemporalConstraint) {
		operation = new DeleteTemporalBoundOperation((PeriodicTemporalConstraint)constraint);
	} else if (constraint instanceof TemporalChain) {
		operation = new UnchainOperation(((TemporalChain)constraint).getElements());
	}
	if (operation != null) {
		return new Suggestion(UPDATE_ACTIVITY_ICON, "Remove Constraint from Plan", operation);
	}
	return null;
}
 
Example 10
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 6 votes vote down vote up
private Suggestion createModifyConstraintSuggestion() {
	CompositeOperation operation = null;
	if (constraint instanceof ProfileConstraint) {
		operation = new CompositeOperation("Update Profile Constraint");
		EcoreEList<ProfileConstraint> currentConstraints = (EcoreEList)target.getMember(ProfileMember.class).getConstraints();
		for (ProfileConstraint currentConstraint : currentConstraints) {
			if (similarProfileReferences(currentConstraint, (ProfileConstraint)constraint)) {
				operation.add(new FeatureTransactionRemoveOperation("Remove Profile Constraint", currentConstraints, currentConstraint));
			}
		}
		// Need to make a copy so it doesn't get removed from the template
		ProfileConstraint constraintCopy = (ProfileConstraint) EMFUtils.copy(constraint);
		operation.add(new FeatureTransactionAddOperation("Add Profile Constraint", currentConstraints, constraintCopy));
	}
	if (operation != null) {
		return new Suggestion(UPDATE_ACTIVITY_ICON, "Update Constraint in Plan", operation);
	}
	return null;
}
 
Example 11
Project: triquetrum   File: PortImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<Relation> getInsideLinkedRelations() {
  List<Relation> relations = new ArrayList<>();
  for (Relation r : getLinkedRelations()) {
    if (getContainer().equals(r.getContainer())) {
      relations.add(r);
    }
  }
  return new EcoreEList.UnmodifiableEList(this, TriqPackage.eINSTANCE.getPort_InsideLinkedRelations(), relations.size(), relations.toArray());
}
 
Example 12
Project: triquetrum   File: PortImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<Relation> getOutsideLinkedRelations() {
  List<Relation> relations = new ArrayList<>();
  for (Relation r : getLinkedRelations()) {
    if (getContainer().getContainer().equals(r.getContainer())) {
      relations.add(r);
    }
  }
  return new EcoreEList.UnmodifiableEList(this, TriqPackage.eINSTANCE.getPort_OutsideLinkedRelations(), relations.size(), relations.toArray());
}
 
Example 13
Project: OpenSPIFe   File: DayResourceColumn.java   View source code 5 votes vote down vote up
@Override
public boolean editOnActivate(DayResourceFacet facet, IUndoContext undoContext, TreeItem item, int index) {
	Object element = facet.getElement();
	if (element instanceof EActivity) {
		EActivity activity = (EActivity) element;
		EStructuralFeature feature = getFacetFeature(activity);
		if (feature == null) {
			return false;
		}
		
		String featureName = EMFUtils.getDisplayName(activity, feature);
		IUndoableOperation operation = null;
		if (feature.isMany()) {
			EcoreEList value = (EcoreEList) (activity.getData().eGet(feature));
			if (!value.contains(object)) {
				operation = new FeatureTransactionAddOperation("add "+featureName, value, object);
			} else {
				operation = new FeatureTransactionRemoveOperation("remove "+featureName, value, object);
			}
		} else {
			operation = new FeatureTransactionChangeOperation("change "+featureName, activity, feature, object);
		}
		CommonUtils.execute(operation, undoContext);
		return true;
	}
	return false;
}
 
Example 14
Project: OpenSPIFe   File: FeatureTransactionAddAllOperation.java   View source code 5 votes vote down vote up
public FeatureTransactionAddAllOperation(String label, EcoreEList<T> list, List<T> objects) {
	super(label);
	this.list = list;
	if (list.getEStructuralFeature().isUnique()) {
		this.objects = new ArrayList<T>(objects);
		this.objects.removeAll(list);
	} else {
		this.objects = objects;
	}
}
 
Example 15
Project: OpenSPIFe   File: FeatureTransactionRemoveOperation.java   View source code 5 votes vote down vote up
@Override
public String toString() {
	StringBuilder builder = new StringBuilder(Object.class.getSimpleName());
	builder.append(":");
	if (list instanceof EcoreEList) {
		builder.append(((EcoreEList) list).getEStructuralFeature().getName());
		builder.append(" on " + ((EcoreEList) list).getEObject());
	}
	builder.append(" remove ");
	builder.append(String.valueOf(object));
	return builder.toString();
}
 
Example 16
Project: OpenSPIFe   File: RuleUtils.java   View source code 5 votes vote down vote up
/**
 * Set some particular rule to be waived or enabled
 * @param rule
 * @param waived
 */
public static void setWaived(EPlan element, ERule rule, boolean waived) {
	EcoreEList<String> ruleNames = getWaivedRuleNames(element);
	String name = rule.getName();
	if (waived) {
		FeatureTransactionAddOperation.execute("waive rule", ruleNames, name);
	} else if (!waived) {
		FeatureTransactionRemoveOperation.execute("unwaive rule", ruleNames, name);
	}
}
 
Example 17
Project: OpenSPIFe   File: RuleUtils.java   View source code 5 votes vote down vote up
/**
 * Set these rules to be waived or enabled
 * @param rules
 * @param waived
 */
public static void setWaivedRules(EPlan element, Set<ERule> rules, boolean waived) {
	EcoreEList<String> oldRuleNames = getWaivedRuleNames(element);
	List<String> changedRuleNames = new ArrayList<String>();
	for (ERule rule : rules) {
		changedRuleNames.add(rule.getName());
	}
	if (waived) {
		FeatureTransactionAddAllOperation.execute("waive rule(s)", oldRuleNames, changedRuleNames);
	} else {
		FeatureTransactionRemoveAllOperation.execute("unwaive rule(s)", oldRuleNames, changedRuleNames);
	}
}
 
Example 18
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 5 votes vote down vote up
private String getProfileConstraintFormText(ProfileConstraint profileConstraint, IdentifiableRegistry<EPlanElement> identifiableRegistry) {
	PlanPrinter printer = new PlanPrinter(identifiableRegistry);
	StringBuilder builder = new StringBuilder();
	switch (getDiffType()) {
	case MODIFY:
		EcoreEList<ProfileConstraint> currentConstraints = (EcoreEList)target.getMember(ProfileMember.class).getConstraints();
		ProfileConstraint oldConstraint = null;
		for (ProfileConstraint currentConstraint : currentConstraints) {
			if (similarProfileReferences(currentConstraint, (ProfileConstraint)constraint)) {
				oldConstraint = currentConstraint;
				break;
			}
		}
		if (oldConstraint != null) {
			builder.append(getTargetSource()).append(": ");
			buildConstraintFormText(target, oldConstraint, printer, builder);
			builder.append("<BR/>");
		}
		builder.append(getUpdatedSource()).append(": ");
		buildConstraintFormText(updated, profileConstraint, printer, builder);
		break;
	case ADD:
		builder.append(getUpdatedSource()).append(": ");
		buildConstraintFormText(updated, profileConstraint, printer, builder);
		break;
	case REMOVE:
		builder.append(getTargetSource()).append(": ");
		buildConstraintFormText(target, profileConstraint, printer, builder);
		break;
	default:
	}
	return builder.toString();
}
 
Example 19
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 5 votes vote down vote up
private String getEffectFormText(FormText text, IdentifiableRegistry<EPlanElement> identifiableRegistry) {
	if (text != null) {
		text.setColor("start", ColorConstants.darkGreen);
		text.setColor("end", ColorConstants.red);
	}
	PlanPrinter printer = new PlanPrinter(identifiableRegistry);
	StringBuilder builder = new StringBuilder();
	switch (getDiffType()) {
	case MODIFY:
		EcoreEList<ProfileEffect> currentEffects = (EcoreEList)target.getMember(ProfileMember.class).getEffects();
		ProfileEffect oldEffect = null;
		for (ProfileEffect currentEffect : currentEffects) {
			if (similarProfileReferences(currentEffect, effect)) {
				oldEffect = currentEffect;
				break;
			}
		}
		if (oldEffect != null) {
			builder.append(getTargetSource()).append(": ");
			buildEffectFormText(target, oldEffect, printer, builder);
			builder.append("<BR/>");
		}
		builder.append(getUpdatedSource()).append(": ");
		buildEffectFormText(updated, effect, printer, builder);
		break;
	case ADD:
		builder.append(getUpdatedSource()).append(": ");
		buildEffectFormText(updated, effect, printer, builder);
		break;
	case REMOVE:
		builder.append(getTargetSource()).append(": ");
		buildEffectFormText(target, effect, printer, builder);
		break;
	default:
	}
	return builder.toString();
}
 
Example 20
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 5 votes vote down vote up
private Suggestion createAddEffectSuggestion() {
	EcoreEList<ProfileEffect> currentEffects = (EcoreEList)target.getMember(ProfileMember.class).getEffects();
	// Need to make a copy so it doesn't get removed from the template
	ProfileEffect effectCopy = EMFUtils.copy(effect);
	IUndoableOperation operation = new FeatureTransactionAddOperation("Add Profile Effect", currentEffects, effectCopy);
	return new Suggestion(UPDATE_ACTIVITY_ICON, "Add Effect to Plan", operation);
}
 
Example 21
Project: OpenSPIFe   File: PlanDiffViolation.java   View source code 5 votes vote down vote up
private Suggestion createModifyEffectSuggestion() {
	EcoreEList<ProfileEffect> currentEffects = (EcoreEList)target.getMember(ProfileMember.class).getEffects();
	CompositeOperation operation = new CompositeOperation("Update Profile Effect");
	for (ProfileEffect currentEffect : currentEffects) {
		if (similarProfileReferences(currentEffect, effect)) {
			operation.add(new FeatureTransactionRemoveOperation("Remove Profile Effect", currentEffects, currentEffect));
		}
	}
	// Need to make a copy so it doesn't get removed from the template
	ProfileEffect effectCopy = EMFUtils.copy(effect);
	operation.add(new FeatureTransactionAddOperation("Add Profile Effect", currentEffects, effectCopy));
	return new Suggestion(UPDATE_ACTIVITY_ICON, "Update Effect in Plan", operation);
}
 
Example 22
Project: eclipse-avro   File: EClassImpl.java   View source code 5 votes vote down vote up
public EList<EReference> getEAllContainments()
{
  if (eAllContainments == null)
  {
    BasicEList<EReference> result = 
      new UniqueEList<EReference>()
      {
        private static final long serialVersionUID = 1L;

        @Override
        protected Object [] newData(int capacity)
        {
          return new EReference [capacity];
        }

        @Override
        protected boolean useEquals()
        {
          return false;
        }
      };

    for (EReference eReference : getEAllReferences())
    {
      if (eReference.isContainment())
      {
        result.add(eReference);
      }
    }

    result.shrink();
    eAllContainments = 
      new EcoreEList.UnmodifiableEList.FastCompare<EReference>
        (this, EcorePackage.eINSTANCE.getEClass_EAllContainments(), result.size(), result.data()); 
    getESuperAdapter().setAllContainmentsCollectionModified(false);
  }

  return eAllContainments;
}
 
Example 23
Project: eclipse-avro   File: EStoreEObjectImpl.java   View source code 5 votes vote down vote up
@Override
protected List<E> delegateBasicList()
{
  int size = delegateSize();
  if (size == 0)
  {
    return ECollections.emptyEList();
  }
  else
  {
    Object[] data = eStore().toArray(owner, eStructuralFeature);
    return new EcoreEList.UnmodifiableEList<E>(owner, eStructuralFeature, data.length, data);
  }
}
 
Example 24
Project: eclipse-avro   File: EStoreEObjectImpl.java   View source code 5 votes vote down vote up
@Override
protected List<FeatureMap.Entry> delegateBasicList()
{
  int size = delegateSize();
  if (size == 0)
  {
    return ECollections.emptyEList();
  }
  else
  {
    Object[] data = eStore().toArray(owner, eStructuralFeature);
    return new EcoreEList.UnmodifiableEList<FeatureMap.Entry>(owner, eStructuralFeature, data.length, data);
  }
}
 
Example 25
Project: eclipse-avro   File: EStructuralFeatureImpl.java   View source code 5 votes vote down vote up
public InternalSettingDelegateMany(int style, EStructuralFeature feature)
{
  this.style = style;
  this.dataClass = Object.class;
  this.dynamicKind = EcoreEList.Generic.kind(feature);
  this.feature = feature;
}
 
Example 26
Project: eclipse-avro   File: EStructuralFeatureImpl.java   View source code 5 votes vote down vote up
public InternalSettingDelegateMany(int style, EStructuralFeature feature, EReference inverseFeature)
{
  this.style = style;
  this.dataClass = Object.class;
  this.dynamicKind = EcoreEList.Generic.kind(feature);
  this.feature = feature;
  this.inverseFeature = inverseFeature;
}
 
Example 27
Project: clickwatch   File: EClassImpl.java   View source code 5 votes vote down vote up
public EList<EReference> getEAllContainments()
{
  if (eAllContainments == null)
  {
    BasicEList<EReference> result = 
      new UniqueEList<EReference>()
      {
        private static final long serialVersionUID = 1L;

        @Override
        protected Object [] newData(int capacity)
        {
          return new EReference [capacity];
        }

        @Override
        protected boolean useEquals()
        {
          return false;
        }
      };

    for (EReference eReference : getEAllReferences())
    {
      if (eReference.isContainment())
      {
        result.add(eReference);
      }
    }

    result.shrink();
    eAllContainments = 
      new EcoreEList.UnmodifiableEList.FastCompare<EReference>
        (this, EcorePackage.eINSTANCE.getEClass_EAllContainments(), result.size(), result.data()); 
    getESuperAdapter().setAllContainmentsCollectionModified(false);
  }

  return eAllContainments;
}
 
Example 28
Project: clickwatch   File: EStoreEObjectImpl.java   View source code 5 votes vote down vote up
@Override
protected List<E> delegateBasicList()
{
  int size = delegateSize();
  if (size == 0)
  {
    return ECollections.emptyEList();
  }
  else
  {
    Object[] data = eStore().toArray(owner, eStructuralFeature);
    return new EcoreEList.UnmodifiableEList<E>(owner, eStructuralFeature, data.length, data);
  }
}
 
Example 29
Project: clickwatch   File: EStoreEObjectImpl.java   View source code 5 votes vote down vote up
@Override
protected List<FeatureMap.Entry> delegateBasicList()
{
  int size = delegateSize();
  if (size == 0)
  {
    return ECollections.emptyEList();
  }
  else
  {
    Object[] data = eStore().toArray(owner, eStructuralFeature);
    return new EcoreEList.UnmodifiableEList<FeatureMap.Entry>(owner, eStructuralFeature, data.length, data);
  }
}
 
Example 30
Project: clickwatch   File: EStructuralFeatureImpl.java   View source code 5 votes vote down vote up
public InternalSettingDelegateMany(int style, EStructuralFeature feature)
{
  this.style = style;
  this.dataClass = Object.class;
  this.dynamicKind = EcoreEList.Generic.kind(feature);
  this.feature = feature;
}
 
Example 31
Project: clickwatch   File: EStructuralFeatureImpl.java   View source code 5 votes vote down vote up
public InternalSettingDelegateMany(int style, EStructuralFeature feature, EReference inverseFeature)
{
  this.style = style;
  this.dataClass = Object.class;
  this.dynamicKind = EcoreEList.Generic.kind(feature);
  this.feature = feature;
  this.inverseFeature = inverseFeature;
}
 
Example 32
Project: emf-fragments   File: FInternalObjectImpl.java   View source code 5 votes vote down vote up
@Override
protected EStructuralFeature.Internal.SettingDelegate eSettingDelegate(final EStructuralFeature eFeature) {
	FragmentationType type = EMFFragUtil.getFragmentationType(eFeature);
	if (type == FragmentationType.None || type == FragmentationType.FragmentsContainment) {
		return ((EStructuralFeature.Internal) eFeature).getSettingDelegate();
	} else {
		return new EStructuralFeatureImpl.InternalSettingDelegateMany(EStructuralFeatureImpl.InternalSettingDelegateMany.DATA_DYNAMIC, eFeature) {
			@Override
			protected Setting createDynamicSetting(InternalEObject owner) {
				int kind = EcoreEList.Generic.kind(eFeature);
				return new FValueSetList(kind, FInternalObjectImpl.class, FInternalObjectImpl.this, eFeature);
			}
		};
	}
}
 
Example 33
Project: emfviews   File: WeavingModelImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualConcept> getVirtualConcepts() {
  ArrayList<VirtualConcept> virtualConcepts = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualConcept) {
      virtualConcepts.add((VirtualConcept) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualConcepts(),
                                            virtualConcepts.size(), virtualConcepts.toArray());
}
 
Example 34
Project: emfviews   File: WeavingModelImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualProperty> getVirtualProperties() {
  ArrayList<VirtualProperty> virtualProperties = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualProperty) {
      virtualProperties.add((VirtualProperty) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualProperties(),
                                            virtualProperties.size(),
                                            virtualProperties.toArray());
}
 
Example 35
Project: emfviews   File: WeavingModelImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualAssociation> getVirtualAssociations() {
  ArrayList<VirtualAssociation> virtualAssociations = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualAssociation) {
      virtualAssociations.add((VirtualAssociation) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualAssociations(),
                                            virtualAssociations.size(),
                                            virtualAssociations.toArray());
}
 
Example 36
Project: emfviews   File: WeavingModelImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<VirtualElement> getVirtualElements() {
  ArrayList<VirtualElement> virtualElements = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof VirtualElement) {
      virtualElements.add((VirtualElement) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_VirtualElements(),
                                            virtualElements.size(), virtualElements.toArray());
}
 
Example 37
Project: emfviews   File: WeavingModelImpl.java   View source code 5 votes vote down vote up
/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 *
 * @generated NOT
 */
@Override
public EList<Filter> getFilters() {
  ArrayList<Filter> filters = new ArrayList<>();
  for (VirtualLink l : getVirtualLinks()) {
    if (l instanceof Filter) {
      filters.add((Filter) l);
    }
  }
  return new EcoreEList.UnmodifiableEList<>(this,
                                            VirtualLinksPackage.eINSTANCE
                                                .getWeavingModel_Filters(),
                                            filters.size(), filters.toArray());
}
 
Example 38
Project: emfviews   File: VirtualEClass.java   View source code 5 votes vote down vote up
@Override
public EList<EStructuralFeature> getEStructuralFeatures() {
  // The return value must be castable to EStructuralFeature.Setting,
  // hence why we use an EcoreList.UnmodifiableElist
  List<EStructuralFeature> cs = getVisibleLocalFeatures();
  return new EcoreEList.UnmodifiableEList<>(
      this, EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES, cs.size(), cs.toArray());
}
 
Example 39
Project: emfviews   File: VirtualEClass.java   View source code 5 votes vote down vote up
@Override
public EList<EStructuralFeature> getEAllStructuralFeatures() {
  // The return value must be castable to EStructuralFeature.Setting,
  // hence why we use an EcoreList.UnmodifiableElist
  List<EStructuralFeature> cs = getVisibleFeatures();
  return new EcoreEList.UnmodifiableEList<>(
      this, EcorePackage.Literals.ECLASS__ESTRUCTURAL_FEATURES, cs.size(), cs.toArray());
}
 
Example 40
Project: emfviews   File: VirtualEPackage.java   View source code 5 votes vote down vote up
@Override
public EList<EClassifier> getEClassifiers() {
  // The return value must be castable to EStructuralFeature.Setting,
  // hence why we use an EcoreList.UnmodifiableElist
  List<EClassifier> cs = getNonFilteredClassifiers();
  return new EcoreEList.UnmodifiableEList<>(
      this, EcorePackage.Literals.EPACKAGE__ECLASSIFIERS, cs.size(), cs.toArray());
}