diff --git a/ccm-core/src/com/arsdigita/bebop/Component.java b/ccm-core/src/com/arsdigita/bebop/Component.java
index 964e9107f..f143f2283 100755
--- a/ccm-core/src/com/arsdigita/bebop/Component.java
+++ b/ccm-core/src/com/arsdigita/bebop/Component.java
@@ -249,7 +249,8 @@ public interface Component extends Lockable {
* malfunction and produce errors like "Widget ... isn't
* associated with any Form"
*
- * @pre p != null */
+ * @pre p != null
+ */
void register(Page p);
/**
@@ -260,7 +261,8 @@ public interface Component extends Lockable {
* components can implement it as a no-op.
*
* @pre f != null
- * @pre m != null */
+ * @pre m != null
+ */
void register(Form f, FormModel m);
/* Properties that will get copied straight to the output,
diff --git a/ccm-core/src/com/arsdigita/bebop/ModalContainer.java b/ccm-core/src/com/arsdigita/bebop/ModalContainer.java
index 93c30a4c8..568ad687b 100755
--- a/ccm-core/src/com/arsdigita/bebop/ModalContainer.java
+++ b/ccm-core/src/com/arsdigita/bebop/ModalContainer.java
@@ -26,7 +26,7 @@ import java.util.Iterator;
import org.apache.log4j.Logger;
/**
- * A modal container is a container that manages visibility for a set of
+ * ModalContainer is a container that manages visibility for a set of
* components. It allows only one of its children to be visible. One of its
* children can be selected as the default visible component. If none is
* selected the child with index equal to zero is used. The modal container
@@ -53,6 +53,19 @@ public class ModalContainer extends SimpleContainer implements Resettable {
super(tagName, xmlns);
}
+ /**
+ * Registers state parameters for the page with its model.
+ *
+ * Used here to set the visibility of the component.
+ *
+ * The super class' method is empty, so the rule "Always call
+ * super.register when you override register
+ * doessn't apply here.
+ *
+ * @pre p != null
+ * @param p
+ */
+ @Override
public void register(Page p) {
Assert.isUnlocked(this);
diff --git a/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java b/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java
index b318dd97a..903804865 100755
--- a/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java
+++ b/ccm-core/src/com/arsdigita/bebop/SimpleComponent.java
@@ -68,10 +68,50 @@ public class SimpleComponent extends Completable
return result;
}
+ /**
+ * Registers state parameters for the page with its model. Documentation
+ * from Interface Componment:
+ *
+ * A simple component with a state parameter param would do
+ * the following in the body of this method:
+ *
+ * p.addComponent(this); + * p.addComponentStateParam(this, param); + *+ * + * You should override this method to set the default visibility + * of your component: + * + *
+ * public void register(Page p) {
+ * super.register(p);
+ * p.setVisibleDefault(childNotInitiallyShown,false);
+ * p.setVisibleDefault(anotherChild, false);
+ * }
+ *
+ *
+ * Always call super.register when you override
+ * register. Otherwise your component may
+ * malfunction and produce errors like "Widget ... isn't
+ * associated with any Form"
+ *
+ * @pre p != null
+ * @param p
+ */
public void register(Page p) {
return;
}
+ /**
+ * Registers form parameters with the form model for this form.
+ * This method is only important for {@link FormSection form sections}
+ * and {@link com.arsdigita.bebop.form.Widget widgets} (components that
+ * have a connection to an HTML form). Other components can implement it
+ * as a no-op.
+ *
+ * @pre f != null
+ * @pre m != null
+ */
public void register(Form f, FormModel m) {
return;
}