Package org.apache.wicket

Examples of org.apache.wicket.Component$ComponentBorderChange


   * @return form to submit or {@code null} if none found
   */
  protected Form<?> findForm()
  {
    // try to find form in the hierarchy of owning component
    Component component = getComponent();
    if (component instanceof Form<?>)
    {
      return (Form<?>)component;
    }
    else
    {
      return component.findParent(Form.class);
    }
  }
View Full Code Here


      TraceSlot slot = i.next();
      result.append("\n").append(spaces).append(slot.fieldDescription);
      result.append(" [class=").append(slot.object.getClass().getName());
      if (slot.object instanceof Component)
      {
        Component component = (Component)slot.object;
        result.append(", path=").append(component.getPath());
      }
      result.append("]");
    }
    result.append(" <----- field that is not serializable");
    return result.toString();
View Full Code Here

    componentsFrozen = true;

    // process component markup
    for (Map.Entry<String, Component> stringComponentEntry : markupIdToComponent.entrySet())
    {
      final Component component = stringComponentEntry.getValue();
      // final String markupId = stringComponentEntry.getKey();

      if (!containsAncestorFor(component))
      {
        writeComponent(response, component.getAjaxRegionMarkupId(), component, encoding);
      }
    }

    if (header != null)
    {
View Full Code Here

  void detach(IRequestCycle requestCycle)
  {
    Iterator<Component> iterator = markupIdToComponent.values().iterator();
    while (iterator.hasNext())
    {
      final Component component = iterator.next();
      final Page parentPage = component.findParent(Page.class);
      if (parentPage != null)
      {
        parentPage.detach();
        break;
      }
View Full Code Here

   *      the component which ancestors should be checked.
   * @return <code>true</code> if target contains an ancestor for the given component
   */
  protected boolean containsAncestorFor(Component component)
  {
    Component cursor = component.getParent();
    while (cursor != null)
    {
      if (markupIdToComponent.containsValue(cursor))
      {
        return true;
      }
      cursor = cursor.getParent();
    }
    return false;
  }
View Full Code Here

      {
        path =  componentIdPageId + path;
      }
    }

    Component component = getLastRenderedPage().get(path);
    if (component == null)
    {
      fail("path: '" + path + "' does not exist for page: " +
        getLastRenderedPage().getClass().getSimpleName());
      return null;
    }

    if (!wantVisibleInHierarchy || component.isVisibleInHierarchy())
    {
      return component;
    }

    // Not found or not visible
View Full Code Here

   *            expected component class
   * @return a <code>Result</code>
   */
  public <C extends Component> Result isComponent(String path, Class<C> expectedComponentClass)
  {
    Component component = getComponentFromLastRenderedPage(path);
    if (component == null)
    {
      return Result.fail("Component not found: " + path);
    }

    return isTrue("component '" + component.getClass().getSimpleName() + "' is not type:" +
      expectedComponentClass.getSimpleName(),
      expectedComponentClass.isAssignableFrom(component.getClass()));
  }
View Full Code Here

   */
  public Result isVisible(final String path)
  {
    final Result result;

    Component component = getComponentFromLastRenderedPage(path, false);
    if (component == null)
    {
      result = Result.fail("path: '" + path + "' does no exist for page: " +
        getLastRenderedPage().getClass().getSimpleName());
    }
    else
    {
      result = isTrue("component '" + path + "' is not visible",
        component.isVisibleInHierarchy());
    }

    return result;
  }
View Full Code Here

   */
  public Result isInvisible(final String path)
  {
    final Result result;

    Component component = getComponentFromLastRenderedPage(path, false);
    if (component == null)
    {
      result = Result.fail("path: '" + path + "' does no exist for page: " +
        getLastRenderedPage().getClass().getSimpleName());
    }
    else
    {
      result = isFalse("component '" + path + "' is visible",
        component.isVisibleInHierarchy());
    }

    return result;
  }
View Full Code Here

   *            path to component
   * @return a <code>Result</code>
   */
  public Result isEnabled(final String path)
  {
    Component component = getComponentFromLastRenderedPage(path);
    if (component == null)
    {
      fail("path: '" + path + "' does no exist for page: " +
        getLastRenderedPage().getClass().getSimpleName());
    }

    return isTrue("component '" + path + "' is disabled", component.isEnabledInHierarchy());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.Component$ComponentBorderChange

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.