Skip to content

Commit

Permalink
Separation of source and view text in ScriptEditor API
Browse files Browse the repository at this point in the history
  • Loading branch information
subwiz committed Oct 8, 2015
1 parent b6b62c7 commit a531ed8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ public final void setText(String text) {
setViewText(text);
}

public abstract void setViewText(String text);
@Override
public final void setSourceText(String text) {
source = text;
}

@Override
public final String getSourceText() {
return source;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @author subwiz
*/
public class RSyntaxScriptEditor implements ScriptEditor {
public class RSyntaxScriptEditor extends AbstractScriptEditor {

private final RSyntaxTextArea textArea = new RSyntaxTextArea();

Expand Down Expand Up @@ -62,9 +62,14 @@ public String getText() {
}

@Override
public void setText(String text) {
public void setViewText(String text) {
textArea.setText(text);
}

@Override
public String getViewText() {
return textArea.getText();
}

@Override
public void setCaretPosition(int offset) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ public interface ScriptEditor {
* @param text script code
*/
public void setText(String text);

public String getSourceText();

public void setSourceText(String text);

public String getViewText();

public void setViewText(String text);

/**
* set caret position
Expand Down

0 comments on commit a531ed8

Please sign in to comment.