use of com.servoy.j2db.scripting.RuntimeWindow in project servoy-client by Servoy.
the class NGFormManager method showFormInDialog.
@Override
public void showFormInDialog(String formName, Rectangle bounds, String title, boolean resizeble, boolean showTextToolbar, boolean closeAll, boolean modal, String windowName) {
// first window is modal, second reuses same dialog
boolean legacyV3Behavior = false;
if (windowName == null) {
windowName = DEFAULT_DIALOG_NAME;
legacyV3Behavior = true;
}
RuntimeWindow thisWindow = application.getRuntimeWindowManager().getWindow(windowName);
if (thisWindow != null && thisWindow.getType() != JSWindow.DIALOG && thisWindow.getType() != JSWindow.MODAL_DIALOG) {
// make sure it is closed before reference to it is lost
thisWindow.hide(true);
thisWindow.destroy();
thisWindow = null;
}
if (thisWindow == null) {
thisWindow = application.getRuntimeWindowManager().createWindow(windowName, modal ? JSWindow.MODAL_DIALOG : JSWindow.DIALOG, null);
}
thisWindow.setInitialBounds(bounds.x, bounds.y, bounds.width, bounds.height);
thisWindow.showTextToolbar(showTextToolbar);
thisWindow.setTitle(title);
thisWindow.setResizable(resizeble);
thisWindow.oldShow(formName, closeAll, legacyV3Behavior);
}
use of com.servoy.j2db.scripting.RuntimeWindow in project servoy-client by Servoy.
the class FormManager method showFormInFrame.
public void showFormInFrame(String formName, Rectangle bounds, String windowTitle, boolean resizeble, boolean showTextToolbar, String windowName) {
if (windowName == null) {
windowName = DEFAULT_DIALOG_NAME;
}
RuntimeWindow thisWindow = application.getRuntimeWindowManager().getWindow(windowName);
if (thisWindow != null && thisWindow.getType() != JSWindow.WINDOW) {
// make sure it's closed before reference to it is lost
thisWindow.hide(true);
thisWindow.destroy();
thisWindow = null;
}
if (thisWindow == null) {
thisWindow = application.getRuntimeWindowManager().createWindow(windowName, JSWindow.WINDOW, null);
}
thisWindow.setInitialBounds(bounds.x, bounds.y, bounds.width, bounds.height);
thisWindow.showTextToolbar(showTextToolbar);
thisWindow.setTitle(windowTitle);
thisWindow.setResizable(resizeble);
// last two params are really not relevant for windows
thisWindow.oldShow(formName, true, false);
}
use of com.servoy.j2db.scripting.RuntimeWindow in project servoy-client by Servoy.
the class FormManager method destroyContainer.
protected void destroyContainer(IMainContainer container) {
RuntimeWindow w = application.getRuntimeWindowManager().getWindow(container.getContainerName());
if (w != null)
w.destroy();
FormController fc = container.getController();
if (fc != null && fc.isFormVisible()) {
fc.getFormUI().setComponentVisible(false);
List<Runnable> invokeLaterRunnables = new ArrayList<Runnable>();
fc.notifyVisible(false, invokeLaterRunnables);
Utils.invokeLater(application, invokeLaterRunnables);
}
container.flushCachedItems();
}
use of com.servoy.j2db.scripting.RuntimeWindow in project servoy-client by Servoy.
the class NGRuntimeWindowManager method destroy.
public void destroy(boolean keepMainApplicationWindow) {
List<Entry<String, RuntimeWindow>> copy = new ArrayList<>(windows.entrySet());
for (Entry<String, RuntimeWindow> we : copy) {
RuntimeWindow rw = we.getValue();
if (rw != null) {
if (rw instanceof NGRuntimeWindow) {
((NGRuntimeWindow) rw).setController(null);
}
if (keepMainApplicationWindow && rw.equals(getMainApplicationWindow())) {
continue;
}
if (rw instanceof NGRuntimeWindow) {
rw.destroy();
}
}
windows.remove(we.getKey());
}
}
use of com.servoy.j2db.scripting.RuntimeWindow in project servoy-client by Servoy.
the class SwingRuntimeWindow method getParent.
// For future implementation of case 286968 change
// @Override
// public int getState()
// {
// if (wrappedWindow instanceof JFrame)
// {
// int extendedState = ((JFrame)wrappedWindow).getExtendedState();
// int servoyState = NORMAL; // 0
// if ((extendedState & Frame.ICONIFIED) == Frame.ICONIFIED) servoyState = servoyState | ICONIFIED;
// if ((extendedState & Frame.MAXIMIZED_BOTH) == Frame.MAXIMIZED_BOTH) servoyState = servoyState | MAXIMIZED;
// return servoyState;
// }
// else
// {
// return super.getState();
// }
// }
@Override
public JSWindow getParent() {
if (wrappedWindow != null) {
Window parent = wrappedWindow.getOwner();
RuntimeWindow pw;
if (parent == getApplication().getMainApplicationFrame()) {
pw = getApplication().getRuntimeWindowManager().getWindow(null);
} else if (parent != null) {
pw = getApplication().getRuntimeWindowManager().getWindow(parent.getName());
} else
pw = null;
return (pw != null) ? pw.getJSWindow() : null;
}
return super.getParent();
}
Aggregations