Another possibility:

/**
* A panel whose visibility is on iff at least one of its subcomponents is visible.
 */
public class Envelope extends Panel
{
  private static final long serialVersionUID = -6422145787799831814L;

  public Envelope(String id)
  {
    super(id);
  }

  public Envelope(String id, IModel model)
  {
    super(id, model);
  }

  @Override
  public boolean isVisible()
  {
    boolean visible = false;

    for (Iterator<Component> it = iterator(); it.hasNext();)
    {
      Component child = it.next();
      if (child.isVisible())
        visible = true;
    }
    return visible && super.isVisible();
  }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to