.settings | ||
.vscode | ||
app | ||
gradle/wrapper | ||
Notes | ||
.gitattributes | ||
.gitignore | ||
.project | ||
gradlew | ||
gradlew.bat | ||
README.md | ||
settings.gradle |
PM1 Text Editor
Introduction
Text Editor is a rudimentary, you guessed it, text editor that only provides the most basic of features. It contains a variety of immensely useful features such as but not limited to:
- Adding text
- Removing text
- Printing text to a terminal
- ...and even replacing individual words
Text Editor is the perfect choice for people looking for a challenge, as it features no persistent storage or inline editing. An exhaustive list of available commands can found below.
Installation & available commands
Installation
Text Editor doesn't require any installation by itself. Just download the .jar from the releases page. However, a functional Java installation is required. Note that only JDK 17 is supported.
To start Text Editor on Linux simply use java -cp <path to jar> ch.slothbusters.texteditor.App
On Windows use this instead: java -Dfile.encoding=Cp850 -cp <path to jar> ch.slothbusters.texteditor.App
Compilation
To compile the code gradle and JDK 17 is required.
To compile the code use gradle compileJava
. The class files are saved to "app/build/clases".
To generate a jar file use gradle jar
. The generated jar is in "app/build/libs/" and
can be executed with java -cp app.jar ch.slothbusters.texteditor.App
Commands
Text Editor features many commands that enable usage of the program. Commands are listed in this format: COMMAND <mandatory argument> [optional argument]
Command | Description |
---|---|
ADD [paragraph number] |
Inserts a paragraph at the specified location. Entered text will be appended to the end of the document when no number is specified. |
DUMMY [paragraph number] |
Inserts a paragraph with dummy text (lorem ipsum) at the specified location. The paragraph will be appended to the end of the document when no number is specified. |
REPLACE <paragraph number> |
Replaces a word with another word in the specified paragraph. |
DEL [paragraph number] |
Deletes specific paragraph. The last paragraph is deleted if no number is given. |
INDEX <paragraph number> |
Displays a frequency analysis of words that appear thrice or more in the specified paragraph. |
FORMAT RAW |
Paragraph output becomes unformatted. |
FORMAT FIXED <max line width> |
Paragraphs will wrap around when the max line width is reached. This also hides paragraph numbers |
PRINT |
Prints all paragraphs to the console. |
EXIT |
Exits the application. |
Tests
JUnit tests are available and are documented in "Test Cases".
Credits
- Tanja Aeberhardt
- Jonas Costa
- Manuel Thalmann
- Sebastian Zumbrunn