All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fxmisc.richtext.model.PlainTextChange Maven / Gradle / Ivy

There is a newer version: 0.11.3
Show newest version
package org.fxmisc.richtext.model;

/**
 * An object that specifies where a non-style change occurred in a {@link org.fxmisc.richtext.GenericStyledArea}.
 */
public class PlainTextChange extends TextChange {

    public PlainTextChange(int position, String removed, String inserted) {
        super(position, removed, inserted);
    }

    @Override
    protected int removedLength() {
        return removed.length();
    }

    @Override
    protected int insertedLength() {
        return inserted.length();
    }

    @Override
    protected final String concat(String a, String b) {
        return a + b;
    }

    @Override
    protected final String sub(String s, int from, int to) {
        return s.substring(from, to);
    }

    @Override
    protected final PlainTextChange create(int position, String removed, String inserted) {
        return new PlainTextChange(position, removed, inserted);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy