Package com.ibm.richtext.styledtext

Examples of com.ibm.richtext.styledtext.MText.replace()


                    case 2:
                        // replace some of the buffer with boldItalicStr
                        int rStart = randInt(rand, buf.length()+1);
                        int rStop = randInt(rand, rStart, buf.length()+1);
                        buf.replace(rStart, rStop, boldItalicStr);
                        {
                            String newString = (rStart>0)? plainText.substring(0, rStart) : new String();
                            newString = newString.concat(boldItalicStr_getString);
                            if (rStop < plainText.length())
                                newString = newString.concat(plainText.substring(rStop, plainText.length()));
View Full Code Here


                            int delPos = randInt(rand, buf.length()-1);
                            buf.remove(delPos, delPos+1);
                            plainText = plainText.substring(0, delPos).concat(plainText.substring(delPos+1));
                        }
                        else {
                            buf.replace(0, 0, plain1Str, 0, plain1Str.length());
                            plainText = plain1Str_getString;
                        }
                        break;

                    case 6:
View Full Code Here

                    case 6:
                    // replace the contents of the buffer (except the first character) with itself
                        {
                            int start = buf.length() > 1? 1 : 0;
                            buf.replace(start, buf.length(), buf);
                            plainText = plainText.substring(0, start).concat(plainText);
                            if (buf.length() > 0) {
                                oldPlainText = ALWAYS_DIFFERENT;
                            }
                        }
View Full Code Here

        if (fCommand == null) {
            TextOffset  selStart = fSelection.getStart();
            TextOffset  selEnd = fSelection.getEnd();

            MText writableText = new StyledText();
            writableText.replace(0, 0, fText, selStart.fOffset, selEnd.fOffset);
            fCommand = new TextChangeCommand(fParent,
                                writableText,
                                null, selStart.fOffset, selStart, selEnd,
                                new TextOffset(), new TextOffset());
View Full Code Here

           
            char[] buf = new char[BUF_SIZE];
            int read;
            while ((read=in.read(buf, 0, buf.length)) != -1) {
                int len = text.length();
                text.replace(len, len, buf, 0, read, AttributeMap.EMPTY_ATTRIBUTE_MAP);
            }
            return text;
        }
        finally {
            if (in != null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.