Package org.objectstyle.wolips.eomodeler.core.model

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


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

  public String getColumnText(Object _element, String _property) {
    EOEntity entity = (EOEntity) _element;
    String text = null;
    if (EOEntity.PARENT.equals(_property)) {
      EOEntity parent = entity.getParent();
      if (parent != null) {
        text = parent.getName();
      }
    } else {
      text = super.getColumnText(_element, _property);
    }
    return text;
View Full Code Here


    } 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();
View Full Code Here

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

  public Object getComparisonValue(Object _obj, String _property) {
    EOEntity entity = (EOEntity) _obj;
    Object value = null;
    if (EOEntity.PARENT.equals(_property)) {
      EOEntity parent = entity.getParent();
      if (parent != null) {
        value = parent.getName();
      }
    } else {
      value = super.getComparisonValue(_obj, _property);
    }
    return value;
View Full Code Here

      if (_showDatabaseConfigs) {
        modelChildren.addAll(model.getDatabaseConfigs());
      }
      children = modelChildren.toArray();
    } else if (_parentElement instanceof EOEntity) {
      EOEntity entity = (EOEntity) _parentElement;
      Set<EOModelObject> entityChildren = new TreeSet<EOModelObject>(new EOSortableEOModelObjectComparator());
      if (_showAttributes) {
        if (_showNonClassProperties) {
          entityChildren.addAll(entity.getAttributes());
        } else {
          entityChildren.addAll(entity.getClassAttributes());
        }
      }
      if (_showRelationships) {
        if (_showNonClassProperties) {
          entityChildren.addAll(entity.getRelationships());
        } else {
          entityChildren.addAll(entity.getClassRelationships());
        }
      }
      if (_showFetchSpecs) {
        entityChildren.addAll(entity.getFetchSpecs());
      }
      if (_showEntityIndexes) {
        entityChildren.addAll(entity.getEntityIndexes());
      }
      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());
View Full Code Here

            // EOModel selectedModel = (EOModel) selectedObject;
            setSelectedEntity(null);
            setSelectedStoredProcedure(null);
            setActivePage(getPageNum(EOModelEditor.EOMODEL_PAGE));
          } else if (selectedObject instanceof EOEntity) {
            EOEntity selectedEntity = (EOEntity) selectedObject;
            setSelectedEntity(selectedEntity);
            // setActivePage(EOModelEditor.EOENTITY_PAGE);
          } else if (selectedObject instanceof EOAttribute) {
            EOAttribute selectedAttribute = (EOAttribute) selectedObject;
            setSelectedEntity(selectedAttribute.getEntity());
View Full Code Here

  }

  protected void updateJoins() {
    if (myJoinsTableViewer != null) {
      myJoinsTableViewer.setInput(myRelationship);
      EOEntity source = myRelationship.getEntity();
      if (source != null) {
        TableColumn sourceColumn = TableUtils.getColumn(myJoinsTableViewer, EOJoin.class.getName(), EOJoin.SOURCE_ATTRIBUTE_NAME);
        if (sourceColumn != null) {
          sourceColumn.setText(source.getName());
          KeyComboBoxCellEditor sourceCellEditor = (KeyComboBoxCellEditor) TableUtils.getCellEditor(myJoinsTableViewer, EOJoin.class.getName(), EOJoin.SOURCE_ATTRIBUTE_NAME);
          sourceCellEditor.setItems(source.getAttributeNames());
        }
      }
      EOEntity destination = myRelationship.getDestination();
      if (destination != null) {
        TableColumn destinationColumn = TableUtils.getColumn(myJoinsTableViewer, EOJoin.class.getName(), EOJoin.DESTINATION_ATTRIBUTE_NAME);
        if (destinationColumn != null) {
          destinationColumn.setText(destination.getName());
          KeyComboBoxCellEditor destinationCellEditor = (KeyComboBoxCellEditor) TableUtils.getCellEditor(myJoinsTableViewer, EOJoin.class.getName(), EOJoin.DESTINATION_ATTRIBUTE_NAME);
          destinationCellEditor.setItems(destination.getAttributeNames());
        }
      }
      TableUtils.packTableColumns(myJoinsTableViewer);
    }
  }
View Full Code Here

    }
    return true;
  }

  public Object getValue(Object _element, String _property) {
    EOEntity entity = (EOEntity) _element;
    Object value = null;
    if (EOEntity.PARENT.equals(_property)) {
      EOEntity parent = entity.getParent();
      String parentName;
      if (parent == null) {
        parentName = EOEntitiesCellModifier.NO_PARENT_VALUE;
      } else {
        parentName = parent.getName();
      }
      value = new Integer(myEntityNames.indexOf(parentName));
    } else {
      value = super.getValue(_element, _property);
    }
View Full Code Here

  public void disposeBindings() {
    if (myRelationship != null) {
      myRelationship.removePropertyChangeListener(EORelationship.DEFINITION, myRelationshipListener);
      myRelationship.removePropertyChangeListener(EORelationship.DESTINATION, myRelationshipListener);
      myRelationship.removePropertyChangeListener(EORelationship.JOINS, myRelationshipListener);
      EOEntity destination = myRelationship.getDestination();
      if (destination != null) {
        destination.removePropertyChangeListener(EOEntity.ATTRIBUTE, myAttributesListener);
        destination.removePropertyChangeListener(EOEntity.ATTRIBUTES, myAttributesListener);
      }
    }
  }
View Full Code Here

    return value;
  }

  protected boolean _modify(Object _element, String _property, Object _value) throws Throwable {
    boolean modified = false;
    EOEntity entity = (EOEntity) _element;
    if (EOEntity.PARENT.equals(_property)) {
      Integer parentNameIndex = (Integer) _value;
      int parentNameIndexInt = parentNameIndex.intValue();
      String parentName = (parentNameIndexInt == -1) ? null : (String) myEntityNames.get(parentNameIndexInt);
      if (EOEntitiesCellModifier.NO_PARENT_VALUE.equals(parentName)) {
        entity.setParent(null);
      } else {
        EOEntity parent = entity.getModel().getModelGroup().getEntityNamed(parentName);
        entity.setParent(parent);
      }
      modified = true;
    }
    return modified;
View Full Code Here

    String oldEntityName = _entityName;
    if (entity == null || !entity.equals(_entityName)) {
      _entityName = entity;
      firePropertyChange(ENTITY_NAME, oldEntityName, _entityName);
      try {
        EOEntity eoentity = _wooModel.getModelGroup().getEntityNamed(entity);
        setEntity(eoentity);
      }
      catch (Exception e) {
        e.printStackTrace();
        setEntity(null);
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.eomodeler.core.model.EOEntity

Copyright © 2018 www.massapicom. 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.