Create scaffolding for Window API | fix some positioning issues in BaseComponent
This commit is contained in:
@@ -52,14 +52,18 @@ public class DefaultWindowManager extends BaseWidget implements WindowManager {
|
|||||||
public void open(Window window) {
|
public void open(Window window) {
|
||||||
requireNonNull(window, "Window cannot be null");
|
requireNonNull(window, "Window cannot be null");
|
||||||
|
|
||||||
windows.push(window);
|
windows.addLast(window);
|
||||||
window.setParent(this);
|
window.setParent(this);
|
||||||
window.onOpen(this);
|
window.onOpen(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
var window = windows.pop();
|
if (windows.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var window = windows.removeLast();
|
||||||
window.setParent(null);
|
window.setParent(null);
|
||||||
window.onClose(this);
|
window.onClose(this);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user