From 735daca0374e192146b2aa732d7aad4091504b5b Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Wed, 16 Aug 2017 09:00:29 +0800 Subject: [PATCH 1/5] Remove Eclipse project files As we are moving to IntelliJ, the Eclipse project files are no longer needed. Let's remove them. --- .classpath | 12 ------------ .project | 17 ----------------- .settings/org.eclipse.jdt.core.prefs | 11 ----------- 3 files changed, 40 deletions(-) delete mode 100644 .classpath delete mode 100644 .project delete mode 100644 .settings/org.eclipse.jdt.core.prefs diff --git a/.classpath b/.classpath deleted file mode 100644 index 7b14e4774..000000000 --- a/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/.project b/.project deleted file mode 100644 index 76d17717a..000000000 --- a/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - AddressBook-Level3 - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 3a2153707..000000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 From 6c4f0c955e5270b0875f27938e62b475f49176f2 Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Wed, 16 Aug 2017 09:11:06 +0800 Subject: [PATCH 2/5] DeveloperGuide: Migrate setup instructions to IntelliJ We are no longer using Eclipse as our development environment. The instructions in the developer guide are outdated. Let's migrate the setup instructions to IntelliJ. --- doc/DeveloperGuide.md | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/doc/DeveloperGuide.md b/doc/DeveloperGuide.md index c82c3afb9..e2ed428c6 100644 --- a/doc/DeveloperGuide.md +++ b/doc/DeveloperGuide.md @@ -12,27 +12,40 @@ #### Prerequisites -1. **JDK 8** or later -2. **Eclipse** IDE -3. **e(fx)clipse** plugin for Eclipse (Do the steps 2 onwards given in - [this page](http://www.eclipse.org/efxclipse/install.html#for-the-ambitious)) - - -#### Importing the project into Eclipse - -0. Fork this repo, and clone the fork to your computer -1. Open Eclipse (Note: Ensure you have installed the **e(fx)clipse plugin** as given in the prerequisites above) -2. Click `File` > `Import` -3. Click `General` > `Existing Projects into Workspace` > `Next` -4. Click `Browse`, then locate the project's directory -5. Click `Finish` +* JDK 8 or later +* IntelliJ IDE + +#### Importing the project into IntelliJ + +1. Open IntelliJ (if you are not in the welcome screen, click `File` > `Close Project` to close the existing project dialog first) +2. Set up the correct JDK version + 1. Click `Configure` > `Project Defaults` > `Project Structure` + 2. If JDK 8 is listed in the drop down, select it. If it is not, click `New...` and select the directory where you installed JDK 8. + 3. Click `OK`. +3. Click `Import Project` +4. Locate the project directory and click `OK` +5. Select `Create project from existing sources` and click `Next` +6. Rename the project if you want. Click `Next` +7. Ensure that your `\src` and `\test\java` folder is checked. Keep clicking `Next` +8. Click `Finish` +9. Add JUnit 4 to classpath + 1. Open any test file in `\test\java` and place your cursor over any `@Test` highlighted in red + 2. Press ALT+ENTER and select `Add 'JUnit4' to classpath` + 3. Select `Use 'JUnit4' from IntelliJ IDEA distribution` and click `OK` +10. Run all the tests (right-click the `test` folder, and click `Run 'All Tests'`) +11. Observe how some tests fail. That is because they try to access the test data from the wrong directory (the working directory is expected to be the root directory, but IntelliJ runs the test with `test\` as the working directory by default). To fix this issue: + 1. Go to `Run` -> `Edit Configurations...` + 2. On the list at the left, ensure that `All in test` is selected + 3. Under `Configuration`, change the `Working directory` to the `addressbook-level3` folder + 4. Click `OK` +12. Run the tests again to ensure they all pass now. ## Design ## Testing -* In Eclipse, right-click on the `test/java` folder and choose `Run as` > `JUnit Test` +* In IntelliJ, right-click on the `test` folder and choose `Run 'All Tests'` ## Appendix A : User Stories From be3a3d409f7d2a0ebed9eec401bc16c746e5d0e3 Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Wed, 16 Aug 2017 22:07:02 +0800 Subject: [PATCH 3/5] UserGuide: Migrate instructions to IntelliJ We are no longer using Eclipse as our development environment. The instructions in the user guide are outdated. Let's migrate the instructions to IntelliJ. --- doc/UserGuide.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/UserGuide.md b/doc/UserGuide.md index 3e4baae95..f44967db0 100644 --- a/doc/UserGuide.md +++ b/doc/UserGuide.md @@ -5,10 +5,11 @@ Please refer to the [Setting up](DeveloperGuide.md#setting-up) section to learn ## Starting the program -1. Find the project in the `Project Explorer` or `Package Explorer` (usually located at the left side) -2. Right click on the project -3. Click `Run As` > `Java Application` and choose the `Main` class. -4. The GUI should appear in a few seconds. +1. Find the project pane (usually located at the left side) +2. Open up `src/seedu.addressbook` folder +3. Right click on `Main` +4. Click `Run Main.main()` +5. The GUI should appear in a few seconds @@ -113,5 +114,5 @@ You can change the location by specifying the file path as a program argument. The file name must end in `.txt` for it to be acceptable to the program. > -> When running the program inside Eclipse, you can - [set command line parameters before running the program](http://stackoverflow.com/questions/7574543/how-to-pass-console-arguments-to-application-in-eclipse). +> When running the program inside IntelliJ, you can + [set command line parameters before running the program](https://stackoverflow.com/a/2066465). From d73fc9a24411ef783f8ddfe07a1e1d1a04acc73a Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Thu, 17 Aug 2017 09:29:06 +0800 Subject: [PATCH 4/5] UserGuide: Remove section "Changing Save Location" The UserGuide claims that the save location of the addressbook data can be changed via command line parameters. That feature is not fully implemented. As such, addressbook data is always saved in addressbook.txt and cannot be changed. Let's remove the section "Changing Save Location". We can restore this section after the feature is fully implemented. --- doc/UserGuide.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/doc/UserGuide.md b/doc/UserGuide.md index f44967db0..d03dfce73 100644 --- a/doc/UserGuide.md +++ b/doc/UserGuide.md @@ -106,13 +106,4 @@ Format: `exit` ## Saving the data Address book data are saved in the hard disk automatically after any command that changes the data.
-There is no need to save manually. - -## Changing the save location -Address book data are saved in a file called `addressbook.txt` in the project root folder. -You can change the location by specifying the file path as a program argument.
- -> The file name must end in `.txt` for it to be acceptable to the program. -> -> When running the program inside IntelliJ, you can - [set command line parameters before running the program](https://stackoverflow.com/a/2066465). +There is no need to save manually. Address book data are saved in a file called `addressbook.txt` in the project root folder. From f52126ce529e7d670ed668586112203ce38b6c18 Mon Sep 17 00:00:00 2001 From: Tan Wang Leng Date: Thu, 17 Aug 2017 09:34:46 +0800 Subject: [PATCH 5/5] LearningOutcomes: Update JavaFx tutorial to IntelliJ version --- doc/LearningOutcomes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/LearningOutcomes.md b/doc/LearningOutcomes.md index 91a9896ce..8a2d6c876 100644 --- a/doc/LearningOutcomes.md +++ b/doc/LearningOutcomes.md @@ -84,11 +84,11 @@ Covered by `[LO-Polymorphism]` **Resources** -* [JavaFX 8 Tutorial](http://code.makery.ch/library/javafx-8-tutorial/) by Marco Jakob +* [JavaFX 8 Tutorial](https://se-edu.github.io/se-book/javaTools/javaFXBasic/) #### Exercise: Add class-level members -* If you are new to JavaFX, follow Marco's tutorial given above. +* If you are new to JavaFX, follow our tutorial given above. * Do some enhancements to the AddressBook GUI. e.g. add an application icon, change size/style ------------------------------------------------------------------------------------------------------