Skip to content

Commit ace244c

Browse files
committed
Added ControlWrapper.setParent
1 parent 2c024c0 commit ace244c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Shells now reposition themselves if they were going to open offscreen.
88
- Shells no longer set their image on Mac, so that they don't hijack the dock icon.
99
- Added `ControlWrapper.transparent` for efficiently passing `Control` to `ControlWrapper`.
10+
- Added `ControlWrapper.setParent` which is a pure delegation to `Control.setParent`.
1011
- Improved `StructuredDrop.handler`.
1112
- Added `SwtMisc.globalBounds` for `ControlWrapper`.
1213

durian-swt/src/main/java/com/diffplug/common/swt/ControlWrapper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ default boolean isDisposed() {
6666
return getRootControl().isDisposed();
6767
}
6868

69+
/**
70+
* Changes the parent of the widget to be the one provided.
71+
* Returns <code>true</code> if the parent is successfully changed
72+
*/
73+
default boolean setParent(Composite parent) {
74+
return getRootControl().setParent(parent);
75+
}
76+
6977
/**
7078
* Returns the wrapped {@link Control} (only appropriate for limited purposes!).
7179
* <p>

0 commit comments

Comments
 (0)