Package org.apache.wicket.behavior

Examples of org.apache.wicket.behavior.Behavior


        add(feedbackPanel);

        final String kind = getClass().getSimpleName().toLowerCase();
        final BookmarkablePageLink kindLink = (BookmarkablePageLink) get(kind);
        if (kindLink != null) {
            kindLink.add(new Behavior() {

                private static final long serialVersionUID = 1469628524240283489L;

                @Override
                public void onComponentTag(final Component component, final ComponentTag tag) {

                    tag.put("class", kind);
                }
            });

            Component kindIcon = kindLink.get(0);
            if (kindIcon != null) {
                kindIcon.add(new Behavior() {

                    private static final long serialVersionUID = 1469628524240283489L;

                    @Override
                    public void onComponentTag(final Component component, final ComponentTag tag) {
View Full Code Here


            }
        };

        // Add class to specify relative position of the link.
        // Position depends on result pages number.
        displayAttrsLink.add(new Behavior() {

            private static final long serialVersionUID = 1469628524240283489L;

            @Override
            public void onComponentTag(final Component component, final ComponentTag tag) {
View Full Code Here

   */
  public void remove(final IFormValidator validator)
  {
    Args.notNull(validator, "validator");

    Behavior match = null;
    for (Behavior behavior : getBehaviors())
    {
      if (behavior.equals(validator))
      {
        match = behavior;
View Full Code Here

    for (int i = component.data_start(); i < len; i++)
    {
      Object obj = component.data_get(i);
      if (obj != null && obj instanceof Behavior)
      {
        final Behavior behavior = (Behavior)obj;

        behavior.detach(component);

        if (behavior.isTemporary(component))
        {
          internalRemove(behavior);
        }
      }
    }
View Full Code Here

    for (int i = component.data_start(); i < len; i++)
    {
      Object obj = component.data_get(i);
      if (obj != null && obj instanceof Behavior)
      {
        final Behavior behavior = (Behavior)obj;

        behavior.onRemove(component);
      }
    }
  }
View Full Code Here

    return id;
  }

  public final Behavior getBehaviorById(int id)
  {
    Behavior behavior = null;

    ArrayList<Behavior> ids = getBehaviorsIdList(false);
    if (ids != null)
    {
      if (id >= 0 && id < ids.size())
View Full Code Here

      {
        return ((Component)node).getPath();
      }
      else
      {
        Behavior behavior = (Behavior)node;
        Component parent = (Component)this.parent.node;
        String parentPath = parent.getPath();
        int indexOf = parent.getBehaviors().indexOf(behavior);
        return parentPath + Component.PATH_SEPARATOR + "Behavior_" + indexOf;
      }
View Full Code Here

      {
        return ((Component)node).isStateless();
      }
      else
      {
        Behavior behavior = (Behavior)node;
        Component parent = (Component)this.parent.node;
        return behavior.getStatelessHint(parent);
      }
    }
View Full Code Here

   * @return form component for chaining
   */
  public final FormComponent<T> remove(final IValidator<? super T> validator)
  {
    Args.notNull(validator, "validator");
    Behavior match = null;
    for (Behavior behavior : getBehaviors())
    {
      if (behavior.equals(validator))
      {
        match = behavior;
View Full Code Here

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

      // Apply behavior modifiers
      List<? extends Behavior> behaviors = getBehaviors();
      if ((behaviors != null) && !behaviors.isEmpty() && !tag.isClose() &&
        (isIgnoreAttributeModifier() == false))
      {
        tag = tag.mutable();
        for (Behavior behavior : behaviors)
        {
          // Components may reject some behavior components
          if (isBehaviorAccepted(behavior))
          {
            behavior.onComponentTag(this, tag);
          }
        }
      }

      if ((tag instanceof WicketTag) && !tag.isClose() &&
View Full Code Here

TOP

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

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.