Skip to content

Commit

Permalink
[nus-cs2103-AY1718S1#83] Migrate project to use IntelliJ instead of E…
Browse files Browse the repository at this point in the history
  • Loading branch information
yamgent authored Aug 19, 2017
2 parents 671c222 + f52126c commit 0c99fd0
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 71 deletions.
12 changes: 0 additions & 12 deletions .classpath

This file was deleted.

17 changes: 0 additions & 17 deletions .project

This file was deleted.

11 changes: 0 additions & 11 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

43 changes: 28 additions & 15 deletions doc/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kbd>ALT</kbd>+<kbd>ENTER</kbd> 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
<img src="images/mainClassDiagram.png"/>

## 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

Expand Down
4 changes: 2 additions & 2 deletions doc/LearningOutcomes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

------------------------------------------------------------------------------------------------------
Expand Down
20 changes: 6 additions & 14 deletions doc/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<img src="images/Ui.png">

Expand Down Expand Up @@ -105,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.<br>
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.<br>

> 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).
There is no need to save manually. Address book data are saved in a file called `addressbook.txt` in the project root folder.

0 comments on commit 0c99fd0

Please sign in to comment.