Examples of IPropertyDescriptor


Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

    if (element instanceof CompositeDataPropertySource) {
      int idx = cell.getColumnIndex();
      CompositeDataPropertySource cdps = (CompositeDataPropertySource) element;
      IPropertyDescriptor[] propertyDescriptors = cdps.getPropertyDescriptors();
      if (propertyDescriptors != null && propertyDescriptors.length > idx && idx >= 0) {
        IPropertyDescriptor descriptor = propertyDescriptors[idx];
        if (descriptor != null) {
          Object value = cdps.getPropertyValue(descriptor.getId());
          if (value instanceof Long) {
            Long l = (Long) value;
            long timestamp = l.longValue();
            if (timestamp <= 0) {
              return null;
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

      String keyText = key.toString();
      keyNames.add(keyText);
      final OpenType<?> type = compositeType.getType(keyText);
      if (type != null) {
        final String className = type.getClassName();
        IPropertyDescriptor descriptor;
        if (type.isArray()) {
          descriptor = new ListPropertyDescriptor(key, keyText);
        } else if (className.equals("java.lang.String")) {
          descriptor = new TextPropertyDescriptor(key, keyText);
        } else if (className.equals("java.lang.Boolean")) {
View Full Code Here

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor

        Constraint constraint = vertex.getConstraint();
        if ( constraint == null ) {
            return;
        }
        IPropertyDescriptor prop = new PropertyDescriptor( CONSTRAINT,
                                                           CONSTRAINT_CAP );
        addProperty( prop,
                     constraint.toString(),
                     descriptorList,
                     valueMap );
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

  public synchronized IPropertyDescriptor getPropertyDescriptor(
      String propertyName) {
    if (propertyDescriptorsCache.containsKey(propertyName)) {
      return propertyDescriptorsCache.get(propertyName);
    }
    IPropertyDescriptor descriptor = null;
    int nestedDotIndex = propertyName.indexOf(IAccessor.NESTED_DELIM);
    if (nestedDotIndex > 0) {
      if (nestedPropertyDescriptors == null) {
        nestedPropertyDescriptors = new HashMap<String, IPropertyDescriptor>();
      }
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

  @Override
  public List<String> getQueryableProperties() {
    if (queryableProperties == null) {
      queryableProperties = new ArrayList<String>();
      for (String renderedProperty : getRenderedProperties()) {
        IPropertyDescriptor propertyDescriptor = getPropertyDescriptor(renderedProperty);
        if (propertyDescriptor.isQueryable()) {
          queryableProperties.add(renderedProperty);
        }
      }
    }
    return explodeComponentReferences(this, queryableProperties);
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

   * {@inheritDoc}
   */
  @Override
  public synchronized String getAutoCompleteProperty() {
    if (autoCompleteProperty == null) {
      IPropertyDescriptor lpd = getPropertyDescriptor(getToStringProperty());
      if (lpd != null && !lpd.isComputed()) {
        autoCompleteProperty = lpd.getName();
      } else {
        List<String> rp = getRenderedProperties();
        if (rp != null && !rp.isEmpty()) {
          for (String renderedProperty : rp) {
            if (getPropertyDescriptor(renderedProperty) instanceof IStringPropertyDescriptor) {
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

  static List<String> explodeComponentReferences(
      IComponentDescriptor<?> componentDescriptor, List<String> propertyNames) {
    List<String> explodedProperties = new ArrayList<String>();
    for (String propertyName : propertyNames) {
      IPropertyDescriptor propertyDescriptor = componentDescriptor
          .getPropertyDescriptor(propertyName);
      if ((propertyDescriptor instanceof IReferencePropertyDescriptor<?> && !IEntity.class
          .isAssignableFrom(((IReferencePropertyDescriptor<?>) propertyDescriptor)
              .getReferencedDescriptor().getComponentContract()))) {
        List<String> nestedProperties = new ArrayList<String>();
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

      if (isLifecycleMethod) {
        return new Boolean(invokeLifecycleInterceptors(proxy, method, args));
      }
      AccessorInfo accessorInfo = new AccessorInfo(method);
      EAccessorType accessorType = accessorInfo.getAccessorType();
      IPropertyDescriptor propertyDescriptor = null;
      if (accessorType != EAccessorType.NONE) {
        String accessedPropertyName = accessorInfo.getAccessedPropertyName();
        if (accessedPropertyName != null) {
          propertyDescriptor = componentDescriptor
              .getPropertyDescriptor(accessedPropertyName);
        }
      }
      if (propertyDescriptor != null) {
        Class<IComponentExtension<IComponent>> extensionClass = (Class<IComponentExtension<IComponent>>) propertyDescriptor
            .getDelegateClass();
        if (extensionClass != null) {
          IComponentExtension<? extends IComponent> extensionDelegate = getExtensionInstance(
              extensionClass, (IComponent) proxy);
          return invokeExtensionMethod(extensionDelegate, method, args);
        } else if (!propertyDescriptor.isComputed()) {
          if (accessorInfo.isModifier()) {
            if (modifierMonitors != null
                && modifierMonitors.contains(methodName)) {
              return null;
            }
            if (modifierMonitors == null) {
              modifierMonitors = new HashSet<String>();
            }
            modifierMonitors.add(methodName);
          }
          try {
            switch (accessorType) {
              case GETTER:
                return getProperty(proxy, propertyDescriptor);
              case SETTER:
                setProperty(proxy, propertyDescriptor, args[0]);
                return null;
              case ADDER:
                if (args.length == 2) {
                  addToProperty(proxy,
                      (ICollectionPropertyDescriptor<?>) propertyDescriptor,
                      ((Integer) args[0]).intValue(), args[1]);
                } else {
                  addToProperty(proxy,
                      (ICollectionPropertyDescriptor<?>) propertyDescriptor,
                      args[0]);
                }
                return null;
              case REMOVER:
                removeFromProperty(proxy,
                    (ICollectionPropertyDescriptor<?>) propertyDescriptor,
                    args[0]);
                return null;
              default:
                break;
            }
          } finally {
            if (modifierMonitors != null && accessorInfo.isModifier()) {
              modifierMonitors.remove(methodName);
            }
          }
        } else {
          try {
            return invokeServiceMethod(proxy, method, args);
          } catch (NoSuchMethodException ignored) {
            // it will fall back in the general case.
          }
          throw new ComponentException(
              "The '"
                  + propertyDescriptor.getName()
                  + "' property is described as computed but we couldn't determine a way to compute it,"
                  + " either through an extension or a service delegate on the following component : \n"
                  + componentDescriptor.getComponentContract().getName());
        }
      } else {
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

   * @param propertyName
   *          the name of the property.
   * @return the property value or null.
   */
  protected Object straightGetProperty(Object proxy, String propertyName) {
    IPropertyDescriptor propertyDescriptor = componentDescriptor
        .getPropertyDescriptor(propertyName);
    if (propertyDescriptor == null || propertyDescriptor.isComputed()) {
      return null;
    }
    Object propertyValue = retrievePropertyValue(propertyName);
    if (propertyValue == null
        && propertyDescriptor instanceof IBooleanPropertyDescriptor) {
View Full Code Here

Examples of org.jspresso.framework.model.descriptor.IPropertyDescriptor

   * @param newPropertyValue
   *          the property value or null.
   */
  protected void straightSetProperty(Object proxy, String propertyName,
      Object newPropertyValue) {
    IPropertyDescriptor propertyDescriptor = componentDescriptor
        .getPropertyDescriptor(propertyName);
    if (propertyDescriptor == null || propertyDescriptor.isComputed()) {
      return;
    }
    Object currentPropertyValue = straightGetProperty(proxy, propertyName);
    if (propertyDescriptor instanceof IReferencePropertyDescriptor) {
      // reference must change sometimes even if entities are equal.
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.