Skip to content

Commit 03283bb

Browse files
author
Federico Fissore
committed
Avoid referring directly to RSyntaxTextArea, at least in the names
1 parent 96b7c5e commit 03283bb

12 files changed

+61
-62
lines changed

app/src/processing/app/CaretAwareUndoableEdit.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package processing.app;
22

3+
import processing.app.syntax.SketchTextArea;
4+
35
import javax.swing.undo.CannotRedoException;
46
import javax.swing.undo.CannotUndoException;
57
import javax.swing.undo.UndoableEdit;
68

7-
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
8-
99
public class CaretAwareUndoableEdit implements UndoableEdit {
1010

1111
private final UndoableEdit undoableEdit;
1212
private final int caretPosition;
1313

14-
public CaretAwareUndoableEdit(UndoableEdit undoableEdit, RSyntaxTextArea textArea) {
14+
public CaretAwareUndoableEdit(UndoableEdit undoableEdit, SketchTextArea textArea) {
1515
this.undoableEdit = undoableEdit;
1616
this.caretPosition = textArea.getCaretPosition();
1717
}

app/test/processing/app/AutoformatProducesOneUndoActionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import org.fest.swing.fixture.JMenuItemFixture;
3333
import org.junit.Test;
34-
import processing.app.helpers.RSyntaxTextAreaFixture;
34+
import processing.app.helpers.SketchTextAreaFixture;
3535

3636
import static org.junit.Assert.assertEquals;
3737
import static org.junit.Assert.assertNotEquals;
@@ -65,7 +65,7 @@ public void shouldSaveCaretPositionAfterAutoformat() {
6565
JMenuItemFixture menuToolsAutoFormat = window.menuItem("menuToolsAutoFormat");
6666
menuToolsAutoFormat.requireEnabled();
6767

68-
RSyntaxTextAreaFixture editor = window.RSyntaxTextArea("editor");
68+
SketchTextAreaFixture editor = window.textArea("editor");
6969
editor.setText(SOURCE_BEFORE);
7070

7171
editor.setCaretPosition(29); // right before the first // (double slash)

app/test/processing/app/AutoformatSavesCaretPositionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import org.fest.swing.fixture.JMenuItemFixture;
3333
import org.junit.Test;
34-
import processing.app.helpers.RSyntaxTextAreaFixture;
34+
import processing.app.helpers.SketchTextAreaFixture;
3535

3636
import static org.junit.Assert.assertEquals;
3737

@@ -42,7 +42,7 @@ public void shouldSaveCaretPositionAfterAutoformat() {
4242
JMenuItemFixture menuToolsAutoFormat = window.menuItem("menuToolsAutoFormat");
4343
menuToolsAutoFormat.requireEnabled();
4444

45-
RSyntaxTextAreaFixture editor = window.RSyntaxTextArea("editor");
45+
SketchTextAreaFixture editor = window.textArea("editor");
4646
editor.setText("void setup() {\n" +
4747
" // put your setup code here, to run once:\n" +
4848
"\n" +

app/test/processing/app/AutoformatTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import org.fest.swing.fixture.JMenuItemFixture;
3333
import org.junit.Test;
34-
import processing.app.helpers.RSyntaxTextAreaFixture;
34+
import processing.app.helpers.SketchTextAreaFixture;
3535

3636
import static org.junit.Assert.assertEquals;
3737

@@ -42,7 +42,7 @@ public void shouldProduceNicelyFormattedCode() throws Exception {
4242
JMenuItemFixture menuToolsAutoFormat = window.menuItem("menuToolsAutoFormat");
4343
menuToolsAutoFormat.requireEnabled();
4444

45-
RSyntaxTextAreaFixture editor = window.RSyntaxTextArea("editor");
45+
SketchTextAreaFixture editor = window.textArea("editor");
4646
editor.setText("void setup() {\n" +
4747
"// put your setup code here, to run once:\n" +
4848
"int foo[] = { 1, 2, 3, 4, 5};\n" +

app/test/processing/app/BlockCommentGeneratesOneUndoActionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.fest.swing.fixture.JMenuItemFixture;
3939
import org.junit.Test;
4040

41-
import processing.app.helpers.RSyntaxTextAreaFixture;
41+
import processing.app.helpers.SketchTextAreaFixture;
4242

4343
public class BlockCommentGeneratesOneUndoActionTest extends AbstractGUITest {
4444

@@ -47,7 +47,7 @@ public void shouldUndoAndRedo() throws Exception {
4747
JMenuItemFixture menuEditUndo = window.menuItem("menuEditUndo");
4848
menuEditUndo.requireDisabled();
4949

50-
RSyntaxTextAreaFixture jEditTextArea = window.RSyntaxTextArea("editor");
50+
SketchTextAreaFixture jEditTextArea = window.textArea("editor");
5151
String previousText = jEditTextArea.getText();
5252

5353
jEditTextArea.selectAll();

app/test/processing/app/HittingEscapeOnCloseConfirmationDialogTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.fest.swing.finder.WindowFinder;
3434
import org.fest.swing.fixture.DialogFixture;
3535
import org.junit.Test;
36-
import processing.app.helpers.RSyntaxTextAreaFixture;
36+
import processing.app.helpers.SketchTextAreaFixture;
3737

3838
import javax.swing.*;
3939
import java.awt.event.KeyEvent;
@@ -44,7 +44,7 @@ public class HittingEscapeOnCloseConfirmationDialogTest extends AbstractGUITest
4444

4545
@Test
4646
public void shouldJustCloseTheDialog() throws Exception {
47-
RSyntaxTextAreaFixture editor = window.RSyntaxTextArea("editor");
47+
SketchTextAreaFixture editor = window.textArea("editor");
4848
editor.setText("test");
4949

5050
window.close();

app/test/processing/app/ReduceIndentWith1CharOnLastLineTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
import org.fest.swing.fixture.JMenuItemFixture;
3535
import org.junit.Test;
3636

37-
import processing.app.helpers.RSyntaxTextAreaFixture;
37+
import processing.app.helpers.SketchTextAreaFixture;
3838

3939
public class ReduceIndentWith1CharOnLastLineTest extends AbstractGUITest {
4040

4141
@Test
4242
public void shouldJustCloseTheDialog() throws Exception {
4343
JMenuItemFixture menuDecreaseIndent = window.menuItem("menuDecreaseIndent");
4444

45-
RSyntaxTextAreaFixture editor = window.RSyntaxTextArea("editor");
45+
SketchTextAreaFixture editor = window.textArea("editor");
4646
editor.setText("void loop()\n{\n Serial.begin(9600)\n}");
4747

4848
editor.selectAll();

app/test/processing/app/ReplacingTextGeneratesTwoUndoActionsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
import org.fest.swing.fixture.JMenuItemFixture;
3333
import org.junit.Test;
34-
import processing.app.helpers.RSyntaxTextAreaFixture;
34+
import processing.app.helpers.SketchTextAreaFixture;
3535

3636
import static org.junit.Assert.assertEquals;
3737

@@ -44,14 +44,14 @@ public void shouldUndoAndRedo() throws Exception {
4444
JMenuItemFixture menuEditRedo = window.menuItem("menuEditRedo");
4545
menuEditRedo.requireDisabled();
4646

47-
RSyntaxTextAreaFixture RSyntaxTextArea = window.RSyntaxTextArea("editor");
47+
SketchTextAreaFixture textArea = window.textArea("editor");
4848

49-
RSyntaxTextArea.setText("fake text");
49+
textArea.setText("fake text");
5050

5151
menuEditUndo.requireEnabled();
5252
menuEditUndo.click();
5353

54-
assertEquals("", RSyntaxTextArea.getText());
54+
assertEquals("", textArea.getText());
5555

5656
menuEditRedo.requireEnabled();
5757
menuEditRedo.click();

app/test/processing/app/helpers/ArduinoFrameFixture.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
package processing.app.helpers;
3131

3232
import org.fest.swing.fixture.FrameFixture;
33-
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
34-
3533
import processing.app.Editor;
34+
import processing.app.syntax.SketchTextArea;
3635

3736
public class ArduinoFrameFixture extends FrameFixture {
3837

@@ -43,8 +42,8 @@ public ArduinoFrameFixture(Editor editor) {
4342
this.editor = editor;
4443
}
4544

46-
public RSyntaxTextAreaFixture RSyntaxTextArea(String name) {
47-
return new RSyntaxTextAreaFixture(robot, (RSyntaxTextArea) this.robot.finder().find(new RSyntaxTextAreaComponentMatcher(name)));
45+
public SketchTextAreaFixture textArea(String name) {
46+
return new SketchTextAreaFixture(robot, (SketchTextArea) this.robot.finder().find(new SketchTextAreaComponentMatcher(name)));
4847
}
4948

5049
public Editor getEditor() {

app/test/processing/app/helpers/RSyntaxTextAreaComponentDriver.java renamed to app/test/processing/app/helpers/SketchTextAreaComponentDriver.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,24 @@
3434
import org.fest.swing.driver.JComponentDriver;
3535
import org.fest.swing.edt.GuiActionRunner;
3636
import org.fest.swing.edt.GuiQuery;
37-
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
37+
import processing.app.syntax.SketchTextArea;
3838

39-
public class RSyntaxTextAreaComponentDriver extends JComponentDriver {
39+
public class SketchTextAreaComponentDriver extends JComponentDriver {
4040

41-
public RSyntaxTextAreaComponentDriver(Robot robot) {
41+
public SketchTextAreaComponentDriver(Robot robot) {
4242
super(robot);
4343
}
4444

45-
public void enterText(RSyntaxTextArea target, String text) {
45+
public void enterText(SketchTextArea target, String text) {
4646
focusAndWaitForFocusGain(target);
4747
robot.enterText(text);
4848
}
4949

50-
public void setText(final RSyntaxTextArea target, final String text) {
50+
public void setText(final SketchTextArea target, final String text) {
5151
focusAndWaitForFocusGain(target);
52-
GuiActionRunner.execute(new GuiQuery<RSyntaxTextArea>() {
52+
GuiActionRunner.execute(new GuiQuery<SketchTextArea>() {
5353

54-
protected RSyntaxTextArea executeInEDT() {
54+
protected SketchTextArea executeInEDT() {
5555
target.setText(text);
5656
return target;
5757
}
@@ -60,7 +60,7 @@ protected RSyntaxTextArea executeInEDT() {
6060
robot.waitForIdle();
6161
}
6262

63-
public String getText(final RSyntaxTextArea target) {
63+
public String getText(final SketchTextArea target) {
6464
focusAndWaitForFocusGain(target);
6565
return GuiActionRunner.execute(new GuiQuery<String>() {
6666

@@ -71,18 +71,18 @@ protected String executeInEDT() {
7171
});
7272
}
7373

74-
public RSyntaxTextArea selectAll(final RSyntaxTextArea target) {
75-
return GuiActionRunner.execute(new GuiQuery<RSyntaxTextArea>() {
74+
public SketchTextArea selectAll(final SketchTextArea target) {
75+
return GuiActionRunner.execute(new GuiQuery<SketchTextArea>() {
7676

77-
protected RSyntaxTextArea executeInEDT() {
77+
protected SketchTextArea executeInEDT() {
7878
target.selectAll();
7979
return target;
8080
}
8181

8282
});
8383
}
8484

85-
public Integer getCaretPosition(final RSyntaxTextArea target) {
85+
public Integer getCaretPosition(final SketchTextArea target) {
8686
focusAndWaitForFocusGain(target);
8787
return GuiActionRunner.execute(new GuiQuery<Integer>() {
8888

@@ -93,11 +93,11 @@ protected Integer executeInEDT() {
9393
});
9494
}
9595

96-
public void setCaretPosition(final RSyntaxTextArea target, final int caretPosition) {
96+
public void setCaretPosition(final SketchTextArea target, final int caretPosition) {
9797
focusAndWaitForFocusGain(target);
98-
GuiActionRunner.execute(new GuiQuery<RSyntaxTextArea>() {
98+
GuiActionRunner.execute(new GuiQuery<SketchTextArea>() {
9999

100-
protected RSyntaxTextArea executeInEDT() {
100+
protected SketchTextArea executeInEDT() {
101101
target.setCaretPosition(caretPosition);
102102
return target;
103103
}

0 commit comments

Comments
 (0)