Package org.apache.wicket.Component

Examples of org.apache.wicket.Component.IVisitor


  {
    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

        }
        else
        {
          // try to search downwards to match the id
          // NOTE unfortunately, we can't rely on the path pre 2.0
          Component c = (Component)parent.visitChildren(new IVisitor()
          {
            public Object component(Component component)
            {
              if (component.getId().equals(thisId))
              {
                return component;
              }
              return IVisitor.CONTINUE_TRAVERSAL;
            }
          });
          if (c == null)
          {
            // not found... do a reverse search (upwards)
            c = (Component)parent.visitParents(Component.class, new IVisitor()
            {
              public Object component(Component component)
              {
                if (component.getId().equals(thisId))
                {
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

        // 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

          }
        }
        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

          }
        }
        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

        }
        else
        {
          // try to search downwards to match the id
          // NOTE unfortunately, we can't rely on the path pre 2.0
          Component c = (Component)parent.visitChildren(new IVisitor()
          {
            public Object component(Component component)
            {
              if (component.getId().equals(thisId))
              {
                return component;
              }
              return IVisitor.CONTINUE_TRAVERSAL;
            }
          });
          if (c == null)
          {
            // not found... do a reverse search (upwards)
            c = (Component)parent.visitParents(Component.class, new IVisitor()
            {
              public Object component(Component component)
              {
                if (component.getId().equals(thisId))
                {
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

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.