Package org.apache.harmony.awt.text

Examples of org.apache.harmony.awt.text.ComposedTextParams


        }
        handleComposedText(ce.getDot());
    }

    private void handleComposedText(final int dot) {
        ComposedTextParams composedTextParams = getComposedTextParams();
        int lastInsertPosition = composedTextParams.getComposedTextStart();
        int composedTextLength = composedTextParams.getComposedTextLength();
        if (composedTextLength > 0 && (dot < lastInsertPosition
                || dot > lastInsertPosition +  composedTextLength)) {
        // TODO: Uncomment when InputContext is fully supported by awt
//            SwingUtilities.invokeLater(new Runnable() {
//                public void run() {
View Full Code Here


    private ComposedTextParams getComposedTextParams() {
        Object currentProperty = document
           .getProperty(PropertyNames.COMPOSED_TEXT_PROPERTY);
        if (!(currentProperty instanceof ComposedTextParams)) {
           ComposedTextParams result = new ComposedTextParams(document);
           int caretPosition = getCaretPosition();
           result.setComposedTextStart(caretPosition);
           result.setLastCommittedTextStart(caretPosition);
           return result;
        }
        return (ComposedTextParams)currentProperty;
    }
View Full Code Here

            if (!shouldBe) {
                assertNull(value);
                return;
            }
            assertTrue(value instanceof ComposedTextParams);
            ComposedTextParams params = (ComposedTextParams) value;
            assertEquals(start, params.getComposedTextStart());
            assertEquals(length, params.getComposedTextLength());
            AttributedString text = params.getComposedText();
            AttributedCharacterIterator iter1 = attrString.getIterator();
            AttributedCharacterIterator iter2 = text.getIterator();
            assertEquals(iter1.getAttributes(), iter2.getAttributes());
            assertEquals(iter1.getRunStart(SEGMENT_ATTRIBUTE), iter2
                    .getRunStart(SEGMENT_ATTRIBUTE));
View Full Code Here

            final int length) {
        if (isHarmony()) {
            Object value = doc.getProperty(PropertyNames.COMPOSED_TEXT_PROPERTY);
            if (!shouldBe) {
                if (value != null) {
                    ComposedTextParams params = (ComposedTextParams) value;
                    assertNull(params.getComposedText());
                    assertEquals(0, params.getComposedTextLength());
                }
                return;
            }
            assertTrue(value instanceof ComposedTextParams);
            ComposedTextParams params = (ComposedTextParams) value;
            assertEquals(start, params.getComposedTextStart());
            assertEquals(length, params.getComposedTextLength());
            AttributedString text = params.getComposedText();
            AttributedCharacterIterator iter1 = attrString.getIterator();
            AttributedCharacterIterator iter2 = text.getIterator();
            assertEquals(iter1.getAttributes(), iter2.getAttributes());
            assertEquals(iter1.getRunStart(SEGMENT_ATTRIBUTE), iter2
                    .getRunStart(SEGMENT_ATTRIBUTE));
View Full Code Here

            if (!shouldBe) {
                assertNull(value);
                return;
            }
            assertTrue(value instanceof ComposedTextParams);
            ComposedTextParams params = (ComposedTextParams) value;
            assertEquals(start, params.getComposedTextStart());
            assertEquals(length, params.getComposedTextLength());
            AttributedString text = params.getComposedText();
            AttributedCharacterIterator iter1 = attrString.getIterator();
            AttributedCharacterIterator iter2 = text.getIterator();
            assertEquals(iter1.getAttributes(), iter2.getAttributes());
            assertEquals(iter1.getRunStart(SEGMENT_ATTRIBUTE), iter2
                    .getRunStart(SEGMENT_ATTRIBUTE));
View Full Code Here

            final int length) {
        if (isHarmony()) {
            Object value = doc.getProperty(PropertyNames.COMPOSED_TEXT_PROPERTY);
            if (!shouldBe) {
                if (value != null) {
                    ComposedTextParams params = (ComposedTextParams) value;
                    assertNull(params.getComposedText());
                    assertEquals(0, params.getComposedTextLength());
                }
                return;
            }
            assertTrue(value instanceof ComposedTextParams);
            ComposedTextParams params = (ComposedTextParams) value;
            assertEquals(start, params.getComposedTextStart());
            assertEquals(length, params.getComposedTextLength());
            AttributedString text = params.getComposedText();
            AttributedCharacterIterator iter1 = attrString.getIterator();
            AttributedCharacterIterator iter2 = text.getIterator();
            assertEquals(iter1.getAttributes(), iter2.getAttributes());
            assertEquals(iter1.getRunStart(SEGMENT_ATTRIBUTE), iter2
                    .getRunStart(SEGMENT_ATTRIBUTE));
View Full Code Here

            handleComposedText(ce.getDot());
        }
    }

    private void handleComposedText(final int dot) {
        ComposedTextParams composedTextParams = getComposedTextParams();
        int lastInsertPosition = composedTextParams.getComposedTextStart();
        int composedTextLength = composedTextParams.getComposedTextLength();
        if (composedTextLength > 0 && (dot < lastInsertPosition
                || dot > lastInsertPosition +  composedTextLength)) {
        // TODO: Uncomment when InputContext is fully supported by awt
//            SwingUtilities.invokeLater(new Runnable() {
//                public void run() {
View Full Code Here

    private ComposedTextParams getComposedTextParams() {
        Object currentProperty = document
           .getProperty(PropertyNames.COMPOSED_TEXT_PROPERTY);
        if (!(currentProperty instanceof ComposedTextParams)) {
           ComposedTextParams result = new ComposedTextParams(document);
           int caretPosition = getCaretPosition();
           result.setComposedTextStart(caretPosition);
           result.setLastCommittedTextStart(caretPosition);
           return result;
        }
        return (ComposedTextParams)currentProperty;
    }
View Full Code Here

            handleComposedText(ce.getDot());
        }
    }

    private void handleComposedText(final int dot) {
        ComposedTextParams composedTextParams = getComposedTextParams();
        int lastInsertPosition = composedTextParams.getComposedTextStart();
        int composedTextLength = composedTextParams.getComposedTextLength();
        if (composedTextLength > 0 && (dot < lastInsertPosition
                || dot > lastInsertPosition +  composedTextLength)) {
        // TODO: Uncomment when InputContext is fully supported by awt
//            SwingUtilities.invokeLater(new Runnable() {
//                public void run() {
View Full Code Here

    private ComposedTextParams getComposedTextParams() {
        Object currentProperty = document
           .getProperty(PropertyNames.COMPOSED_TEXT_PROPERTY);
        if (!(currentProperty instanceof ComposedTextParams)) {
           ComposedTextParams result = new ComposedTextParams(document);
           int caretPosition = getCaretPosition();
           result.setComposedTextStart(caretPosition);
           result.setLastCommittedTextStart(caretPosition);
           return result;
        }
        return (ComposedTextParams)currentProperty;
    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.awt.text.ComposedTextParams

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.