Package com.uwyn.jhighlight.renderer

Examples of com.uwyn.jhighlight.renderer.Renderer


        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n",
          "<br />");
      }
View Full Code Here


        if (f.getName().endsWith(".java")) {
            BufferedReader br = null;
            try {
                br = new BufferedReader(new FileReader(f));
                String sourceIn = IOHelper.readEntirely(br);
                Renderer r = new JavaXhtmlRenderer();
                String sourceDecorated = r.highlight(f.getName(), sourceIn, "UTF-8", false);
                return new StringReader(sourceDecorated);
            } catch (IOException ioe) {
                LOGGER.debug("cannot decorate java file " + f);
                return new FileReader(f);
            } finally {
View Full Code Here

        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n",
          "<br />");
      }
View Full Code Here

        }
        int lastDot = name.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = name.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(name, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true).toString().replaceAll("\n",
            "<br />");
      }
View Full Code Here

        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true)
          .toString()
          .replaceAll("\n", "<br />");
View Full Code Here

        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            ByteArrayOutputStream output = new ByteArrayOutputStream();
            renderer.highlight(source, resourceAsStream, output, "UTF-8", true);
            return output.toString("UTF-8");
          }
        }

        CharSequence escaped = Strings.escapeMarkup(IOUtils.toString(resourceAsStream),
View Full Code Here

        }

        String path = (String)getValue(comp, bean);
        String sourceType = path.substring(path.lastIndexOf('.') + 1, path.length());

        Renderer hlight;

        if (sourceType.equals("xhtml")) {
            hlight = new HighlightXhtmlSource();
        }
        else if (sourceType.equals("java")) {
View Full Code Here

        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true)
          .toString()
          .replaceAll("\n", "<br />");
View Full Code Here

        }
        int lastDot = source.lastIndexOf('.');
        if (lastDot != -1)
        {
          String type = source.substring(lastDot + 1);
          Renderer renderer = XhtmlRendererFactory.getRenderer(type);
          if (renderer != null)
          {
            return renderer.highlight(source, sb.toString(), "UTF-8", true);
          }
        }
        return Strings.escapeMarkup(sb.toString(), false, true)
          .toString()
          .replaceAll("\n", "<br />");
View Full Code Here

        }

        String path = (String)getValue(bean);
        String sourceType = path.substring(path.lastIndexOf('.') + 1, path.length());

        Renderer hlight;

        if (sourceType.equals("xhtml")) {
            hlight = new HighlightXhtmlSource();
        }
        else if (sourceType.equals("java")) {
View Full Code Here

TOP

Related Classes of com.uwyn.jhighlight.renderer.Renderer

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.