Package com.totsp.gwittir.client.beans

Examples of com.totsp.gwittir.client.beans.Property


     */
    public static void sortOnProperty(List list, String propertyName,
        boolean ascending) throws Exception {
        Class currentClass = null;
       
        Property p = null;
        HashMap<Class, Property> cache = new HashMap<Class, Property>();

        for(int i = 0; i < (list.size() - 1); i++) {
            for(int j = i + 1; j < list.size(); j++) {
                Object o1 = list.get(i);
                Class o1Class = INTRO.resolveClass(o1);
                if(currentClass != o1Class) {
                    p = cache.get(o1Class);

                    if(p == null) {
                        p = INTRO.getDescriptor(o1).getProperty(propertyName);
                        cache.put( o1Class, p);
                    }
                    currentClass = o1Class;
                }

                Comparable oc1 = (Comparable) p.getAccessorMethod()
                                               .invoke(o1, null);

                Object o2 = list.get(j);
                Class o2Class = INTRO.resolveClass(o2);
                if(currentClass != o2Class) {
                    p = cache.get(o2Class);

                    if(p == null) {
                        p = INTRO.getDescriptor(o2).getProperty(propertyName);
                        cache.put( o2Class, p);
                    }
                    currentClass = o2Class;
                }

                Comparable oc2 = (Comparable) p.getAccessorMethod()
                                               .invoke(o2, null);

                if(ascending) {
                    if((oc1 != oc2)
                            && (
View Full Code Here


            if (properties != null) {
                 //System.out.println(properties.length);
                for (int i = 0; i < properties.length; i++) {
                    String pName = properties[i].getName();
                    //System.out.println(pName);
                    Property p = bd.getProperty(pName);
                    Method m = p.getAccessorMethod();

                    if (m != null) { // ensure it has a getter method

                        Object value = m.invoke(bean, null);
                        if(!printed.contains(value)){
View Full Code Here

        Binding binding;

        if(field.getCellProvider() != null) {
            widget = field.getCellProvider().get();
        } else {
            final Property p = Introspector.INSTANCE.getDescriptor(target)
                                                    .getProperty(field
                    .getPropertyName());
            widget = this.factory.getWidgetProvider(field.getPropertyName(),
                    p.getType()).get();

            // TODO Figure out some way to make this read only.
        }

       
View Full Code Here

                        + col.getPropertyName(), null);
            } else {
                if (col.getCellProvider() != null) {
                    widget = col.getCellProvider().get();
                } else {
                    final Property p = Introspector.INSTANCE.getDescriptor(target).getProperty(col.getPropertyName());
                    widget = this.factory.getWidgetProvider(col.getPropertyName(),
                            p.getType()).get();

                    // TODO Figure out some way to make this read only.
                }

                rowWidgets[colIndex] = widget;
View Full Code Here

                int index =0;
                for(PropertyDescriptor d: info.getPropertyDescriptors()){
                    if(d.getName().equals("class")){
                        continue;
                    }
                    props[index] = new Property(d.getName(), d.getPropertyType(),
                            d.getReadMethod() == null ? null : new MethodWrapper(d.getReadMethod()),
                            d.getWriteMethod() == null ? null : new MethodWrapper(d.getWriteMethod()));
                   // System.out.println(clazz+" mapped property: "+props[index]);
                    index++;
                }
View Full Code Here

        if (this.descriptor == null) { //No lazy thread issues in the browser;

            final Property[] wrappedProps = new Property[this.properties.length];

            for (int i = 0; i < this.properties.length; i++) {
                wrappedProps[i] = new Property(
                        this.properties[i].getName(),
                        this.properties[i].getType(),
                        (this.properties[i].getAccessorMethod() != null) ? new MethodWrapper(this.properties[i].getAccessorMethod()) : null,
                        (this.properties[i].getMutatorMethod() != null) ? new MethodWrapper(this.properties[i].getAccessorMethod()) : null);
            }
View Full Code Here

            if (properties != null) {
                 //System.out.println(properties.length);
                for (int i = 0; i < properties.length; i++) {
                    String pName = properties[i].getName();
                    //System.out.println(pName);
                    Property p = bd.getProperty(pName);
                    Method m = p.getAccessorMethod();

                    if (m != null) { // ensure it has a getter method

                        Object value = m.invoke(bean, null);
                        printProperty(sb, prefix + "." + pName, value);
View Full Code Here

        Binding binding;

        if(field.getCellProvider() != null) {
            widget = field.getCellProvider().get();
        } else {
            final Property p = Introspector.INSTANCE.getDescriptor(target)
                                                    .getProperty(field
                    .getPropertyName());
            widget = this.factory.getWidgetProvider(field.getPropertyName(),
                    p.getType()).get();

            // TODO Figure out some way to make this read only.
        }

       
View Full Code Here

                col.getPropertyName(), null);
        } else {
            if (col.getCellProvider() != null) {
                widget = col.getCellProvider().get();
            } else {
                final Property p = Introspector.INSTANCE.getDescriptor(target)
                                                        .getProperty(col.getPropertyName());
                widget = this.factory.getWidgetProvider(col.getPropertyName(),
                        p.getType()).get();

                // TODO Figure out some way to make this read only.
            }

            rowWidgets[colIndex] = widget;
View Full Code Here

        for (Field formField : formFields) {
          String fieldName = formField.getName();

          if ( fieldName != null ) {
            Property modelProperty = this.beanDescriptor.getProperty( fieldName );

            if ( modelProperty != null ) {
              Method accessorMethod = modelProperty.getAccessorMethod();
              Object value = null;
              try {
                value = accessorMethod.invoke( this.model, null );
                if ( value == null ) {
                  value = "";
View Full Code Here

TOP

Related Classes of com.totsp.gwittir.client.beans.Property

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.