Examples of HtmlWriter


Examples of org.apache.empire.struts2.html.HtmlWriter

        TableHeadRowTag.HeadRowInfo hri = getHeadRowInfo();
        // HtmlWriter
        HtmlTagDictionary dic = HtmlTagDictionary.getInstance();
        orderIndicator = getSortOrderIdicator(hri, dic);
        // Start Tag
        HtmlWriter w = new HtmlWriter(pageContext.getOut());
        HtmlTag wrap = w.startTag(dic.TableHeadColumnTag());
        wrap.addAttribute("id", getId());
        wrap.addAttribute("class", getCssClass(hri));
        setStyleAndWrap(wrap, hri);
        wrap.addAttribute("width", width);
        wrap.addAttribute("height", height);
        wrap.addAttribute("colspan", colspan);
        wrap.addAttribute("rowspan", rowspan);
        wrap.addAttribute("align", str(align, hri.columnAlign));
        wrap.addAttribute("valign", valign);
        wrap.addAttribute("bgcolor", bgcolor);
        // Body
        wrap.beginBody();
        if (prepareLinkParams(hri))
        {   // The Anchor
            this.cssClass = getLinkClass(hri, dic);
            this.cssStyle = null;
            // OnClick
            if (onclick== null)
                onclick = dic.TableHeadLinkDefaultOnClickScript();
            // render column choices
            if (select!=null)
            {
               renderColumnSelect(w);
               text = "";
            }
            // Start the tag
            super.doStartTag();
            // Add Sort Param
            AnchorComponent anchor = (AnchorComponent)component;
            anchor.addParameter(hri.sortColumnParam, getColumnName());
            if (hri.sortOrderChangeable && hri.sortOrderParam!=null)
            {
                anchor.addParameter(hri.sortOrderParam, (hri.sortDescending) ? "0" : "1");
            }
            // render Link
            super.doEndTag();
        }
        else
        {   // The value
            HtmlTag text = w.startTag("span"); // dic.AnchorDisabledTag()
            text.addAttribute("class", getLinkClass(hri, dic));
            text.beginBody(getColumnTitle());
            text.endTag(getBody());
        }
        // Don't call base class

Examples of org.apache.tapestry.html.HTMLWriter

        }

        HttpServletResponse response = context.getResponse();
        PrintWriter servletWriter = response.getWriter();

        IMarkupWriter writer = new HTMLWriter(servletWriter);

        writer.print(URI);

        writer.flush();
    }

Examples of org.apache.tapestry.html.HTMLWriter

        }}

        __CLOVER_105_0.S[2515]++;HttpServletResponse response = context.getResponse();
        __CLOVER_105_0.S[2516]++;PrintWriter servletWriter = response.getWriter();

        __CLOVER_105_0.S[2517]++;IMarkupWriter writer = new HTMLWriter(servletWriter);

        __CLOVER_105_0.S[2518]++;writer.print(URI);

        __CLOVER_105_0.S[2519]++;writer.flush();
    } finally { }}

Examples of org.apache.tapestry.html.HTMLWriter

        String URI = link.getURL();

        HttpServletResponse response = context.getResponse();
        PrintWriter servletWriter = response.getWriter();

    IMarkupWriter writer = new HTMLWriter(servletWriter);
   
    writer.print(URI);
   
    writer.flush();
    }

Examples of org.dom4j.io.HTMLWriter

                   
        OutputStream out = new FileOutputStream(name);
       
        boolean isHtml = outputMode != null && outputMode.equalsIgnoreCase( "html" );
        final XMLWriter xmlWriter = (isHtml)
            ? new HTMLWriter(out, format)
            : new XMLWriter(out, format);

        XMLOutput answer = new XMLOutput() {
            public void close() throws IOException {
                xmlWriter.close();

Examples of simtools.ui.HTMLWriter

        // Write toc_jsynoptic.html
        try{
            File indexFile = new File(outputDirectory, TOC_FILE_NAME);
            FileWriter writeFile= new FileWriter(indexFile);
            BufferedWriter writeBuf = new BufferedWriter(writeFile);   
            HTMLWriter writer = new HTMLWriter(writeBuf);
            writer.writeHtmlBegin();
            writer.writeBodyBegin();
           
            writer.writeHeadBegin();
            writer.writeTitle("JSynoptic Help");
            writer.writeHeadEnd();
           
            writer.writeH1("JSynoptic Help", null);

            // write the help index of contents
            createIndexOfContentsHTMLFiles(helpContents, writer);

            writer.writeBodyEnd();
            writer.writeHtmlEnd();
            writeBuf.close();
            writeFile.close();
            _logger.fine("File "+ TOC_FILE_NAME  + " successfully created at " + outputDirectory);

        } catch (IOException  e){
            _logger.severe("Cannot write index.html content. Reason is \n" + e.getMessage());
        }
       
       
        // Write jsynoptic.html
        try{
            File entryxFile = new File(outputDirectory, ENTRY_FILE_NAME);
            FileWriter writeFile= new FileWriter(entryxFile);
            BufferedWriter writeBuf = new BufferedWriter(writeFile);   
            HTMLWriter writer = new HTMLWriter(writeBuf);
            writer.writeHtmlBegin();

            writer.writeHeadBegin();
            writer.writeTitle("JSynoptic Help");
            writer.writeHeadEnd();
           
            writer.writeFrameSetBegin("33%,*");
            writer.writeFrame(TOC_FRAME_NAME, TOC_FILE_NAME);
            writer.writeFrame(CONTENT_FRAME_NAME, CONTENT_FIRST_PAGE_NAME);
           
            writer.writeNoframesBegin();
            writer.writeBodyBegin();
            writer.writeP("You must use a FRAME available browser");
            writer.writeBodyEnd();
            writer.writeNoframesEnd();
           
           
            writer.writeFrameSetEnd();

            writer.writeHtmlEnd();
            writeBuf.close();
            writeFile.close();
            _logger.fine("File "+ ENTRY_FILE_NAME  + " successfully created at " + outputDirectory);

        } catch (IOException  e){

Examples of simtools.ui.HTMLWriter

    ImageIO.write(bi,resources.getString("imageFileExtension"),_imageFile);
    _htmlFile = new File(resources.getString("htmlFileName")).getCanonicalFile();

    FileWriter writeFile= new FileWriter(_htmlFile);
    BufferedWriter writeBuf = new BufferedWriter(writeFile)
    HTMLWriter writer = new HTMLWriter(writeBuf);
    writer.writeHtmlBegin();
    try{
      writer.writeTargetName("IMAGETARGET");
      writer.writeH1(sheetInformationTitle, null);

      // make links with descrition
      String[][] targets = new String[sheet.size()][5];

      for(int i=0;i<sheet.size();i++){
        Object o = sheet.get(i);
        if (o instanceof AbstractShape) {
          AbstractShape shape = (AbstractShape)o;

          // left-x, top-y, right-x, bottom-y
          targets[i][0] = new Integer(shape.getBounds().x).toString();
          targets[i][1] = new Integer(shape.getBounds().y).toString();
          targets[i][2] = new Integer(shape.getBounds().x + CIRCLE_SIZE+4).toString();
          targets[i][3] = new Integer(shape.getBounds().y + CIRCLE_SIZE+4).toString();

          // target name
          targets[i][4] = getShapeId(shape, i);

        }
      }
      // Write image with links
      writer.writeImage(_imageFile.getName(),resources.getString("imageFileTitle"), "IMAGEMAP", targets);
    }catch (IOException e){
      e.printStackTrace();
    }

    // Create sheet information
    for(int i=0;i<sheet.size();i++){
      Object o = sheet.get(i);
      if (o instanceof AbstractShape) {
        AbstractShape shape = (AbstractShape)o;

        // Shape name
        writer.writeTargetName(getShapeId(shape,i));
        writer.writeH2(getShapeId(shape, i),null);

        // Shape properties
        String[] propertiesNames = shape.getPropertyNames();
        ArrayList contents = new ArrayList();
       
        if (propertiesNames!=null){
          for(int j=0;j<propertiesNames.length;j++){
            String[] property = new String[2];
            property[0] = propertiesNames[j];

            Object obj = shape.getPropertyValue(propertiesNames[j]);
            if (obj!=null){
              if (obj instanceof NamedProperties){
                String[] objPropertiesNames = ((NamedProperties)obj).getPropertyNames();
                String objToString="";
                for(int k=0;k<objPropertiesNames.length;k++){
                  objToString+=objPropertiesNames[k] + " = " + ((NamedProperties)obj).getPropertyValue(objPropertiesNames[k]) + "\n";
                }
                property[1] = objToString;
             
              }else if (obj instanceof DataSource){
                property[1] = DataInfo.getAll(obj);
              }else{
                property[1] = obj.toString();
              }
              contents.add(property)
            }
          }
        }
        writer.writeTab(propertyTabTitles, contents);
        writer.writeP(resources.getString("goBackToImage"), "IMAGETARGET");
        writer.writeSeparator();
      }
    }
    writer.writeHtmlEnd();
    writeBuf.close();
    writeFile.close();
   
   
    // set html chooser for saving
TOP
Copyright © 2018 www.massapi.com. 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.