Skip to content

Commit

Permalink
Ported implementation's javadoc to EditableStyledDocument and updated…
Browse files Browse the repository at this point in the history
… implementation's javadoc
  • Loading branch information
JordanMartinez committed Mar 31, 2016
1 parent 9aa1a8b commit fb39977
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,23 @@
import org.reactfx.SuspendableNo;
import org.reactfx.value.Val;

/**
* Content model for {@link StyledTextArea}. Implements edit operations
* on styled text, but not worrying about additional aspects such as
* caret or selection, which are handled by {@link StyledTextAreaModel}.
*/
public interface EditableStyledDocument<PS, S> extends StyledDocument<PS, S> {

/* ********************************************************************** *
* *
* Observables *
* *
* Observables are "dynamic" (i.e. changing) characteristics of an object.*
* They are not directly settable by the client code, but change in *
* response to user input and/or API actions. *
* *
* ********************************************************************** */

String getText();
ObservableValue<String> textProperty();

Expand All @@ -19,6 +34,12 @@ public interface EditableStyledDocument<PS, S> extends StyledDocument<PS, S> {

ReadOnlyStyledDocument<PS, S> snapshot();

/* ********************************************************************** *
* *
* Event streams *
* *
* ********************************************************************** */

default EventStream<PlainTextChange> plainChanges() {
return richChanges()
// map is used to prevent code repetition: StyledDocument#getText()
Expand All @@ -36,6 +57,15 @@ default EventStream<PlainTextChange> plainChanges() {

StyledDocument<PS, S> subDocument(int paragraphIndex);

/* ********************************************************************** *
* *
* Actions *
* *
* Actions change the state of the object. They typically cause a change *
* of one or more observables and/or produce an event. *
* *
* ********************************************************************** */

void replace(int start, int end, StyledDocument<PS, S> replacement);

void setStyle(int from, int to, S style);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
import org.reactfx.value.Var;

/**
* Content model for {@link StyledTextArea}. Implements edit operations
* on styled text, but not worrying about additional aspects such as
* caret or selection.
* Provides an implementation of {@link EditableStyledDocument}
*/
final class EditableStyledDocumentImpl<PS, S> extends StyledDocumentBase<PS, S, ObservableList<Paragraph<PS, S>>>
implements EditableStyledDocument<PS, S> {
Expand Down

0 comments on commit fb39977

Please sign in to comment.