Package javax.swing.text

Examples of javax.swing.text.StyledEditorKit


    public void testGetHTMLEditorKit() {
        assertSame(editorPane.getEditorKit(),
                   action.getHTMLEditorKit(editorPane));

        editorPane.setEditorKit(new StyledEditorKit());
        testExceptionalCase(new IllegalArgumentCase() {
            public void exceptionalAction() throws Exception {
                action.getHTMLEditorKit(editorPane);
            }
        });
View Full Code Here


        } catch (final BadLocationException e) {
            assertFalse("unexpected exception :" + e.getMessage(), true);
        }
        //temporarily commented-out: HTMLEditorKit not implemented
        //jep.setEditorKit(new RTFEditorKit());
        jep.setEditorKit(new StyledEditorKit());
        jep.setDocument(doc);
        jep.setSelectionStart(6);
        jep.setSelectionEnd(7);
        jep.replaceSelection("YYY");
        for (int i = 0; i < doc.getLength(); i++) {
View Full Code Here

    public void testGetAccessibleContext() {
        // TODO: implement
    }

    public void testGetActions() throws Exception {
        Action[] ancestorActions = new StyledEditorKit().getActions();
        Action[] actions = editorKit.getActions();
        assertEquals(12, actions.length - ancestorActions.length);

        Action[] predefinedInsertHTMLTextActions = createPredefinedInsertHTMLTextActions();
        for (int i = 0; i < predefinedInsertHTMLTextActions.length; i++) {
View Full Code Here

        JEditorPane pane = new JEditorPane() {
            private static final long serialVersionUID = 1L;

            @Override
            protected EditorKit createDefaultEditorKit() {
                return new StyledEditorKit();
            }
        };
        assertTrue(pane.getEditorKit() instanceof StyledEditorKit);
    }
View Full Code Here

    public void testCreateDefaultEditorKit_installCall() {
        JEditorPane pane = new JEditorPane() {
            private static final long serialVersionUID = 1L;
        };
        pane.setEditorKit(new StyledEditorKit() {
            private static final long serialVersionUID = 1L;

            @Override
            public void install(JEditorPane component) {
                wasInstallCall = true;
View Full Code Here

        JEditorPane pane = new JEditorPane() {
            private static final long serialVersionUID = 1L;

            @Override
            protected EditorKit createDefaultEditorKit() {
                return new StyledEditorKit();
            }
        };
        pane.setEditorKit(new StyledEditorKit());
        StyledDocument doc = (StyledDocument) pane.getDocument();
        StyledEditorKit kit = (StyledEditorKit) pane.getEditorKit();
        try {
            MutableAttributeSet attrs = new SimpleAttributeSet();
            StyleConstants.setUnderline(attrs, true);
            doc.insertString(0, "Hello word!", attrs);
            pane.setCaretPosition(4);
            attrs = new SimpleAttributeSet();
            StyleConstants.setIcon(attrs, MetalIconFactory.getTreeFolderIcon());
            doc.insertString(4, " ", attrs);
            pane.setCaretPosition(4);
            doc.insertString(4, "\n", kit.getInputAttributes());
            assertFalse(StyleConstants.isUnderline(kit.getInputAttributes()));
            pane.setCaretPosition(5);
            assertFalse(StyleConstants.isUnderline(kit.getInputAttributes()));
        } catch (BadLocationException e) {
        }
    }
View Full Code Here

    new LineNumberArea(this);

    LineHighlighter.install(this);

    EditorKit editorKit = new StyledEditorKit() {
      @Override
      public Document createDefaultDocument() {
        return document;
      }
    };
View Full Code Here

        MenuContainer, Serializable, Accessible, Scrollable {

    private static final String uiClassID = "TextPaneUI";

    public JTextPane() {
        setEditorKit(new StyledEditorKit());
    }
View Full Code Here

    public MutableAttributeSet getInputAttributes() {
        return getStyledEditorKit().getInputAttributes();
    }

    protected EditorKit createDefaultEditorKit() {
        return new StyledEditorKit();
    }
View Full Code Here

  public SyntaxHighlighterPane() {
    super();

    setEditable(false);
    //<editor-fold defaultstate="collapsed" desc="editor kit">
    setEditorKit(new StyledEditorKit() {

      private static final long serialVersionUID = 1L;

      @Override
      public ViewFactory getViewFactory() {
View Full Code Here

TOP

Related Classes of javax.swing.text.StyledEditorKit

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.