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
+61-4
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,10 @@
14
14
15
15
*[`ControlWrapper`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/ControlWrapper.html) - create custom widgets which properly encapsulate their base control.
16
16
*[`Coat`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/Coat.html) - a functional interface for populating an empty Composite.
17
+
*[`CoatMux`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/CoatMux.html) - a mechanism for layering and swapping Coats.
17
18
*[`SwtExec`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/SwtExec.html) - an `ExecutorService` which executes on the SWT thread.
18
-
*[`SwtExec.Guarded`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/SwtExec.Guarded.html) - an `Executor` which is tied to the lifetime of an SWT widget. Say goodbye to `SWTException: Widget is disposed` forever! It can also subscribe to any kind of observable (Guava's ListenableFuture or RxJava's Observable), see [DurianRx](https://github.com/diffplug/durian-rx) for more info.
19
+
*[`SwtExec.Guarded`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/SwtExec.Guarded.html) - an `ExecutorService` which is tied to the lifetime of an SWT widget. Say goodbye to `SWTException: Widget is disposed` forever! It can also subscribe to any kind of observable (Guava's ListenableFuture or RxJava's Observable), see [DurianRx](https://github.com/diffplug/durian-rx) for more info.
.setSize(SwtMisc.defaultDialogWidth(), 0) // set the width, pack height to fit contents
52
54
.openOnDisplayBlocking();
53
55
```
54
56
57
+
*[`Actions`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/jface/Actions.html) - builder and one-liner:
58
+
`Actions.create("Redo", this::redo);`
59
+
60
+
*[`LabelProviders`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/jface/LabelProviders.html) - builder and one-liner:
61
+
`LabelProviders.createWithText(Person::getName)`
62
+
63
+
*[`ColumnFormat`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/ColumnFormat.html) and [`ColumnViewerFormat`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/jface/ColumnViewerFormat.html) - dialogs without boilerplate
64
+
65
+
```java
66
+
ColumnViewerFormat<Person> format =ColumnViewerFormat.createWithStyle(style |SWT.FULL_SELECTION);
*[`OnePerWidget`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/OnePerWidget.html) - a cache tied to the lifetime of an SWT Widget.
58
77
*[`ColorPool`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/ColorPool.html) - a pool of colors tied to the lifetime of a widget. `ColorPool.forWidget(widget).getColor(rgbValue)`
59
-
*[`ImageDescriptors`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/ImageDescriptors.html) - use ImageDescriptors with proper resource sharing. `ImageDescriptors.set(btn, imageDescriptor)`
78
+
*[`ImageDescriptors`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/jface/ImageDescriptors.html) - use ImageDescriptors with proper resource sharing. `ImageDescriptors.set(btn, imageDescriptor)`
79
+
80
+
### Interactive testing
81
+
82
+
Ideally, all UI code would have fully automated UI testing, but
83
+
such tests are time-consuming to write, so they often just don't
84
+
get written at all. [`InteractiveTest`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/InteractiveTest.html)
85
+
bridges the gap by making it easy to write user-in-the-loop guided tests. Furthermore,
86
+
these tests can even be run in a [headless enviroment on a CI server](https://github.com/diffplug/durian-swt/blob/master/build.gradle#L66-L93), where the test UI
87
+
will be opened, then automatically closed after a timeout. This ensures that the tests
88
+
are all in working order and ready for a human tester to do final validation.
89
+
90
+

91
+
92
+
From [`ViewerMiscTest.java`](https://github.com/diffplug/durian-swt/blob/master/test/com/diffplug/common/swt/jface/ViewerMiscTest.java):
+ `treeDefControl`, `treeDefComposite` - a [`TreeDef`](http://diffplug.github.io/durian/javadoc/snapshot/com/diffplug/common/base/TreeDef.html) for traversing UI elements.
68
121
+ `setEnabledDeep` - sets the enabled status of every child, grandchild, etc. of the given composite.
69
-
122
+
*[`SwtRx`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/SwtRx.html) - methods for converting SWT events and models to RxJava Observables.
123
+
*[`SwtDebug`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/SwtDebug.html) - utilities for debugging SWT events.
70
124
*[`OS`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/os/OS.html), [`Arch`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/os/Arch.html), and [`SwtPlatform`](http://diffplug.github.io/durian-swt/javadoc/snapshot/com/diffplug/common/swt/os/SwtPlatform.html) - detect things about the running system, and manipulate the SWT jars for build tools.
71
125
+ These do not require SWT or JFace, so you can add DurianSwt to your gradle or maven dependencies without needing to also figure out the SWT messiness.
72
126
+ You can also just copy-paste these straight into your own code - they have no external dependencies.
0 commit comments