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);
}
}
Aggregations