![JAR search and dependency download from the Maven repository](/logo.png)
org.fxmisc.richtext.model.TextOps 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;
import org.reactfx.util.Either;
public interface TextOps extends SegmentOps {
public SEG create(String text, S style);
public default TextOps, S> _or(SegmentOps rOps) {
return eitherL(this, rOps);
}
public static TextOps, S> eitherL(TextOps lOps, SegmentOps rOps) {
return new LeftTextOps<>(lOps, rOps);
}
public static TextOps, S> eitherR(SegmentOps lOps, TextOps rOps) {
return new RightTextOps<>(lOps, rOps);
}
}
class LeftTextOps extends EitherSegmentOps implements TextOps, S> {
private final TextOps lOps;
LeftTextOps(TextOps lOps, SegmentOps rOps) {
super(lOps, rOps);
this.lOps = lOps;
}
@Override
public Either create(String text, S style) {
return Either.left(lOps.create(text, style));
}
}
class RightTextOps extends EitherSegmentOps implements TextOps, S> {
private final TextOps rOps;
RightTextOps(SegmentOps lOps, TextOps rOps) {
super(lOps, rOps);
this.rOps = rOps;
}
@Override
public Either create(String text, S style) {
return Either.right(rOps.create(text, style));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy