org.fxmisc.richtext.model.PlainTextChange Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of richtextfx Show documentation
Show all versions of richtextfx Show documentation
Rich-text area for JavaFX
The 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);
}
}