Search in sources :

Example 26 with FormManager

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);
}
Also used : FormController(com.servoy.j2db.FormController) FormManager(com.servoy.j2db.FormManager) IMainContainer(com.servoy.j2db.IMainContainer)

Example 27 with FormManager

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;
}
Also used : FormDialog(com.servoy.j2db.gui.FormDialog) IMainContainer(com.servoy.j2db.IMainContainer) IBasicMainContainer(com.servoy.j2db.IBasicMainContainer) Container(java.awt.Container) FormManager(com.servoy.j2db.FormManager) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) IMainContainer(com.servoy.j2db.IMainContainer) Component(java.awt.Component)

Example 28 with FormManager

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);
    }
}
Also used : FormController(com.servoy.j2db.FormController) FormManager(com.servoy.j2db.FormManager) Form(com.servoy.j2db.persistence.Form) ITable(com.servoy.j2db.persistence.ITable) RepositoryException(com.servoy.j2db.persistence.RepositoryException) SortColumn(com.servoy.j2db.dataprocessing.SortColumn)

Example 29 with FormManager

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);
    }
}
Also used : GraphicsDevice(java.awt.GraphicsDevice) IFormManager(com.servoy.j2db.IFormManager) IFormManager(com.servoy.j2db.IFormManager) FormManager(com.servoy.j2db.FormManager)

Example 30 with FormManager

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);
    }
}
Also used : Action(javax.swing.Action) SwingFormManager(com.servoy.j2db.smart.SwingFormManager) FormManager(com.servoy.j2db.FormManager) SwingFormManager(com.servoy.j2db.smart.SwingFormManager) IForm(com.servoy.j2db.IForm)

Aggregations

FormManager (com.servoy.j2db.FormManager)49 IMainContainer (com.servoy.j2db.IMainContainer)21 FormController (com.servoy.j2db.FormController)15 MainPage (com.servoy.j2db.server.headlessclient.MainPage)13 IForm (com.servoy.j2db.IForm)7 Form (com.servoy.j2db.persistence.Form)5 IFoundSetInternal (com.servoy.j2db.dataprocessing.IFoundSetInternal)4 RepositoryException (com.servoy.j2db.persistence.RepositoryException)4 IComponent (com.servoy.j2db.ui.IComponent)4 Component (java.awt.Component)4 ArrayList (java.util.ArrayList)4 FlattenedSolution (com.servoy.j2db.FlattenedSolution)3 FormWindow (com.servoy.j2db.FormWindow)3 IBasicFormManager (com.servoy.j2db.IBasicFormManager)3 IFormController (com.servoy.j2db.IFormController)3 IFormManager (com.servoy.j2db.IFormManager)3 ITable (com.servoy.j2db.persistence.ITable)3 SwingFormManager (com.servoy.j2db.smart.SwingFormManager)3 IFieldComponent (com.servoy.j2db.ui.IFieldComponent)3 ServoyException (com.servoy.j2db.util.ServoyException)3