use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class SwingRuntimeWindow method doOldShowInWindow.
private void doOldShowInWindow(String formName) {
FormManager fm = ((FormManager) getApplication().getFormManager());
boolean toFront = createFrameIfNeeded(fm);
FormFrame frame = (FormFrame) wrappedWindow;
if (frame.isVisible()) {
frame.storeBounds();
}
IMainContainer container = frame.getMainContainer();
final FormController fp = fm.showFormInMainPanel(formName, container, title, true, windowName);
finalizeShowWindow(fp, formName, container, true, false, toFront);
}
use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class SwingRuntimeWindowManager method getOrderedContainers.
@Override
protected List<String> getOrderedContainers() {
// here we have to close in reverse order of the opening
FormManager fm = ((FormManager) application.getFormManager());
List<String> orderedDialogs = new ArrayList<String>();
Map<FormDialog, String> dialogs = new HashMap<FormDialog, String>();
List<String> all = fm.getCreatedMainContainerKeys();
for (String key : all) {
if (key != null) {
IMainContainer mContainer = fm.getMainContainer(key);
if (fm.getMainContainer(null) != mContainer) {
Container parent = ((Component) mContainer).getParent();
while (parent != null && !(parent instanceof FormDialog)) {
parent = parent.getParent();
}
if (parent instanceof FormDialog) {
dialogs.put((FormDialog) parent, key);
continue;
}
}
}
}
for (FormDialog dialog : dialogs.keySet()) {
addDialogsInOrder(dialog, dialogs, orderedDialogs);
}
if (orderedDialogs.size() < all.size()) {
for (String key : all) {
if (!orderedDialogs.contains(key)) {
orderedDialogs.add(key);
}
}
}
return orderedDialogs;
}
use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class SortModel method setValue.
void setValue(IApplication app, String notused) {
application = app;
try {
FormManager fm = (FormManager) application.getFormManager();
FormController fc = fm.getCurrentMainShowingFormController();
if (fc != null) {
Form form = fc.getForm();
ITable t = application.getFoundSetManager().getTable(form.getDataSource());
if (t != null) {
List<SortColumn> list = application.getFoundSetManager().getSortColumns(t, form.getInitialSort());
init(app, t, list);
}
}
} catch (RepositoryException e) {
Debug.error(e);
}
}
use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class FormFrame method closeWindow.
public void closeWindow() {
GraphicsDevice device = getGraphicsConfiguration().getDevice();
if (device.getFullScreenWindow() == this) {
// reset full-screen window when window closes
device.setFullScreenWindow(null);
}
storeBounds();
setVisible(false);
IFormManager ifm = application.getFormManager();
if (ifm instanceof FormManager) {
((FormManager) ifm).setCurrentContainer(null, null);
}
}
use of com.servoy.j2db.FormManager in project servoy-client by Servoy.
the class CmdManager method ableFormRelatedBrowseActions.
protected void ableFormRelatedBrowseActions(boolean enable) {
FormManager fm = (FormManager) application.getFormManager();
int view = FormController.LOCKED_LIST_VIEW;
if (enable) {
IForm formPanel = fm.getCurrentForm();
if (formPanel != null) {
view = formPanel.getView();
}
}
// $NON-NLS-1$
Action cmdviewasform = actions.get("cmdviewasform");
if (cmdviewasform != null)
cmdviewasform.setEnabled(view < 3);
// $NON-NLS-1$
Action cmdviewaslist = actions.get("cmdviewaslist");
if (cmdviewaslist != null)
cmdviewaslist.setEnabled(view < 3);
if (fm instanceof SwingFormManager) {
((SwingFormManager) fm).enableCmds(enable);
}
// if plugins have added menus
if (application.getImportMenu().getMenuComponents().length != 0) {
// $NON-NLS-1$
Action a = actions.get("menuimportaction");
if (a != null)
a.setEnabled(enable);
}
if (application.getExportMenu().getMenuComponents().length != 0) {
// $NON-NLS-1$
Action a = actions.get("menuexportaction");
if (a != null)
a.setEnabled(enable);
}
}
Aggregations