001 package org.trails.component;
002
003 import org.apache.tapestry.IAsset;
004 import org.apache.tapestry.annotations.Asset;
005 import org.apache.tapestry.annotations.ComponentClass;
006 import org.apache.tapestry.annotations.Parameter;
007 import org.trails.finder.BlockFinder;
008 import org.trails.descriptor.IPropertyDescriptor;
009
010 /**
011 * This component loops over all the properties in the class descriptor and
012 * displays a property for each one, deferring to a property override block if there is one.
013 */
014 @ComponentClass
015 public abstract class RenderProperties extends AbstractObjectRenderComponent
016 {
017
018 /**
019 * This property indicates where the HTML template for this component is located.
020 * It's explicitly indicated here so all the subclasses can share the same template.
021 *
022 * @return Returns the HTML template.
023 */
024 @Asset(value = "/org/trails/component/RenderProperties.html")
025 public abstract IAsset get$template();
026
027 @Parameter(required = true)
028 public abstract BlockFinder getBlockFinder();
029
030 @Parameter(defaultValue = "page.model")
031 public abstract Object getModel();
032
033 @Parameter(defaultValue = "page.modelNew")
034 public abstract boolean isModelNew();
035
036 public abstract void setModelNew(boolean modelNew);
037
038 /**
039 * It's used as the @For component "value" parameter.
040 * It's updated with the current IPropertyDescriptor on each iteration.
041 *
042 * @return Returns the current property.
043 */
044 public abstract IPropertyDescriptor getProperty();
045 }