Examples of EOAttribute


Examples of com.webobjects.eoaccess.EOAttribute

     * @param entityName name of the entity to fetch
     * @param qualifier to find the matching objects
     * @return number of matching objects
     */
    public static Integer objectCountWithQualifier(EOEditingContext ec, String entityName, EOQualifier qualifier) {
        EOAttribute attribute = EOEnterpriseObjectClazz.objectCountAttribute();
        return (Integer)_aggregateFunctionWithQualifierAndAggregateAttribute(ec, entityName, qualifier, attribute);
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAttribute

     * @param attributeName name of attribute in same entity to consider in order to determine uniqueness
     * @return number of matching objects
     */
    public static Integer objectCountUniqueWithQualifierAndAttribute(EOEditingContext ec, String entityName, EOQualifier qualifier, String attributeName) {
        EOEntity entity = EOUtilities.entityNamed(ec, entityName);
        EOAttribute attribute = entity.attributeNamed(attributeName);
        EOAttribute aggregateAttribute = EOEnterpriseObjectClazz.objectCountUniqueAttribute(attribute);
        return (Integer)_aggregateFunctionWithQualifierAndAggregateAttribute(ec, entityName, qualifier, aggregateAttribute);
    }
View Full Code Here

Examples of com.webobjects.eoaccess.EOAttribute

                                                        String attributeName,
                                                        String function,
                                                        Class valueClass,
                                                        String valueType,
                                                        EOQualifier qualifier) {
        EOAttribute attribute = ERXEOAccessUtilities.createAggregateAttribute(ec,
                                                                              function,
                                                                              attributeName,
                                                                              entityName, valueClass, valueType);

        return ERXEOControlUtilities._aggregateFunctionWithQualifierAndAggregateAttribute(ec, entityName, qualifier, attribute);
View Full Code Here

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

  public void setBlankText(String blankText) {
    _blankText = blankText;
  }

  public Image getColumnImage(Object _element, String _property) {
    EOAttribute attribute = (EOAttribute) _element;
    Image image = null;
    if (EOAttribute.PRIMARY_KEY.equals(_property)) {
      image = yesNoImage(attribute.isPrimaryKey(), Activator.getDefault().getImageRegistry().get(Activator.PRIMARY_KEY_ICON), null, null);
    } else if (EOAttribute.USED_FOR_LOCKING.equals(_property)) {
      image = yesNoImage(attribute.isUsedForLocking(), Activator.getDefault().getImageRegistry().get(Activator.LOCKING_ICON), null, null);
    } else if (EOAttribute.CLASS_PROPERTY.equals(_property)) {
      image = yesNoImage(attribute.isClassProperty(), Activator.getDefault().getImageRegistry().get(Activator.CLASS_PROPERTY_ICON), null, null);
    } else if (AbstractEOArgument.ALLOWS_NULL.equals(_property)) {
      image = yesNoImage(attribute.isAllowsNull(), Activator.getDefault().getImageRegistry().get(Activator.ALLOW_NULL_ICON), null, null);
    }
    return image;
  }
View Full Code Here

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

  protected String yesNoText(EOAttribute _attribute, Boolean _bool) {
    return yesNoText(_bool, !_attribute.getEntity().isPrototype());
  }

  public String getColumnText(Object _element, String _property) {
    EOAttribute attribute = (EOAttribute) _element;
    String text = null;
    if (EOAttribute.PRIMARY_KEY.equals(_property)) {
      // DO NOTHING
    } else if (EOAttribute.USED_FOR_LOCKING.equals(_property)) {
      // DO NOTHING
    } else if (EOAttribute.CLASS_PROPERTY.equals(_property)) {
      // DO NOTHING
    } else if (AbstractEOArgument.ALLOWS_NULL.equals(_property)) {
      // DO NOTHING
    } else if (EOAttribute.PROTOTYPE.equals(_property)) {
      EOAttribute prototype = attribute.getPrototype();
      if (prototype != null) {
        text = prototype.getName();
      }
    } else {
      text = super.getColumnText(_element, _property);
      if (text == null) {
        text = _blankText;
View Full Code Here

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

  }

  public Font getFont(Object _element, int _columnIndex) {
    Font font = null;
    if (_tableViewer != null) {
      EOAttribute attribute = (EOAttribute) _element;
      boolean inherited = attribute.isInherited();
      boolean flattened = attribute.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.EOAttribute

    return null;
  }

  public Color getForeground(Object _element, int _columnIndex) {
    Color color = null;
    EOAttribute attribute = (EOAttribute) _element;
    if (attribute != null) {
      String property = getColumnProperty(_columnIndex);
      boolean isAttributePrototyped = attribute.isPrototyped(property);
      boolean isClassProperty = attribute.isClassProperty() != null && attribute.isClassProperty().booleanValue();
      if (isAttributePrototyped) {
        color = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED);
      }
      else if (!isClassProperty) {
        color = Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
View Full Code Here

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

    GridData prototypeComboLayoutData = new GridData(GridData.FILL_HORIZONTAL);
    prototypeCombo.setLayoutData(prototypeComboLayoutData);
  }

  protected void _argumentChanged(AbstractEOArgument argument) {
    EOAttribute attribute = (EOAttribute) argument;
    if (attribute != null) {
      _prototypeComboViewer.setInput(attribute);
      _prototypeBinding = new ComboViewerBinding(_prototypeComboViewer, attribute, EOAttribute.PROTOTYPE, attribute.getEntity().getModel(), EOModel.ENTITIES, EOEntityListContentProvider.BLANK_ENTITY);

      getBindingContext().bindValue(SWTObservables.observeSelection(_primaryKeyButton), BeansObservables.observeValue(attribute, EOAttribute.PRIMARY_KEY), null, new BooleanUpdateValueStrategy());
      getBindingContext().bindValue(SWTObservables.observeSelection(_classPropertyButton), BeansObservables.observeValue(attribute, EOAttribute.CLASS_PROPERTY), null, new BooleanUpdateValueStrategy());
      getBindingContext().bindValue(SWTObservables.observeSelection(_lockingButton), BeansObservables.observeValue(attribute, EOAttribute.USED_FOR_LOCKING), null, new BooleanUpdateValueStrategy());
    }
View Full Code Here

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

    }
    return canModify;
  }

  public Object getValue(Object _element, String _property) {
    EOAttribute attribute = (EOAttribute) _element;
    Object value = null;
    if (EOAttribute.PROTOTYPE.equals(_property)) {
      EOAttribute prototype = attribute.getPrototype();
      String prototypeName;
      if (prototype == null) {
        prototypeName = EOAttributesCellModifier.NO_PROTOYPE_VALUE;
      } else {
        prototypeName = prototype.getName();
      }
      value = new Integer(myPrototypeNames.indexOf(prototypeName));
    } else if (AbstractEOArgument.ALLOWS_NULL.equals(_property) || EOAttribute.CLASS_PROPERTY.equals(_property) || EOAttribute.CLIENT_CLASS_PROPERTY.equals(_property) || EOAttribute.INDEXED.equals(_property) || EOAttribute.PRIMARY_KEY.equals(_property) || EOAttribute.READ_ONLY.equals(_property) || EOAttribute.USED_FOR_LOCKING.equals(_property)) {
      value = super.getValue(_element, _property);
      if (value == null && !attribute.getEntity().isPrototype()) {
View Full Code Here

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

    return value;
  }

  protected boolean _modify(Object _element, String _property, Object _value) throws Throwable {
    boolean modified = false;
    EOAttribute attribute = (EOAttribute) _element;
    if (EOAttribute.PROTOTYPE.equals(_property)) {
      Integer prototypeIndex = (Integer) _value;
      int prototypeIndexInt = prototypeIndex.intValue();
      String prototypeName = (prototypeIndexInt == -1) ? null : (String) myPrototypeNames.get(prototypeIndexInt);
      if (EOAttributesCellModifier.NO_PROTOYPE_VALUE.equals(prototypeName)) {
        attribute.setPrototype(null, true);
      } else {
        EOAttribute prototype = attribute.getEntity().getModel().getPrototypeAttributeNamed(prototypeName);
        attribute.setPrototype(prototype, true);
      }
      modified = true;
    }
    return modified;
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.