Examples of PropertyReference


Examples of com.volantis.mcs.build.themes.definitions.PropertyReference

        } else if (name.equals("listType") ||
                name.equals("orderedSetType")) {
            processThemePropertyChildren(element);
        } else if (name.equals("propertyRef")) {
            // This only works inside initialValue.
            PropertyReference reference = (PropertyReference)
                    findObject(PropertyReference.class);
            String propertyName = element.getText();
            if (reference == null) {
                System.out.println("Ignoring reference to property '" +
                                   propertyName + "'");
            } else {
                reference.setPropertyName(propertyName);
            }
        } else if (name.equals("computedRef")) {
            // This only works inside initialValue.
            ComputedReference reference = (ComputedReference)
                findObject(ComputedReference.class);
            if (reference == null) {
                System.out.println("Ignoring reference to computedRef");
            } else {

                Named propertyName = definitionsFactory.createProperty();
                pushObject(propertyName);
                Rules rules = definitionsFactory.createRules();
                pushObject(rules);
                processThemePropertyChildren(element);
                popObject();
                popObject();

                reference.setPropertyName(propertyName.getName());
                reference.setRules(rules.getRuleSet());
            }

        } else if (name.equals("rule")) {

            Rules ruleSet = (Rules) findObject(Rules.class);
View Full Code Here

Examples of com.volantis.mcs.build.themes.definitions.PropertyReference

        // Create a container to hold the initial value.
        SingleValueContainer container = new SingleValueContainer();
        pushObject(container);

        // Create a container for a property reference.
        PropertyReference reference = new PropertyReference();
        pushObject(reference);

        // Create a container for a computed reference.
        ComputedReference computedRef = new ComputedReference();
        pushObject(computedRef);

        // Process the children.
        processThemePropertyChildren(element);

        popObject();
        popObject();
        popObject();

        String computedPropertyRef = computedRef.getPropertyName();
        String propertyReference = reference.getPropertyName();
        Value initialValue = container.getValue();

        if ((propertyReference != null   && initialValue != null) ||
            (propertyReference != null   && computedPropertyRef != null) ||
            (computedPropertyRef != null && initialValue != null)) {
View Full Code Here

Examples of com.volantis.mcs.protocols.widgets.PropertyReference

        currentBuffer.closeElement("input");
       
        // Get widget attributes.
        InputAttributes inputAttributes = (InputAttributes) attributes;
       
        PropertyReference propertyReference = inputAttributes.getPropertyReference();
       
        // Finally, render the JavaScript part.
        StringBuffer scriptBuffer = new StringBuffer();
       
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Input(")
            .append(createJavaScriptString(inputElement.getAttributeValue("id")))
            .append(",{");
       
        if (propertyReference != null) {
            scriptBuffer.append("property:")
                .append(createJavaScriptExpression(propertyReference));
           
            addUsedWidgetId(propertyReference.getWidgetId());
        }
       
        scriptBuffer.append("})");
       
        if (attributes.getId() != null) {
View Full Code Here

Examples of com.volantis.mcs.protocols.widgets.PropertyReference

        currentBuffer.closeElement("select");
       
        // Get widget attributes.
        SelectAttributes selectAttributes = (SelectAttributes) attributes;
       
        PropertyReference propertyReference = selectAttributes.getPropertyReference();
       
        // Finally, render the JavaScript part.
        StringBuffer scriptBuffer = new StringBuffer();
       
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Select(")
            .append(createJavaScriptString(selectElement.getAttributeValue("id")))
            .append(",{");
       
        if (propertyReference != null) {
            scriptBuffer.append("property:")
                .append(createJavaScriptExpression(propertyReference));
           
            addUsedWidgetId(propertyReference.getWidgetId());
        }
       
        scriptBuffer.append("})");
       
        if (attributes.getId() != null) {
View Full Code Here

Examples of com.volantis.mcs.protocols.widgets.PropertyReference

        protocol.writeCloseSpan(spanAttributes);

        // Render the Property Display controller.
        DisplayAttributes propertyDisplayAttributes = (DisplayAttributes) attributes;
       
        PropertyReference propertyReference = propertyDisplayAttributes.getPropertyReference();
       
        StringBuffer scriptBuffer = new StringBuffer();
       
        // Finally, render the JavaScript part.
        if (attributes.getId() != null) {
            scriptBuffer.append("Widget.register(")
                .append(createJavaScriptString(attributes.getId()))
                .append(",");
           
            addCreatedWidgetId(attributes.getId());
        }

        scriptBuffer.append("new Widget.Display(")
            .append(createJavaScriptString(spanAttributes.getId()))
            .append(",{");
       
        if (propertyReference != null) {
            scriptBuffer.append("property:")
                .append(createJavaScriptExpression(propertyReference));
           
            addUsedWidgetId(propertyReference.getWidgetId());
        }
       
        String content = propertyDisplayAttributes.getContent();
       
        if (content != null){
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.reference.PropertyReference

            //if( indexText.length()>0 ) {
            //    referencesToBeResolved.addElement( new ObjectArrayPropertyReference( (edu.cmu.cs.stage3.alice.core.property.ObjectArrayProperty)this, criterion, Integer.parseInt( indexText ), 0 ) );
            //} else {
            //    referencesToBeResolved.addElement( new PropertyReference( this, criterion ) );
            //}
            referencesToBeResolved.addElement( new PropertyReference( this, criterion ) );
        } catch( ClassNotFoundException cnfe ) {
            throw new RuntimeException( typeName );
        }
    }
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.reference.PropertyReference

            drr.setInternalRoot( element );
          }
        }
        java.util.Enumeration enum1 = referencesToBeResolved.elements();
        while( enum1.hasMoreElements() ) {
          PropertyReference propertyReference = ((PropertyReference)enum1.nextElement());
          try {
            Criterion criterion = propertyReference.getCriterion();
            if( criterion instanceof VariableCriterion ) {
              VariableCriterion variableCriterion = (VariableCriterion)criterion;
              Element variable = lookup( propertyReference.getProperty().getOwner(), variableCriterion );
              if( variable != null ) {
                propertyReference.getProperty().set( variable );
              } else {
                throw new edu.cmu.cs.stage3.alice.core.UnresolvableReferenceException( variableCriterion, "could not resolve variable criterion: " + variableCriterion );
              }
            } else {
              propertyReference.resolve( referenceResolver );
            }
          } catch( UnresolvableReferenceException ure ) {
            referencesLeftUnresolved.addElement( propertyReference );
          }
        }
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.reference.PropertyReference

                    return getCopyIfPossible( value );
                }
            }
            private Object getValueForCopy( Property property, Object value, java.util.Vector referencesToBeResolved ) {
                if( value instanceof Criterion ) {
                    referencesToBeResolved.addElement( new PropertyReference( property, (Criterion)value ) );
                    return null;
                } else {
                    return getCopyIfPossible( value );
                }
            }
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.reference.PropertyReference

        if( world != null ) {
            propertyReferences = world.getPropertyReferencesTo( this, HowMuch.INSTANCE_AND_ALL_DESCENDANTS, false, false );
            keys = new String[ propertyReferences.length ];
        }
        for( int i=0; i<propertyReferences.length; i++ ) {
            PropertyReference propertyReference = propertyReferences[ i ];
            Element reference = propertyReference.getReference();
            keys[ i ] = reference.getKey( world );
            if( propertyReference instanceof ObjectArrayPropertyReference ) {
                ObjectArrayPropertyReference objectArrayPropertyReference = (ObjectArrayPropertyReference)propertyReference;
                ObjectArrayProperty objectArrayProperty = objectArrayPropertyReference.getObjectArrayProperty();
                objectArrayProperty.set( objectArrayPropertyReference.getIndex(), null );
            } else {
                Property property = propertyReference.getProperty();
                property.set( null );
                //System.out.println( "null->"+property );
            }
        }
        Element coercedElement;
        try {
            coercedElement = (Element)cls.newInstance();
        } catch( IllegalAccessException iae ) {
            throw new ExceptionWrapper( iae, cls.toString() );
        } catch( InstantiationException ie ) {
            throw new ExceptionWrapper( ie, cls.toString() );
        }
        Element parentValue = getParent();
        if( parentValue != null ) {
            int indexOfChild = parentValue.getIndexOfChild( this );
            setParent( null );
            parentValue.insertChildAt( coercedElement, indexOfChild );
        }

        Element[] children = getChildren();
        for( int i=0; i<children.length; i++ ) {
            children[i].setParent( coercedElement );
        }
        Property[] properties = getProperties();
        for( int i=0; i<properties.length; i++ ) {
            Property property = properties[i];
            Property cProperty = coercedElement.getPropertyNamed( property.getName() );
            if( cProperty != null ) {
                cProperty.set( property.get() );
            }
        }
        for( int i=0; i<propertyReferences.length; i++ ) {
            PropertyReference propertyReference = propertyReferences[ i ];
            String key = keys[ i ];
            Element reference = world.getDescendantKeyed( key );
            Property property = propertyReference.getProperty();
            if( property.getOwner() == this ) {
                property = coercedElement.getPropertyNamed( property.getName() );
            }
            if( property != null ) {
                if( propertyReference instanceof ObjectArrayPropertyReference ) {
View Full Code Here

Examples of edu.cmu.cs.stage3.alice.core.reference.PropertyReference

        }
      } else {
        Object o = properties[ i ].get();
        if( o instanceof Element ) {
          if( ((Element)o).isReferenceExternalFrom( whom ) ) {
            references.addElement( new PropertyReference( properties[ i ], null ) );
          }
        }
      }
    }
    if( howMuch.getDescend() ) {
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.