Package org.apache.wicket.Component

Examples of org.apache.wicket.Component.IVisitor


          }
        }
        else if (formComponent instanceof CheckGroup)
        {
          final Collection checkGroupValues = (Collection)formComponent.getModelObject();
          formComponent.visitChildren(Check.class, new IVisitor()
          {
            public Object component(Component component)
            {
              if (checkGroupValues.contains(component.getModelObject()))
              {
                addFormComponentValue(formComponent, ((Check)component).getValue());
              }
              return CONTINUE_TRAVERSAL;
            }
          });
        }
        else if (formComponent instanceof RadioGroup)
        {
          // TODO 1.5: see if all these transformations can be factored out into
          // checkgroup/radiogroup by them implementing some sort of interface {
          // getValue(); } otherwise all these implementation details leak into the tester
          final Object value = formComponent.getModelObject();
          if (value != null)
          {
            formComponent.visitChildren(Radio.class, new IVisitor()
            {
              public Object component(Component component)
              {
                if (value.equals(component.getModelObject()))
                {
View Full Code Here


        // edit catalogMode value
        final FormTester form = tester.newFormTester("catalogModeForm");

        form.select("catalogMode", 1);

        form.getForm().visitChildren(RadioChoice.class, new IVisitor() {
            public Object component(final Component component) {
                if (component.getId().equals("catalogMode")) {
                    ((RadioChoice) component).onSelectionChanged();
                }
                return CONTINUE_TRAVERSAL;
View Full Code Here

  {
    final List data = new ArrayList();

    if (page != null)
    {
      page.visitChildren(new IVisitor()
      {
        public Object component(final Component component)
        {
          final ComponentData object = new ComponentData();
View Full Code Here

          }
        }
        else if (formComponent instanceof CheckGroup)
        {
          final Collection checkGroupValues = (Collection) formComponent.getModelObject();
          formComponent.visitChildren(Check.class, new IVisitor()
          {
            public Object component(Component component)
            {
              if (checkGroupValues.contains(component.getModelObject()))
              {
View Full Code Here

      if (component instanceof MarkupContainer)
      {
        MarkupContainer container = (MarkupContainer)component;

        // collect feedback
        container.visitChildren(IFeedback.class, new IVisitor()
        {
          public Object component(Component component)
          {
            ((IFeedback)component).updateFeedback();
            return IVisitor.CONTINUE_TRAVERSAL;
          }
        });
      }

      if (component instanceof IFeedback)
      {
        ((IFeedback)component).updateFeedback();
      }
    }

    // we need to attach feedback components here because they are not
    // attached in MarkupContainer#attachChildren()
    it = markupIdToComponent.values().iterator();
    while (it.hasNext())
    {
      final Component component = (Component)it.next();

      if (component instanceof IFeedback)
      {
        component.attach();
      }

      if (component instanceof MarkupContainer)
      {
        MarkupContainer container = (MarkupContainer)component;

        // collect feedback
        container.visitChildren(IFeedback.class, new IVisitor()
        {
          public Object component(Component component)
          {
            component.attach();
            return IVisitor.CONTINUE_TRAVERSAL;
View Full Code Here

        // collect feedback
        if (component instanceof MarkupContainer)
        {
          MarkupContainer container = (MarkupContainer)component;

          container.visitChildren(IFeedback.class, new IVisitor()
          {
            public Object component(Component component)
            {
              ((IFeedback)component).updateFeedback();
              return IVisitor.CONTINUE_TRAVERSAL;
View Full Code Here

          }
        }
        else if (formComponent instanceof CheckGroup)
        {
          final Collection checkGroupValues = (Collection) formComponent.getModelObject();
          formComponent.visitChildren(Check.class, new IVisitor()
          {
            public Object component(Component component)
            {
              if (checkGroupValues.contains(component.getModelObject()))
              {
View Full Code Here

      if (component instanceof MarkupContainer)
      {
        MarkupContainer container = (MarkupContainer)component;

        // collect feedback
        container.visitChildren(IFeedback.class, new IVisitor()
        {
          public Object component(Component component)
          {
            ((IFeedback)component).updateFeedback();
            return IVisitor.CONTINUE_TRAVERSAL;
          }
        });
      }

      if (component instanceof IFeedback)
      {
        ((IFeedback)component).updateFeedback();
      }
    }

    // we need to attach feedback components here because they are not
    // attached in MarkupContainer#attachChildren()
    it = markupIdToComponent.values().iterator();
    while (it.hasNext())
    {
      final Component component = (Component)it.next();

      if (component instanceof IFeedback)
      {
        component.attach();
      }

      if (component instanceof MarkupContainer)
      {
        MarkupContainer container = (MarkupContainer)component;

        // collect feedback
        container.visitChildren(IFeedback.class, new IVisitor()
        {
          public Object component(Component component)
          {
            component.attach();
            return IVisitor.CONTINUE_TRAVERSAL;
View Full Code Here

   *
   * @param target
   */
  private void addFeedbackPanels(final AjaxRequestTarget target)
  {
    getComponent().getPage().visitChildren(IFeedback.class, new IVisitor()
    {
      public Object component(Component component)
      {
        target.addComponent(component);
        return IVisitor.CONTINUE_TRAVERSAL;
View Full Code Here

   * @param throttleDelay
   */
  public static void addToAllFormComponents(final Form form, final String event,
      final Duration throttleDelay)
  {
    form.visitChildren(FormComponent.class, new IVisitor()
    {
      public Object component(Component component)
      {
        AjaxFormValidatingBehavior behavior = new AjaxFormValidatingBehavior(form, event);
        if (throttleDelay != null)
View Full Code Here

TOP

Related Classes of org.apache.wicket.Component.IVisitor

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.