Examples of EORelationship


Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

  public EORelationshipsViewerSorter(String tableName) {
    super(tableName);
  }

  public Object getComparisonValue(Object _obj, String _property) {
    EORelationship relationship = (EORelationship) _obj;
    Object value = null;
    if (EORelationship.DESTINATION.equals(_property)) {
      EOEntity destination = relationship.getDestination();
      if (destination != null) {
        value = destination.getName();
      }
    } else if (EOJoin.SOURCE_ATTRIBUTE.equals(_property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        value = firstJoin.getSourceAttribute().getName();
      }
    } else if (EOJoin.DESTINATION_ATTRIBUTE.equals(_property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        value = firstJoin.getDestinationAttribute().getName();
      }
    } else {
      value = super.getComparisonValue(_obj, _property);
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

    super(tableName);
    _tableViewer = tableViewer;
  }

  public Image getColumnImage(Object element, String property) {
    EORelationship relationship = (EORelationship) element;
    Image image = null;
    if (EORelationship.TO_MANY.equals(property)) {
      image = yesNoImage(relationship.isToMany(), Activator.getDefault().getImageRegistry().get(Activator.TO_MANY_ICON), Activator.getDefault().getImageRegistry().get(Activator.TO_ONE_ICON), Activator.getDefault().getImageRegistry().get(Activator.TO_ONE_ICON));
    } else if (EORelationship.CLASS_PROPERTY.equals(property)) {
      image = yesNoImage(relationship.isClassProperty(), Activator.getDefault().getImageRegistry().get(Activator.CLASS_PROPERTY_ICON), null, null);
    } else if (EORelationship.OPTIONAL.equals(property)) {
      image = yesNoImage(relationship.isOptional(), Activator.getDefault().getImageRegistry().get(Activator.ALLOW_NULL_ICON), null, null);
    }
    return image;
  }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

      text = entity.getName();
    } else if (_element instanceof EOAttribute) {
      EOAttribute attribute = (EOAttribute) _element;
      text = attribute.getName();
    } else if (_element instanceof EORelationship) {
      EORelationship relationship = (EORelationship) _element;
      text = relationship.getName();
    } else if (_element instanceof EORelationshipPath) {
      EORelationshipPath relationshipPath = (EORelationshipPath) _element;
      text = relationshipPath.getChildRelationship().getName();
    } else if (_element instanceof EOAttributePath) {
      EOAttributePath attributePath = (EOAttributePath) _element;
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

    }
    return image;
  }

  public String getColumnText(Object element, String property) {
    EORelationship relationship = (EORelationship) element;
    String text = null;
    if (EORelationship.TO_MANY.equals(property)) {
      // DO NOTHING
    } else if (EORelationship.CLASS_PROPERTY.equals(property)) {
      // DO NOTHING
    } else if (EORelationship.OPTIONAL.equals(property)) {
      // DO NOTHING
    } else if (EORelationship.DESTINATION.equals(property)) {
      EOEntity destination = relationship.getDestination();
      if (destination != null) {
        text = destination.getName();
      }
    } else if (EOJoin.SOURCE_ATTRIBUTE.equals(property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        EOAttribute sourceAttribute = firstJoin.getSourceAttribute();
        if (sourceAttribute != null) {
          text = sourceAttribute.getName();
        }
      }
    } else if (EOJoin.DESTINATION_ATTRIBUTE.equals(property)) {
      EOJoin firstJoin = relationship.getFirstJoin();
      if (firstJoin != null) {
        EOAttribute destinationAttribute = firstJoin.getDestinationAttribute();
        if (destinationAttribute != null) {
          text = destinationAttribute.getName();
        }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

    }
    return text;
  }

  public Font getFont(Object element, int columnIndex) {
    EORelationship relationship = (EORelationship) element;
    Font font = null;
    boolean inherited = relationship.isInherited();
    boolean flattened = relationship.isFlattened();
    if (flattened && inherited) {
      if (_flattenedInheritedFont == null) {
        Font originalFont = _tableViewer.getTable().getFont();
        FontData[] fontData = _tableViewer.getTable().getFont().getFontData();
        _flattenedInheritedFont = new Font(originalFont.getDevice(), fontData[0].getName(), fontData[0].getHeight(), SWT.BOLD | SWT.ITALIC);
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

    // EORelationship relationship = (EORelationship) element;
    return null;
  }

  public Color getForeground(Object element, int columnIndex) {
    EORelationship relationship = (EORelationship) element;
    Color color = null;
    boolean isClassProperty = relationship.isClassProperty() != null && relationship.isClassProperty().booleanValue();
    if (!isClassProperty) {
      color = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
    }
    return color;
  }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

      if (_showAttributes && _showRelationships) {
        entityChildren.addAll(entity.getChildrenEntities());
      }
      children = entityChildren.toArray();
    } else if (_parentElement instanceof EORelationship) {
      EORelationship relationship = (EORelationship) _parentElement;
      Set<AbstractEOAttributePath> relationshipPathChildren = new TreeSet<AbstractEOAttributePath>(new EOSortableEOModelObjectComparator());
      relationshipPathChildren.addAll(Arrays.asList(new EORelationshipPath(null, relationship).getChildren()));
      children = relationshipPathChildren.toArray();
    } else if (_parentElement instanceof EORelationshipPath) {
      EORelationshipPath relationshipPath = (EORelationshipPath) _parentElement;
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

            EOAttribute selectedAttribute = (EOAttribute) selectedObject;
            setSelectedEntity(selectedAttribute.getEntity());
            getEntityEditor().setSelection(_selection);
            setActivePage(getPageNum(EOModelEditor.EOENTITY_PAGE));
          } else if (selectedObject instanceof EORelationship) {
            EORelationship selectedRelationship = (EORelationship) selectedObject;
            setSelectedEntity(selectedRelationship.getEntity());
            getEntityEditor().setSelection(selection);
            setActivePage(getPageNum(EOModelEditor.EOENTITY_PAGE));
          } else if (selectedObject instanceof EOFetchSpecification) {
            EOFetchSpecification selectedFetchSpec = (EOFetchSpecification) selectedObject;
            setSelectedEntity(selectedFetchSpec.getEntity());
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

 
  public void setDetailKeyName(final String key) {
    String oldDetailKeyName = _detailKeyName;
    _detailKeyName = key;
    if (key != null && isHasMasterDetail()) {
      EORelationship relation = _masterEntity.getRelationshipNamed(key);
      if (relation != null) {
        setEntity(relation.getDestination().getEntity());
      }
      else {
        setEntity(_masterEntity);
      }
    }
View Full Code Here

Examples of org.objectstyle.wolips.eomodeler.core.model.EORelationship

      text = entity.getName();
    } else if (_element instanceof EOAttribute) {
      EOAttribute attribute = (EOAttribute) _element;
      text = attribute.getName();
    } else if (_element instanceof EORelationship) {
      EORelationship relationship = (EORelationship) _element;
      text = relationship.getName();
    } else if (_element instanceof EORelationshipPath) {
      EORelationshipPath relationshipPath = (EORelationshipPath) _element;
      text = relationshipPath.getChildRelationship().getName();
    } else if (_element instanceof EOAttributePath) {
      EOAttributePath attributePath = (EOAttributePath) _element;
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.