Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
martinfrancois committed Jul 20, 2019
2 parents 24cdff4 + 69c2950 commit 8323161
Show file tree
Hide file tree
Showing 52 changed files with 1,585 additions and 456 deletions.
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Thanks for your contribution!
To help us review your change, please follow the instructions in the template.
-->

<!-- PULL REQUEST TEMPLATE -->
<!-- (Update "[ ]" to "[x]" to check a box) -->

## PR Checklist

- [ ] There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open an issue first and wait for approval before working on it.
- [ ] The code follows the [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html).
- [ ] JavaDoc is added / changed for public methods.
- [ ] An example of the new feature is added to the [demos](https://github.com/dlemmermann/PreferencesFX/tree/develop/preferencesfx-demo/src/main/java/com/dlsc/preferencesfx).
- [ ] Documentation of the feature is included in the [README](https://github.com/dlemmermann/PreferencesFX/blob/develop/README.md).
- [ ] Tests for the changes are included.

## What is the current behavior?
<!-- Please describe the current behavior that you are changing, or link to a relevant issue. -->

## What is the new behavior?
<!-- Describe the changes -->

Fixes/Implements/Closes #[Issue Number].

## Breaking Change:
<!-- What is breaking and why we have to break it. Remove this section only if it was NOT a breaking change. -->
77 changes: 71 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,54 @@
**Preference dialogs for business applications made easy. Creating preference dialogs in Java has never been this easy!**

[ ![Download](https://api.bintray.com/packages/dlsc-oss/repository/PreferencesFX/images/download.svg) ](https://bintray.com/dlsc-oss/repository/PreferencesFX/_latestVersion)
[ ![Develop Branch](https://travis-ci.org/dlemmermann/PreferencesFX.svg?branch=develop)](https://travis-ci.org/dlemmermann/PreferencesFX.svg?branch=master)
[![Build Status](https://travis-ci.org/dlemmermann/PreferencesFX.svg?branch=master)](https://travis-ci.org/dlemmermann/PreferencesFX)

![screenshot of created preferences dialog](docs/images/preferencesFX_in_use.png)

## Table of Contents
- [Maven](#maven)
- [Gradle](#gradle)
- [What is PreferencesFX](#what-is-preferencesfx)
- [Advantages](#advantages)
- [Main Features](#main-features)
- [Documentation](#documentation)
- [Structure](#structure)
- [Demos](#demos)
- [Defining a preferences dialog](#defining-a-preferences-dialog)
- [Required arguments](#required-arguments)
- [Optional arguments](#optional-arguments)
- [Setting types](#setting-types)
- [Localisation](#localisation)
- [Validation](#validation)
- [Team](#team)

## Maven

To use this framework as part of your Maven build simply add the jcentral repository to your pom.xml file and use the following dependency definition.
To use this framework as part of your Maven build simply add the following dependency to your pom.xml file:

### Java 8
```XML
<dependency>
<groupId>com.dlsc.preferencesfx</groupId>
<artifactId>preferencesfx-core</artifactId>
<version>2.1.0</version>
<version>8.3.0</version>
</dependency>
```

### Java 11
```XML
<dependency>
<groupId>com.dlsc.preferencesfx</groupId>
<artifactId>preferencesfx-core</artifactId>
<version>11.3.0</version>
</dependency>
```

## Gradle

To use this framework as part of your gradle build simply add the following to your build.gradle file and use the following dependency definition.
To use this framework as part of your gradle build simply add the following to your build.gradle file and use the following dependency definition:

### Java 8
```groovy
repositories {
maven {
Expand All @@ -31,7 +58,20 @@ repositories {
}
dependencies {
compile group: 'com.dlsc.preferencesfx', name: 'preferencesfx-core', version: '2.1.0'
compile group: 'com.dlsc.preferencesfx', name: 'preferencesfx-core', version: '8.3.0'
}
```

### Java 11
```groovy
repositories {
maven {
url 'http://maven.bestsolution.at/efxclipse-releases/'
}
}
dependencies {
compile group: 'com.dlsc.preferencesfx', name: 'preferencesfx-core', version: '11.3.0'
}
```

Expand Down Expand Up @@ -86,7 +126,8 @@ PreferencesFx preferencesFx =
```
Notes:
- It is also possible to omit the `Group` and declare all settings in a `Category` directly. However, in this case all settings will simply be displayed one after another without grouping. If you want more control, use `Group`.
- A `Group` can also be defined without a title. In this case, the individual groups are displayed with more space inbetween them, to ensure they can be differentiated.
- A `Group` can also be defined without a title. In this case, the individual groups are displayed with more space in between them, to ensure they can be differentiated.
- A `Category` can also take a graphic node to be used as an icon as the second argument, e.g. `Category.of("Category Title", new ImageView(new Image("file:icon.png")),`

## Demos
We created several demos to visualize the capabilities of PreferencesFX.
Expand Down Expand Up @@ -117,6 +158,7 @@ PreferencesFx preferencesFx =
Setting.of("Setting title 2", booleanProperty) // which contains both settings
),
Category.of("Category title 2")
.expand() // Expand the parent category in the tree-view
.subCategories( // adds a subcategory to "Category title 2"
Category.of("Category title 3",
Group.of("Group title 1",
Expand Down Expand Up @@ -159,14 +201,18 @@ The following parameters are optionally available to further configure the dialo
Method | Class | Description
------ | ----- | -----------
`.subCategories` | `Category` | Subcategories allow a `Category` to have additional subcategories as children. Those are also displayed in the tree.
`.expand` | `Category` | Allows to specify if the `Category` should be expanded in the Tree-View by default.
`.description` | `Group` | If you decide not to add the description of a group in the constructor, you can still add it after the creation of the group.
`.validate` | `Setting` | Allows to add a [Validator](http://dlsc.com/wp-content/html/formsfx/apidocs/com/dlsc/formsfx/model/validators/Validator.html) to a setting, to set constraints to the values that can be entered.
`.persistApplicationState` | `PreferencesFx` | Defines if the Preferences API should save the application states. This includes the state persistence of the dialog window, as well as the values of each Setting.
`.persistWindowState` | `PreferencesFx` | Defines whether the state of the dialog window (position, size, last selected Category) should be persisted or not. Defaults to false.
`.saveSettings` | `PreferencesFx` | Defines whether the changed settings in the Preferences window should be saved or not. Defaults to true.
`.debugHistoryMode` | `PreferencesFx` | Makes it possible to enable or disable the keycombination to open a debug view of the list of all actions in the history (undo / redo). Pressing Ctrl + Shift + H (Windows) or CMD + Shift + H (Mac) opens a dialog with the undo / redo history, shown in a table. Defaults to false.
`.buttonsVisibility` | `PreferencesFx` | Sets the visibility of the cancel and close buttons in the `PreferencesFxDialog`. Defaults to true.
`.instantPersistent` | `PreferencesFx` | If set to true, it will instantly apply any changes that are being made in the `PreferencesFxDialog`. If set to false, it will only apply changes when the `Save` button is pressed. Defaults to true.
`.i18n` | `PreferencesFx` | Sets the translation service of the preferences dialog for internationalization.
`.dialogTitle` | `PreferencesFx` | Allows to specify a custom dialog title.
`.dialogIcon` | `PreferencesFx` | Allows to specify a custom dialog icon.

#### Setting types
The following table shows how to create `Settings` using the predefined controls and how they look like:
Expand Down Expand Up @@ -266,6 +312,23 @@ Setting.of("Favorites", favoritesItems, favoritesSelection);</pre>
</tr>
<tr>
<td><pre lang="java">
// Color
ObjectProperty<Color> colorProperty = new SimpleObjectProperty<>(Color.PAPAYAWHIP);
Setting.of("Font Color", colorProperty);</pre>
</td>
<td><img src="./docs/images/settings/color_setting.png"/></td>
</tr>
<tr>
<td><pre lang="java">
// FileChooser / DirectoryChooser
ObjectProperty<File> fileProperty = new SimpleObjectProperty<>();
Setting.of("File", fileProperty, false); // FileChooser
Setting.of("Directory", fileProperty, true); // DirectoryChooser</pre>
</td>
<td><img src="./docs/images/settings/chooser_setting.png"/></td>
</tr>
<tr>
<td><pre lang="java">
// Custom Control
IntegerProperty customControlProperty = new SimpleIntegerProperty(42);
IntegerField customControl = Field.ofIntegerType(customControlProperty).render(
Expand All @@ -276,6 +339,8 @@ Setting.of("Favorite Number", customControl, customControlProperty);</pre>
</tr>
</table>

Note: By default, PreferencesFX saves the settings under a key which consists of the breadcrumb to the setting, delimited by `#` signs. If you want to define your own key to be used for saving, use the method `setting.customKey("key")`

## Localisation
All displayed strings can be internationalized. You can use [resource bundles](https://docs.oracle.com/javase/8/docs/api/java/util/ResourceBundle.html) to define different locales and use the key instead of the descriptions. Adding i18n support is simply done by calling the method `.i18n()` at the end when creating the preferences:

Expand Down
Loading

0 comments on commit 8323161

Please sign in to comment.