Package javax.swing.text.html

Examples of javax.swing.text.html.StyleSheet


            }
        };
       
        // set font size manually in an effort to get fonts in this panel to look
        // similar to what is in the 'String View' content viewer.
        StyleSheet ss = editorKit.getStyleSheet();
        ss.addRule("body {font-size: 8.5px;}"); //NON-NLS
       
        extractedTextPane.setEditorKit(editorKit);

        sourceComboBox.addItemListener(new ItemListener() {
            @Override
View Full Code Here


        messageDetailsPane.setContentType("text/html"); //NON-NLS
        viewArtifactButton.setEnabled(false);
        viewContentButton.setEnabled(false);
        HTMLEditorKit kit = new HTMLEditorKit();
        messageDetailsPane.setEditorKit(kit);
        StyleSheet styleSheet = kit.getStyleSheet();
        /* I tried to define the font-size only on body to have it inherit,
         * it didn't work in all cases. */
        styleSheet.addRule("body {font-family:Arial;font-size:10pt;}"); //NON-NLS
        styleSheet.addRule("p {font-family:Arial;font-size:10pt;}"); //NON-NLS
        styleSheet.addRule("li {font-family:Arial;font-size:10pt;}"); //NON-NLS
        styleSheet.addRule("table {table-layout:fixed;}"); //NON-NLS
        styleSheet.addRule("td {white-space:pre-wrap;overflow:hidden;}"); //NON-NLS
        styleSheet.addRule("th {font-weight:bold;}"); //NON-NLS
       
        BlackboardResultViewer v = Lookup.getDefault().lookup(BlackboardResultViewer.class);
        v.addOnFinishedListener(new PropertyChangeListener() {

            @Override
View Full Code Here

    public static void configureTextPaneAsHtml(JTextPane pane) {
        pane.setContentType("text/html;charset=UTF-8"); //NON-NLS
        HTMLEditorKit kit = new HTMLEditorKit();
        pane.setEditorKit(kit);
        StyleSheet styleSheet = kit.getStyleSheet();
        /*
         * I tried to play around with inheritence on font-size and it didn't
         * always work. Defined all of the basics just in case. @@@
         * IngestInboxViewer also defines styles similar to this. Consider a
         * method that sets consistent styles for all viewers and takes font
         * size as an argument.
         */
        styleSheet.addRule("body {font-family:Arial, 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック','MS PGothic',sans-serif;font-size:14pt;}"); //NON-NLS
        styleSheet.addRule("p {font-family:Arial, 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック','MS PGothic',sans-serif;font-size:14pt;}"); //NON-NLS
        styleSheet.addRule("li {font-family:Arial, 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック','MS PGothic',sans-serif;font-size:14pt;}"); //NON-NLS
        styleSheet.addRule("td {font-family:Arial, 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック','MS PGothic',sans-serif;font-size:14pt;overflow:hidden;padding-right:5px;padding-left:5px;}"); //NON-NLS
        styleSheet.addRule("th {font-family:Arial, 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック','MS PGothic',sans-serif;font-size:14pt;overflow:hidden;padding-right:5px;padding-left:5px;font-weight:bold;}"); //NON-NLS
        styleSheet.addRule("p {font-family:Arial, 'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック','MS PGothic',sans-serif;font-size:14pt;}"); //NON-NLS
    }
View Full Code Here

TOP

Related Classes of javax.swing.text.html.StyleSheet

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.