Package org.apache.wicket.behavior

Examples of org.apache.wicket.behavior.IBehavior


    List behaviors = getBehaviorsImpl();
    if (behaviors != null)
    {
      for (Iterator i = behaviors.iterator(); i.hasNext();)
      {
        IBehavior behavior = (IBehavior)i.next();
        if (isBehaviorAccepted(behavior))
        {
          behavior.beforeRender(this);
        }
      }
    }
  }
View Full Code Here


    List behaviors = getBehaviorsImpl();
    if (behaviors != null)
    {
      for (Iterator i = behaviors.iterator(); i.hasNext();)
      {
        IBehavior behavior = (IBehavior)i.next();
        if (isBehaviorAccepted(behavior))
        {
          behavior.afterRender(this);
        }
      }
    }
  }
View Full Code Here

      {
        tag = tag.mutable();

        for (Iterator i = behaviors.iterator(); i.hasNext();)
        {
          IBehavior behavior = (IBehavior)i.next();

          // Components may reject some behavior components
          if (isBehaviorAccepted(behavior))
          {
            behavior.onComponentTag(this, tag);
          }
        }
      }

      // apply behaviors that are attached to the component tag.
      if (tag.hasBehaviors())
      {
        Iterator tagBehaviors = tag.getBehaviors();
        while (tagBehaviors.hasNext())
        {
          final IBehavior behavior = (IBehavior)tagBehaviors.next();
          behavior.onComponentTag(this, tag);
        }
      }

      // Write the tag
      tag.writeOutput(getResponse(), stripWicketTags, findMarkupStream().getWicketNamespace());
View Full Code Here

    // matches the event parameter.
    AjaxEventBehavior ajaxEventBehavior = null;
    List behaviors = component.getBehaviors();
    for (Iterator iter = behaviors.iterator(); iter.hasNext();)
    {
      IBehavior behavior = (IBehavior)iter.next();

      // AjaxEventBehavior is the one to look for
      if (behavior instanceof AjaxEventBehavior)
      {
        AjaxEventBehavior tmp = (AjaxEventBehavior)behavior;
View Full Code Here

      }
      else
      {
        try
        {
          IBehavior behavior = getComponent().getBehaviors().get(behaviorIndex);
          listenerInterface.invoke(getComponent(), behavior);
        }
        catch (IndexOutOfBoundsException e)
        {
          throw new WicketRuntimeException("Couldn't find component behavior.");
View Full Code Here

      if (tag.hasBehaviors())
      {
        Iterator<? extends IBehavior> tagBehaviors = tag.getBehaviors();
        while (tagBehaviors.hasNext())
        {
          final IBehavior behavior = tagBehaviors.next();
          if (behavior.isEnabled(this))
          {
            behavior.onComponentTag(this, tag);
          }
          behavior.detach(this);
        }
      }

      // Write the tag
      tag.writeOutput(getResponse(), !needToRenderTag(null),
View Full Code Here

    IBehaviorListener behaviorListener = null;

    if (behaviors.size() > idAsInt)
    {
      IBehavior behavior = behaviors.get(idAsInt);
      if (behavior instanceof IBehaviorListener)
      {
        behaviorListener = (IBehaviorListener)behavior;
      }
    }
View Full Code Here

      if (tag.hasBehaviors())
      {
        Iterator<? extends IBehavior> tagBehaviors = tag.getBehaviors();
        while (tagBehaviors.hasNext())
        {
          final IBehavior behavior = tagBehaviors.next();
          if (behavior.isEnabled(this))
          {
            behavior.onComponentTag(this, tag);
          }
          behavior.detach(this);
        }
      }

      // Write the tag
      tag.writeOutput(getResponse(), !needToRenderTag(null),
View Full Code Here

  }

  /** {@inheritDoc} */
  public final IBehavior getBehaviorById(int id)
  {
    IBehavior behavior = null;

    ArrayList<IBehavior> ids = getMetaData(BEHAVIOR_IDS);
    if (ids != null)
    {
      if (id >= 0 && id < ids.size())
View Full Code Here

    }
    else
    {
      try
      {
        IBehavior behavior = getComponent().getBehaviorById(behaviorId);
        listenerInterface.invoke(getComponent(), behavior);
      }
      catch (IndexOutOfBoundsException e)
      {
        throw new WicketRuntimeException("Couldn't find component behavior.");
View Full Code Here

TOP

Related Classes of org.apache.wicket.behavior.IBehavior

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.