Package org.objectstyle.wolips.eomodeler.core.kvc

Examples of org.objectstyle.wolips.eomodeler.core.kvc.IKey


  static {
    myCachedPropertyKeys = new HashMap<String, IKey>();
  }

  protected static synchronized IKey getPropertyKey(String _property) {
    IKey key = myCachedPropertyKeys.get(_property);
    if (key == null) {
      key = new ResolvedKey(EOAttribute.class, _property);
      myCachedPropertyKeys.put(_property, key);
    }
    return key;
View Full Code Here


  public boolean isPrototyped(String _property) {
    boolean prototyped = false;
    if (myPrototypeName != null) {
      EOAttribute prototype = getPrototype();
      if (prototype != null) {
        IKey key = EOAttribute.getPropertyKey(_property);
        Object value = key.getValue(this);
        if (value != null) {
          Object prototypeValue = key.getValue(prototype);
          prototyped = prototypeValueEquals(_property, value, prototypeValue);
        }
      }
    }
    return prototyped;
View Full Code Here

    }
    firePropertyChange(EOAttribute.PROTOTYPE, oldPrototype, _prototype);
    if (prototypeNameChanged && _updateFromPrototype) {
      for (int propertyNum = 0; propertyNum < PROTOTYPED_PROPERTIES.length; propertyNum++) {
        String propertyName = PROTOTYPED_PROPERTIES[propertyNum];
        IKey propertyKey = EOAttribute.getPropertyKey(propertyName);
        Object oldValue = oldValues.get(propertyName);
        Object newPrototypeValue = _prototype != null ? propertyKey.getValue(_prototype) : oldValue;
        Object newValue;
        if (AbstractEOArgument.NAME.equals(propertyName)) {
          newValue = oldValue;
        }
        else if (AbstractEOArgument.COLUMN_NAME.equals(propertyName) && oldValue != null) {
          newValue = oldValue;
        }
        else {
          newValue = newPrototypeValue;
        }
        //System.out.println("EOAttribute.setPrototype: " + propertyName + "," + newValue + "," + oldValue + " (" + wasPrototyped + ")");
        propertyKey.setValue(this, newValue);
        firePropertyChange(propertyName, oldValue, newValue);
      }
      //Q: The value of DataType is probably going to change underneath us as we iterate and if it happens to end up back at what we started with it may not get updated
      //   so we pass a null to force an update of the UI
      updateDataType(null);
View Full Code Here

      myListObj.addPropertyChangeListener(myListPropertyName, this);
    }
  }

  protected synchronized IKey getKey(String _property) {
    IKey key = myKeys.get(_property);
    if (key == null) {
      key = new CachingKeyPath(_property);
      myKeys.put(_property, key);
    }
    return key;
View Full Code Here

    try {
      Object newValue = ((IStructuredSelection) _event.getSelection()).getFirstElement();
      if (ComparisonUtils.equals(myBlankValue, newValue)) {
        newValue = null;
      }
      IKey key = getKey(myPropertyName);
      Object existingValue = key.getValue(myObj);
      if (!ComparisonUtils.equals(existingValue, newValue)) {
        key.setValue(myObj, newValue);
      }
    } catch (Exception e) {
      ErrorUtils.openErrorDialog(Display.getDefault().getActiveShell(), e);
    }
  }
View Full Code Here

TOP

Related Classes of org.objectstyle.wolips.eomodeler.core.kvc.IKey

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.