Package com.vaadin.ui

Examples of com.vaadin.ui.PopupView$Content


        //
        //  Go through the children
        //
        for( Iterator i = ce.getContent().iterator(); i.hasNext(); )
        {
            Content c = (Content)i.next();
           
            if( c instanceof PluginContent )
            {
                PluginContent pc = (PluginContent)c;
               
View Full Code Here


            //
            //  In many cases these are the same.  [linktext|linkref].
            //
            if( VariableManager.isVariableLink( linktext ) )
            {
                Content el = new VariableContent(linktext);

                addElement( el );
            }
            else if( isExternalLink( linkref ) )
            {
View Full Code Here

            int idxOfFirstContent = 0;
            int count = 0;

            for( Iterator i = kids.iterator(); i.hasNext(); count++ )
            {
                Content c = (Content) i.next();
                if( c instanceof Element )
                {
                    String name = ((Element)c).getName();
                    if( isBlockLevel(name) ) break;
                }

                if( !(c instanceof ProcessingInstruction) )
                {
                    ls.add( c );
                    if( idxOfFirstContent == 0 ) idxOfFirstContent = count;
                }
            }

            //
            //  If there were any elements, then add a new <p> (unless it would
            //  be an empty one)
            //
            if( ls.size() > 0 )
            {
                Element newel = new Element("p");

                for( Iterator i = ls.iterator(); i.hasNext(); )
                {
                    Content c = (Content) i.next();

                    c.detach();
                    newel.addContent(c);
                }

                //
                // Make sure there are no empty <p/> tags added.
View Full Code Here

          xsw.close();
          String expect = sw.toString();
         
          StAXStreamBuilder sbuilder = new StAXStreamBuilder();
         
      Content backagain = sbuilder.fragment(
          sinfactory.createXMLStreamReader(new StringReader(expect)));

      // convert the input to a SAX Stream

      sw.getBuffer().setLength(0);
          xsw = soutfactory.createXMLStreamWriter(sw);
          switch(content.getCType()) {
            case CDATA :
                  xout.output((CDATA)backagain, xsw);
                  break;
            case Text:
                  xout.output((Text)backagain, xsw);
                  break;
            case Comment:
                  xout.output((Comment)backagain, xsw);
                  break;
            case DocType:
                  xout.output((DocType)backagain, xsw);
                  break;
            case Element:
                  xout.output((Element)backagain, xsw);
                  break;
            case EntityRef:
                  xout.output((EntityRef)backagain, xsw);
                  break;
            case ProcessingInstruction:
                  xout.output((ProcessingInstruction)backagain, xsw);
                  break;
            default:
              throw new IllegalStateException(backagain.getCType().toString());
          }
          xsw.close();
         
          String actual = sw.toString();
          assertEquals(expect, actual);
View Full Code Here

      // OK, we have text-like content to push back.
      // and it still has values in it.
      // advance the cursor
      multitext.mpos++;
     
      final Content ret = multitext.ctext[multitext.mpos] == null
          ? multitext.data[multitext.mpos] : null;

     
      // we can calculate the hasnext
      hasnext = multitext.mpos + 1 < multitext.msize ||
          multitext.nextcursor < size;
     
      // return null to indicate text content.
      return ret;
    }
   
    // non-text, increment and return content.
    final Content ret = content.get(cursor++);
   
    // OK, we are returning some content.
    // we need to determine the state of the next loop.
    // cursor at this point has been advanced!
    if (cursor >= size) {
View Full Code Here

      Format format, CDATA cdata) {
    final List<CDATA> list = Collections.singletonList(cdata);
    final FormatStack fstack = new FormatStack(format);
    final Walker walker = buildWalker(fstack, list, false);
    if (walker.hasNext()) {
      final Content c = walker.next();
      if (c == null) {
        return printCDATA(fstack, basedoc, new CDATA(walker.text()));
      }
      if (c.getCType() == CType.CDATA) {
        return printCDATA(fstack, basedoc, (CDATA)c);
      }
    }
    // return an empty string if nothing happened.
    return null;
View Full Code Here

      Format format, Text text) {
    final List<Text> list = Collections.singletonList(text);
    final FormatStack fstack = new FormatStack(format);
    final Walker walker = buildWalker(fstack, list, false);
    if (walker.hasNext()) {
      final Content c = walker.next();
      if (c == null) {
        return printText(fstack, basedoc, new Text(walker.text()));
      }
      if (c.getCType() == CType.Text) {
        return printText(fstack, basedoc, (Text)c);
      }
    }
    // return an empty string if nothing happened.
    return null;
View Full Code Here

    final int sz = doc.getContentSize();
   
    if (sz > 0) {
      for (int i = 0; i < sz; i++) {
        final Content c = doc.getContent(i);
        org.w3c.dom.Node n = null;
        switch (c.getCType()) {
          case Comment :
            n = printComment(fstack, basedoc, (Comment)c);
            break;
          case DocType :
            // cannot simply add a DocType to a DOM object
View Full Code Here

  protected void printContent(final FormatStack fstack,
      final NamespaceStack nstack, final org.w3c.dom.Document basedoc,
      final org.w3c.dom.Node target, final Walker walker) {

    while (walker.hasNext()) {
      final Content c = walker.next();
      org.w3c.dom.Node n = null;
      if (c == null) {
        // Formatted Text or CDATA
        final String text = walker.text();
        if (walker.isCDATA()) {
View Full Code Here

      final CDATA cdata) throws XMLStreamException {
    final List<CDATA> list = Collections.singletonList(cdata);
    final FormatStack fstack = new FormatStack(format);
    final Walker walker = buildWalker(fstack, list, false);
    if (walker.hasNext()) {
      final Content c = walker.next();
      if (c == null) {
        printCDATA(out, fstack, new CDATA(walker.text()));
      } else if (c.getCType() == CType.CDATA) {
        printCDATA(out, fstack, (CDATA)c);
      }
    }
    out.flush();
  }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.PopupView$Content

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.