Package javax.swing.text

Examples of javax.swing.text.DocumentFilter$FilterBypass


    text.setAutoscrolls(true);
   
    // No editing before startPos
    if (text.getDocument() instanceof AbstractDocument)
      ((AbstractDocument) text.getDocument())
          .setDocumentFilter(new DocumentFilter() {
            public void insertString(
                DocumentFilter.FilterBypass fb, int offset,
                String string, AttributeSet attr)
                throws BadLocationException {
              if (offset >= startPos)
View Full Code Here


        area.addKeyListener(this);
       
        // No editing before startPos
        if (area.getDocument() instanceof AbstractDocument)
            ((AbstractDocument) area.getDocument()).setDocumentFilter(
                new DocumentFilter() {
                    public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
                        if (offset >= startPos) super.insertString(fb, offset, string, attr);
                    }
                   
                    public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException {
View Full Code Here

    }

    protected DocumentFilter filter;

    protected DocumentFilter getDocumentFilter() {
        DocumentFilter filter = getFilter();
        if (filter != null)
            return filter;

        return super.getDocumentFilter();
    }
View Full Code Here

    }

    protected DocumentFilter filter;

    protected DocumentFilter getDocumentFilter() {
        DocumentFilter filter = getFilter();
        if (filter != null)
            return filter;

        return super.getDocumentFilter();
    }
View Full Code Here

    }

    protected DocumentFilter filter;

    protected DocumentFilter getDocumentFilter() {
        DocumentFilter filter = getFilter();
        if (filter != null)
            return filter;

        return super.getDocumentFilter();
    }
View Full Code Here

        area.addKeyListener(this);
       
        // No editing before startPos
        if (area.getDocument() instanceof AbstractDocument) {
            ((AbstractDocument) area.getDocument()).setDocumentFilter(
                new DocumentFilter() {
                    public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
                        if (offset >= startPos) super.insertString(fb, offset, string, attr);
                    }
                   
                    public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException {
View Full Code Here

    }

    public void testInstallUninstall_Filters() {
        NavigationFilter navFilter = new NavigationFilter();
        formatter.setNavigationFilter(navFilter);
        DocumentFilter docFilter = new DocumentFilter();
        formatter.setDocumentFilter(docFilter);
        AbstractDocument doc = (AbstractDocument) tf.getDocument();
        assertNull(tf.getNavigationFilter());
        assertNull(doc.getDocumentFilter());
        formatter.install(tf);
View Full Code Here

                .setToolTipText("The text to be displayed when starting a level");
        briefingTA.setLineWrap(true);
        briefingTA.setWrapStyleWord(true);
        // the document filter restricts newline characters.
        ((AbstractDocument) briefingTA.getDocument())
                .setDocumentFilter(new DocumentFilter() {
                    public void insertString(DocumentFilter.FilterBypass fb,
                            int offset, String text, AttributeSet attr)
                            throws BadLocationException {
                        fb.insertString(offset, text.replaceAll("\n", ""), attr);
                    }
View Full Code Here

        area.addKeyListener(this);
       
        // No editing before startPos
        if (area.getDocument() instanceof AbstractDocument) {
            ((AbstractDocument) area.getDocument()).setDocumentFilter(
                new DocumentFilter() {
                    public void insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
                        if (offset >= startPos) super.insertString(fb, offset, string, attr);
                    }
                   
                    public void remove(DocumentFilter.FilterBypass fb, int offset, int length) throws BadLocationException {
View Full Code Here

    lblUserData2 = new JLabel4j_std(lang.get("lbl_User_Data2"));
    lblUserData2.setHorizontalAlignment(SwingConstants.TRAILING);
    lblUserData2.setBounds(288, 167, 111, 16);
    desktopPane.add(lblUserData2);

    DocumentFilter filter = new UppercaseDocumentFilter();
    textFieldUserData1 = new JTextField4j();
    textFieldUserData1.addKeyListener(new KeyAdapter()
    {

      @Override
View Full Code Here

TOP

Related Classes of javax.swing.text.DocumentFilter$FilterBypass

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.