46 | | The test will extend SystemTestBase, since it is the only testbase that starts the whole app. Thus we will be able to take in mind other factors like halo menus. It will perform these things and print the result in milliseconds. Unnecessary modules will not be started (alternative skin, for example). All the measurements will be placed in one test case, since starting the app for every case will be very slow. |
| 47 | The test will extend SystemTestBase, since it is the only testbase that starts the whole app. Thus we will be able to take in mind other factors like halo menus. It will perform these things and print the result in milliseconds. Unnecessary modules will not be started (alternative skin, for example). All the measurements will be placed in one test case, since starting the app for every case will be very slow. |
| 48 | |
| 49 | Create class SelectionInfo, which will hold the mark and caret positions. It will be immutable, 2 private final int fields - mark and caret. A default constructor will be provided, as well as getters for the mark and caret indices. Also, generated hashcode() and equals() and public static SelectionInfo DEFAULT = new SelectionInfo(-1, -1) (values are same to the current default values for the mark and caret); |
| 50 | |
| 51 | In BaseTextModel, delete mark() and caret(), instead create private RwProp<SelectionInfo> selectionInfo(), with a default value of SelectionInfo.DEFAULT. |
| 52 | |
| 53 | Replace getMark() and getCaret() with getSelectionInfo(). Replace setMark() and setCaret() with setSelectionInfo(). I think the purpose of these methods is clear, as is their usage. |
| 54 | |
| 55 | |
| 56 | |
| 57 | |