You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ Add the following elements to your project's `pom.xml` file (please check [Maven
26
26
27
27
<dependencies>
28
28
<dependency>
29
-
<groupId>com.github.albertus82</groupId>
29
+
<groupId>it.albertus</groupId>
30
30
<artifactId>jface-utils</artifactId>
31
31
<version>17.3.3</version>
32
32
</dependency>
@@ -81,17 +81,17 @@ This framework will allow you to create a complete preferences dialog by writing
81
81
82
82
### Getting started
83
83
84
-
In order to open a preferences dialog, you must instantiate a [`Preferences`](src/main/java/io/github/albertus82/jface/preference/Preferences.java) object and invoke one of its `openDialog` methods (e.g. from a `SelectionListener`). The [`Preferences`](src/main/java/io/github/albertus82/jface/preference/Preferences.java) constructors take three or four arguments:
85
-
*[`IPageDefinition[]`](src/main/java/io/github/albertus82/jface/preference/page/IPageDefinition.java): definitions of the pages that will contain the preference items;
86
-
*[`IPreference[]`](src/main/java/io/github/albertus82/jface/preference/IPreference.java): the preference items;
87
-
*[`IPreferencesCallback`](src/main/java/io/github/albertus82/jface/preference/IPreferencesCallback.java): the object that updates the application properties;
84
+
In order to open a preferences dialog, you must instantiate a [`Preferences`](src/main/java/it/albertus/jface/preference/Preferences.java) object and invoke one of its `openDialog` methods (e.g. from a `SelectionListener`). The [`Preferences`](src/main/java/it/albertus/jface/preference/Preferences.java) constructors take three or four arguments:
85
+
*[`IPageDefinition[]`](src/main/java/it/albertus/jface/preference/page/IPageDefinition.java): definitions of the pages that will contain the preference items;
86
+
*[`IPreference[]`](src/main/java/it/albertus/jface/preference/IPreference.java): the preference items;
87
+
*[`IPreferencesCallback`](src/main/java/it/albertus/jface/preference/IPreferencesCallback.java): the object that updates the application properties;
88
88
*`Image[]`: icons used for the preference dialogs (optional).
89
89
90
-
A convenient approach may be to implement [`IPageDefinition`](src/main/java/io/github/albertus82/jface/preference/page/IPageDefinition.java) and [`IPreference`](src/main/java/io/github/albertus82/jface/preference/IPreference.java) interfaces using enums, like in the following code examples.
90
+
A convenient approach may be to implement [`IPageDefinition`](src/main/java/it/albertus/jface/preference/page/IPageDefinition.java) and [`IPreference`](src/main/java/it/albertus/jface/preference/IPreference.java) interfaces using enums, like in the following code examples.
91
91
92
92
#### Page definition enum
93
93
94
-
This is a very simple example of enum that implements [`IPageDefinition`](src/main/java/io/github/albertus82/jface/preference/page/IPageDefinition.java):
94
+
This is a very simple example of enum that implements [`IPageDefinition`](src/main/java/it/albertus/jface/preference/page/IPageDefinition.java):
@@ -141,11 +141,11 @@ public enum MyPageDefinition implements IPageDefinition {
141
141
}
142
142
```
143
143
144
-
You can surely improve this code, for example introducing localization and autodetermining `nodeId` values using the enum names. This example makes use of [`PageDefinitionDetails`](src/main/java/io/github/albertus82/jface/preference/page/PageDefinitionDetails.java) helper class and its builder.
144
+
You can surely improve this code, for example introducing localization and autodetermining `nodeId` values using the enum names. This example makes use of [`PageDefinitionDetails`](src/main/java/it/albertus/jface/preference/page/PageDefinitionDetails.java) helper class and its builder.
145
145
146
146
#### Preference enum
147
147
148
-
This is a simple example of enum that implements [`IPreference`](src/main/java/io/github/albertus82/jface/preference/IPreference.java):
148
+
This is a simple example of enum that implements [`IPreference`](src/main/java/it/albertus/jface/preference/IPreference.java):
149
149
150
150
```java
151
151
publicenumMyPreferenceimplementsIPreference {
@@ -233,22 +233,22 @@ public enum MyPreference implements IPreference {
233
233
}
234
234
```
235
235
236
-
You can surely improve this code, for example introducing localization and autodetermining `name` values using the enum names. This example makes use of [`PreferenceDetails`](src/main/java/io/github/albertus82/jface/preference/PreferenceDetails.java) and [`FieldEditorDetails`](src/main/java/io/github/albertus82/jface/preference/FieldEditorDetails.java) helper classes and their respective builders.
236
+
You can surely improve this code, for example introducing localization and autodetermining `name` values using the enum names. This example makes use of [`PreferenceDetails`](src/main/java/it/albertus/jface/preference/PreferenceDetails.java) and [`FieldEditorDetails`](src/main/java/it/albertus/jface/preference/FieldEditorDetails.java) helper classes and their respective builders.
237
237
238
238
#### Callback object
239
239
240
-
The interface [`IPreferencesCallback`](src/main/java/io/github/albertus82/jface/preference/IPreferencesCallback.java) declares two methods:
240
+
The interface [`IPreferencesCallback`](src/main/java/it/albertus/jface/preference/IPreferencesCallback.java) declares two methods:
241
241
***`getFileName`**: must return the path and name of your configuration file.
242
242
***`reload`**: must **reload the configuration file and update your in-memory configuration properties**, so that your application can see the updated values. This method is invoked automatically when necessary (callback).
243
243
244
-
You can manually implement [`IPreferencesCallback`](src/main/java/io/github/albertus82/jface/preference/IPreferencesCallback.java) or [`PreferencesCallback`](src/main/java/io/github/albertus82/jface/preference/PreferencesCallback.java) or use/extend [`PropertiesConfiguration`](src/main/java/io/github/albertus82/util/PropertiesConfiguration.java) or [`Configuration`](src/main/java/io/github/albertus82/util/Configuration.java) depending on your needs.
244
+
You can manually implement [`IPreferencesCallback`](src/main/java/it/albertus/jface/preference/IPreferencesCallback.java) or [`PreferencesCallback`](src/main/java/it/albertus/jface/preference/PreferencesCallback.java) or use/extend [`PropertiesConfiguration`](src/main/java/it/albertus/util/PropertiesConfiguration.java) or [`Configuration`](src/main/java/it/albertus/util/Configuration.java) depending on your needs.
The [`FieldEditorFactory`](src/main/java/io/github/albertus82/jface/preference/FieldEditorFactory.java) helps you to create `FieldEditor` objects, as you saw in the previous [`IPreference`](src/main/java/io/github/albertus82/jface/preference/IPreference.java) example.
249
+
The [`FieldEditorFactory`](src/main/java/it/albertus/jface/preference/FieldEditorFactory.java) helps you to create `FieldEditor` objects, as you saw in the previous [`IPreference`](src/main/java/it/albertus/jface/preference/IPreference.java) example.
250
250
251
-
By default, custom values are presented in *bold* format. If you don't like this behaviour, you can disable it invoking the `setBoldCustomValues(boolean)` method of [`FieldEditorFactory`](src/main/java/io/github/albertus82/jface/preference/FieldEditorFactory.java):
251
+
By default, custom values are presented in *bold* format. If you don't like this behaviour, you can disable it invoking the `setBoldCustomValues(boolean)` method of [`FieldEditorFactory`](src/main/java/it/albertus/jface/preference/FieldEditorFactory.java):
252
252
253
253
```java
254
254
publicenumMyPreferenceimplementsIPreference {
@@ -265,7 +265,7 @@ public enum MyPreference implements IPreference {
265
265
266
266
#### Extension
267
267
268
-
If you need to create your custom `FieldEditor` classes, you can extend [`FieldEditorFactory`](src/main/java/io/github/albertus82/jface/preference/FieldEditorFactory.java) to add support for these new objects:
268
+
If you need to create your custom `FieldEditor` classes, you can extend [`FieldEditorFactory`](src/main/java/it/albertus/jface/preference/FieldEditorFactory.java) to add support for these new objects:
@@ -288,9 +288,9 @@ public class MyFieldEditorFactory extends FieldEditorFactory {
288
288
289
289
After that, you can use your new factory instead of the default one.
290
290
291
-
## macOS integration with [`CocoaUIEnhancer`](src/main/java/io/github/albertus82/jface/cocoa/CocoaUIEnhancer.java)
291
+
## macOS integration with [`CocoaUIEnhancer`](src/main/java/it/albertus/jface/cocoa/CocoaUIEnhancer.java)
292
292
293
-
The [`CocoaUIEnhancer`](src/main/java/io/github/albertus82/jface/cocoa/CocoaUIEnhancer.java) class provides a hook to connect the **Preferences**, **About** and **Quit** menu items of the **macOS** application menu.
293
+
The [`CocoaUIEnhancer`](src/main/java/it/albertus/jface/cocoa/CocoaUIEnhancer.java) class provides a hook to connect the **Preferences**, **About** and **Quit** menu items of the **macOS** application menu.
294
294
This is a modified version of the [`CocoaUIEnhancer`](http://www.transparentech.com/files/CocoaUIEnhancer.java) class available at [TransparenTech](http://www.transparentech.com/opensource/cocoauienhancer), and it is released under the Eclipse Public License ([EPL](https://www.eclipse.org/legal/epl-v10.html)).
295
295
296
296
In order to better integrate your JFace application with macOS, you should first call the following static methods of `Display` before its creation:
Next, you can use [`CocoaUIEnhancer`](src/main/java/io/github/albertus82/jface/cocoa/CocoaUIEnhancer.java) before opening the shell:
303
+
Next, you can use [`CocoaUIEnhancer`](src/main/java/it/albertus/jface/cocoa/CocoaUIEnhancer.java) before opening the shell:
304
304
305
305
```java
306
306
if (Util.isCocoa()) {
@@ -314,7 +314,7 @@ The `hookApplicationMenu` method is overloaded in order to accept **SWT Listener
314
314
315
315
SWT uses operating system resources to deliver its native graphics and widget functionality. These resources should be freed when no longer needed, and the traditional way to do it is calling the `dispose()` method on the objects that represent the resources, however this approach may be error prone.
316
316
317
-
Now, if you need to instantiate a `Widget`, `Resource` (like a `GC`), `Device` or `Clipboard` and you want to make sure that its resources will be released after use, you can use the `Closeable` wrappers available in the `io.github.albertus82.jface.closeable` package with a *try-for-resources* statement. The wrapped object will be disposed automatically after the `try` block like any other *closeable* resource, so you will not have to invoke its `dispose()` method.
317
+
Now, if you need to instantiate a `Widget`, `Resource` (like a `GC`), `Device` or `Clipboard` and you want to make sure that its resources will be released after use, you can use the `Closeable` wrappers available in the `it.albertus.jface.closeable` package with a *try-for-resources* statement. The wrapped object will be disposed automatically after the `try` block like any other *closeable* resource, so you will not have to invoke its `dispose()` method.
0 commit comments