Doucument Reader

This is an application for browsing files on your local file system and displaying their contents.The program displays a list of files and directories on the left, and a contents pane on the right. The users are able to use the keyboard to navigate through the file system, and the contents pane will update to reflect the contents of the currently selected file for supported file types.

1. Technique:

  • The code was written in Kotlin 1.6, using Open JDK 17.0.2 and JavaFX 17.0.2. The project is a Gradle project, and buildable using gradle build or by using Gradle commands in IntelliJ.

2. Files:

  • When launched, this list will show the contents of a test folder

3. Navigating:

  • User are be able to scroll up and down the list of files using arrow keys to change the selected file, or pick an entry in the list by clicking on it with a pointing device. The status line always display the path and filename of the selected item.

  • Users are able to descend into a directory, using a hotkey (Enter), or a toolbar button (Next), or a menu item, or by double-clicking with a pointing device.

  • Users are able to navigate up to the parent directory using a hotkey (Backspace or Delete), or a toolbar button (Prev), or a menu item.

  • Users are able to return to the Home directory at any time by pressing a button on the toolbar or selecting a corresponding menu item.

截屏2022-08-06 下午3 59 29

4. Functions:

  • Users are able to rename a file or directory, by selecting the item, and then pressing a rename icon on the toolbar, or selecting Action – Rename from the menu bar. You should prompt the user for the new name. If they provide an invalid name, the error and cancel the rename operation will be displayed

截屏2022-08-06 下午3 58 57

  • Users are able to move a file or directory to a different location, by selecting an item, and then pressing a move icon on the toolbar, or selecting Action – Move from the menu bar. You should prompt the user for the destination directory with a dialog box, and display an error if the destination is invalid.

截屏2022-08-06 下午4 03 12

  • Users are able to delete a file or directory, by selecting the item, and then pressing a delete icon on the toolbar, or selecting Action – Delete from the menu bar. You must prompt the user with a confirmation dialog before proceeding (i.e. ask them if they wish to delete the item, and give them a chance to cancel this operation).

截屏2022-08-06 下午4 38 14

  • There should be a toggle option on the menubar Option – Show Hidden Files that determines if hidden files are shown or not. It should default to hiding hidden files. Changing this option should immediately be reflected in the file list, and should persist as the user navigates.

截屏2022-08-06 下午4 38 28

5. Display:

  • If a directory is selected, you should show a blank page for the content pane.

  • If the selected file is an image

  • If the selected file is text, then the contents of the file will be displayed. The contents pane should have a scrollbar if the file requires more than a single screen to display.

  • If the file is any other type, or an unknown type, the contents pane will display the text “Unsupported type”.

  • If the file is unreadable for any reason, it will show display the text “File cannot be read” in the contents pane.

截屏2022-08-06 下午4 38 58

GitHub

View Github