Examples of eClass()


Examples of org.eclipse.emf.ecore.EObject.eClass()

    List contents = new ArrayList((eDataObject).eContents());
    for (int i = 0, size = contents.size(); i < size; ++i)
    {
      ((DataObject)contents.get(i)).delete();
    }
    EClass eClass = eDataObject.eClass();
    for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
    {
      EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
      if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived() && !((Property)eStructuralFeature).isReadOnly())
      {
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

    protected static int matchingIndex(List eObjects, String attributeName, String attributeValue)
    {
      for (int i = 0, size = eObjects.size(); i < size; i++)
      {
        EObject eObject = (EObject)eObjects.get(i);
        EStructuralFeature feature = (EStructuralFeature)((Type)eObject.eClass()).getProperty(attributeName);
        if (feature != null)
        {
          Object test = eObject.eGet(feature, true);
          if (test != null)
          {
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

 

 
  private static Property getPropertyByIndex(DataObject dataObject, int propertyIndex) {
    EObject eObject = (EObject) dataObject;
    Property property = (Property)eObject.eClass().getEStructuralFeature(propertyIndex);
    return property;
  }

  public static void setString(DataObject dataObject, int propertyIndex, String value) {
    dataObject.set(propertyIndex, getSetValue(getPropertyByIndex(dataObject, propertyIndex), value));
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

 
  public static List getInstanceProperties(DataObject dataObject)
  {
    //TODO maybe optimize this to just return type.getProperties if type.isOpen (isOpen would need to be cached)
    EObject eDataObject = (EObject) dataObject;
    List result = new UniqueEList(eDataObject.eClass().getEAllStructuralFeatures());
    for (int i = 0, count = result.size(); i < count; ++i)
    {
      EStructuralFeature eStructuralFeature = (EStructuralFeature)result.get(i);
      if (!eStructuralFeature.isDerived() && FeatureMapUtil.isFeatureMap(eStructuralFeature))
      {
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

    List contents = new ArrayList((eDataObject).eContents());
    for (int i = 0, size = contents.size(); i < size; ++i)
    {
      ((DataObject)contents.get(i)).delete();
    }
    EClass eClass = eDataObject.eClass();
    for (int i = 0, size = eClass.getFeatureCount(); i < size; ++i)
    {
      EStructuralFeature eStructuralFeature = eClass.getEStructuralFeature(i);
      if (eStructuralFeature.isChangeable() && !eStructuralFeature.isDerived() && !((Property)eStructuralFeature).isReadOnly())
      {
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

    protected static int matchingIndex(List eObjects, String attributeName, String attributeValue)
    {
      for (int i = 0, size = eObjects.size(); i < size; i++)
      {
        EObject eObject = (EObject)eObjects.get(i);
        EStructuralFeature feature = (EStructuralFeature)((Type)eObject.eClass()).getProperty(attributeName);
        // If feature is null, that means it could be an open feature.
        if (feature == null)
        {
          feature = (EStructuralFeature)DataObjectUtil.getOpenFeature(eObject, attributeName);
        }
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

      List<Object[]> parameters, Viewpoint structural,
      SortedMultiset<String> allExpressions) {
    Iterator<EObject> it = structural.eAllContents();
    while (it.hasNext()) {
      EObject underTest = it.next();
      for (EAttribute attr : underTest.eClass().getEAllAttributes()) {
        if (attr.getEType() == DescriptionPackage.eINSTANCE
            .getInterpretedExpression()) {
          Object expr = underTest.eGet(attr);
          if (expr instanceof String && ((String) expr).length() > 0) {
            parameters
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

    } else if (o instanceof EClass) {
      EClass eClass = (EClass) o;
      imageName = imageNameFrom(eClass);
    } else if (o instanceof EObject) {
      EObject modelObject = (EObject) o;
      imageName = imageNameFrom(modelObject.eClass());
    }
    String imageFileName = null;
    if (imageName != null) {
      imageFileName = imageFileName(imageName);
    }
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

      // EReference reference = (EReference) featureIterator.feature();
      // reference.getEOpposite() seems to return the wrong EReference for target
      // so we iterate over all references in Target to find, and delete, all references
      // to object
     
      for (EReference ref : target.eClass().getEAllReferences()) {
        if (ref.isMany()) {
          // it's a list (assumed)
          EList<Object> resolved = (EList<Object>) target.eGet(ref);
          if (resolved.contains(object)) {
            // delete the reference
View Full Code Here

Examples of org.eclipse.emf.ecore.EObject.eClass()

   
    // make sure that if we test for something that isn't an edge, it does
    // throw an exception.
    try {
      EObject node = getNonEdgeNode();
      assertFalse("Node was actually an edge", getEdgeTypes().containsKey(node.eClass().getName()));
      GetShortcuts.getSourceElement(node, true);
      fail("Should have failed for a non-edge node");
    } catch (IllegalArgumentException e) {
      // expected
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.