Search in sources :

Example 1 with SwingFormManager

use of com.servoy.j2db.smart.SwingFormManager 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)1 IForm (com.servoy.j2db.IForm)1 SwingFormManager (com.servoy.j2db.smart.SwingFormManager)1 Action (javax.swing.Action)1