Package javax.swing.text

Examples of javax.swing.text.StyledEditorKit$ItalicAction


        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 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

     * @param Name
     */
    private void CreateDocumentComponent(String Name){
       
        final JEditorPane myDoc = new JEditorPane();
        myDoc.setEditorKit(new StyledEditorKit());
        myDoc.setSelectedTextColor(Color.BLUE);
        myDoc.setOpaque(true);
       
        JScrollPane scrollPane = new JScrollPane(myDoc);
        scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
View Full Code Here

    requestPane.setMargin(new Insets(1, 1, 1, 1));
    requestPane.setBackground(Color.WHITE);
    requestPane.setForeground(Color.BLACK);

    // Set the editor kit responsible for highlighting
    requestPane.setEditorKit(new StyledEditorKit() {

      private static final long serialVersionUID = -6085642347022880064L;

      @Override
      public Document createDefaultDocument() {
View Full Code Here

    hTxTArea.setMargin(new Insets(1, 1, 1, 1));
    hTxTArea.setBackground(Color.WHITE);
    hTxTArea.setForeground(Color.BLACK);
    // Set the editor kit responsible for highlighting
    hTxTArea.setEditorKit(new StyledEditorKit() {

      /**
       *
       */
      private static final long serialVersionUID = -4550261337511448681L;
View Full Code Here

        this.fontName = fontName;
        this.fontSize = fontSize;
        this.log = OurUtil.make(OurAntiAlias.pane(), Color.BLACK, background, new EmptyBorder(1,1,1,1), new Font(fontName, Font.PLAIN, fontSize));
        // This customized StyledEditorKit prevents line-wrapping up to 30000 pixels wide.
        // 30000 is a good number; value higher than about 32768 will cause errors.
        this.log.setEditorKit(new StyledEditorKit() {
            private static final long serialVersionUID = 0;
            @Override public final ViewFactory getViewFactory() {
                return new ViewFactory() {
                    public final View create(Element x) {
                        if (!AbstractDocument.SectionElementName.equals(x.getName())) return defaultFactory.create(x);
View Full Code Here

   public OurSyntaxWidget
   (boolean enableSyntax, String text, String fontName, int fontSize, int tabSize, JComponent obj1, JComponent obj2) {
      this.obj1 = obj1;
      this.obj2 = obj2;
      final OurSyntaxWidget me = this;
      final ViewFactory defaultFactory = (new StyledEditorKit()).getViewFactory();
      doc.do_enableSyntax(enableSyntax);
      doc.do_setFont(fontName, fontSize, tabSize);
      pane.setEditorKit(new StyledEditorKit() { // Prevents line-wrapping up to width=30000, and tells it to use our Document obj
         @Override public Document createDefaultDocument() { return doc; }
         @Override public ViewFactory getViewFactory() {
            return new ViewFactory() {
               public View create(Element x) {
                  if (!AbstractDocument.SectionElementName.equals(x.getName())) return defaultFactory.create(x);
View Full Code Here

TOP

Related Classes of javax.swing.text.StyledEditorKit$ItalicAction

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.