Package flow.netbeans.markdown.api

Examples of flow.netbeans.markdown.api.Renderable


            });
        }
    }

    private String renderPreview() {
        Renderable renderable = context.lookup(Renderable.class);
        String previewText;
        try {
            Set<RenderOption> renderOptions = EnumSet.of(
                    RenderOption.PREFER_EDITOR,
                    RenderOption.RESOLVE_IMAGE_URLS);
            if (!htmlView.isHtmlFullySupported()) {
                renderOptions.add(RenderOption.SWING_COMPATIBLE);
            }
            previewText = renderable.renderAsHtml(renderOptions);
        } catch (IOException ex) {
            previewText = "Preview rendering failed: " + ex.getMessage();
        }
        return previewText;
    }
View Full Code Here


    }

    @Override
    public void actionPerformed(ActionEvent ev) {
        try {
            Renderable renderable = context.getLookup().lookup(Renderable.class);

            Set<RenderOption> renderOptions = EnumSet.of(
                    RenderOption.PREFER_EDITOR,
                    RenderOption.RESOLVE_IMAGE_URLS);
            String htmlText = renderable.renderAsHtml(renderOptions);

            File temp = File.createTempFile("preview-" + context.getPrimaryFile().getName(), ".html");
            temp.deleteOnExit();

            // get file encoding
View Full Code Here

    }

    @Override
    public void actionPerformed(ActionEvent ev) {
        try {
            Renderable renderable = context.getLookup().lookup(Renderable.class);

            Set<RenderOption> renderOptions = Collections.emptySet();
            String htmlText = renderable.renderAsHtml(renderOptions);
            String saveTo = MarkdownGlobalOptions.getInstance()
                    .isSaveInSourceDir() ? context.getPrimaryFile()
                            .getParent().getPath() : "user.home";
            JFileChooser fileChooser = new JFileChooser(saveTo);
            int option = fileChooser.showSaveDialog(fileChooser);
View Full Code Here

TOP

Related Classes of flow.netbeans.markdown.api.Renderable

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.