Package javax.servlet.jsp.tagext

Examples of javax.servlet.jsp.tagext.Tag


    public void setProperty(String property) {
        this.property = property;
    }

    public int doEndTag() throws JspTagException {
        Tag t = findAncestorWithClass(this, TreeTag.class);
        TreeTag parent = (TreeTag) t;
        Condition condition = new Condition();
        condition.setProperty(property);
        condition.setValue(value);
        parent.addCondisiton(condition);
View Full Code Here


    Assert.notNull(ancestorTagClass, "Ancestor tag class cannot be null");
    if (!Tag.class.isAssignableFrom(ancestorTagClass)) {
      throw new IllegalArgumentException(
          "Class '" + ancestorTagClass.getName() + "' is not a valid Tag type");
    }
    Tag ancestor = tag.getParent();
    while (ancestor != null) {
      if (ancestorTagClass.isAssignableFrom(ancestor.getClass())) {
        return true;
      }
      ancestor = ancestor.getParent();
    }
    return false;
  }
View Full Code Here

  }
 
  @Override
  public int doEndTag() throws JspException {
   
    Tag tabbedPaneTag = this.getParent();

    while(tabbedPaneTag != null) {

      if((tabbedPaneTag instanceof TabbedPaneTag)) {
       
        ((TabbedPaneTag)tabbedPaneTag).addTab((Tab)component);
     
        return super.doEndTag();
     
      } else {
       
        tabbedPaneTag = tabbedPaneTag.getParent();
      }
    }
   
    throw new JspTagException("Tab tag must be inside TabbedPane Tag");
 
View Full Code Here

  }
 
  @Override
  public int doEndTag() throws JspException {
   
    Tag accordionTag = this.getParent();

    while(accordionTag != null) {

      if((accordionTag instanceof AccordionTag)) {
       
        ((AccordionTag)accordionTag).addItem((AccordionItem)component);
     
        return super.doEndTag();
     
      } else {
       
        accordionTag = accordionTag.getParent();
      }
    }
   
    throw new JspTagException("AccordionItem tag must be inside Accordion Tag");
 
View Full Code Here

      }
    }.runTest();
  }

  public void testHasAncestorOfTypeTrueScenario() throws Exception {
    Tag a = new TagA();
    Tag b = new TagB();
    Tag c = new TagC();

    a.setParent(b);
    b.setParent(c);

    assertTrue(TagUtils.hasAncestorOfType(a, TagC.class));
View Full Code Here

    assertTrue(TagUtils.hasAncestorOfType(a, TagC.class));
  }

  public void testHasAncestorOfTypeFalseScenario() throws Exception {
    Tag a = new TagA();
    Tag b = new TagB();
    Tag anotherB = new TagB();

    a.setParent(b);
    b.setParent(anotherB);

    assertFalse(TagUtils.hasAncestorOfType(a, TagC.class));
View Full Code Here

  }

  public void testAssertHasAncestorOfTypeThrowsExceptionOnFail() throws Exception {
    new AssertThrows(IllegalStateException.class) {
      public void test() throws Exception {
        Tag a = new TagA();
        Tag b = new TagB();
        Tag anotherB = new TagB();

        a.setParent(b);
        b.setParent(anotherB);

        TagUtils.assertHasAncestorOfType(a, TagC.class, "a", "c");
View Full Code Here

      }
    }.runTest();
  }

  public void testAssertHasAncestorOfTypeDoesNotThrowExceptionOnPass() throws Exception {
    Tag a = new TagA();
    Tag b = new TagB();
    Tag c = new TagC();

    a.setParent(b);
    b.setParent(c);

    TagUtils.assertHasAncestorOfType(a, TagC.class, "a", "c");
View Full Code Here

        // JSF-Spec 1.2 9.4.9
        //    Locate the one and only UIViewRoot custom action instance by walking up the tag tree
        //    until you find a UIComponentELTag instance that has no parent. If the
        //    getCreated() method of this instance returns true, check the binding attribute.

        Tag parent = this;
        UIComponentELTag parentTag = null;
        while ((parent = parent.getParent()) != null) {
            if (parent instanceof UIComponentELTag) {
                parentTag = (UIComponentELTag) parent;
            }
        }
View Full Code Here

     {@inheritDoc}
     */
    @Override
    public int doEndTag()
    {
        Tag t = null;
        do
        {
            t = getParent();
        } while (t != null && !(t instanceof ParamHandler));

View Full Code Here

TOP

Related Classes of javax.servlet.jsp.tagext.Tag

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.