Package org.apache.pivot.wtk

Examples of org.apache.pivot.wtk.Span


        assertEquals(listView1.addSelectedRange(16, 19).getLength(), 1);
        assertEquals(listView1.removeSelectedRange(10, 17).getLength(), 2);

        Sequence<Span> selectedRanges = listView1.getSelectedRanges();
        assertEquals(selectedRanges.getLength(), 2);
        assertEquals(selectedRanges.get(0), new Span(2, 9));
        assertEquals(selectedRanges.get(1), new Span(18, 19));

        assertEquals(listView1.removeSelectedRange(1, 20).getLength(), 2);
        assertEquals(listView1.removeSelectedRange(0, 5).getLength(), 0);

        compareSelectionState();
View Full Code Here


                if (keyCode == Keyboard.KeyCode.DELETE) {
                    List<Object> listData = (List<Object>)listView.getListData();

                    Sequence<Span> selectedRanges = listView.getSelectedRanges();
                    for (int i = selectedRanges.getLength() - 1; i >= 0; i--) {
                        Span selectedRange = selectedRanges.get(i);
                        listData.remove(selectedRange.start, selectedRange.end - selectedRange.start + 1);
                    }
                }

                return false;
View Full Code Here

            graphics.setFont(getEffectiveFont());

            int selectionStart = textPane.getSelectionStart();
            int selectionLength = textPane.getSelectionLength();
            Span selectionRange = new Span(selectionStart, selectionStart + selectionLength - 1);

            int documentOffset = getDocumentOffset();
            Span characterRange = new Span(documentOffset, documentOffset + getCharacterCount() - 1);

            int width = getWidth();
            int height = getHeight();

            if (selectionLength > 0
                && characterRange.intersects(selectionRange)) {
                // Determine the selection bounds
                int x0;
                if (selectionRange.start > characterRange.start) {
                    Bounds leadingSelectionBounds = getCharacterBounds(selectionRange.start - documentOffset);
                    x0 = leadingSelectionBounds.x;
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.Span

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.