Search in sources :

Example 11 with IForm

use of com.servoy.j2db.IForm in project servoy-client by Servoy.

the class CmdReduceFind method doIt.

/*
 * _____________________________________________________________ The methods below override methods from superclass AbstractCmd
 */
@Override
public UndoableEdit doIt(java.util.EventObject ae) {
    IFormManager fm = application.getFormManager();
    IForm cf = fm.getCurrentForm();
    if (cf != null && !cf.isInFindMode()) {
        cf = null;
    }
    if (cf == null) {
        IForm[] rfif = ((FormManager) fm).getVisibleRootFormsInFind();
        cf = rfif.length > 0 ? rfif[0] : null;
    // rfif.length > 1 would be a strange case where more than one visible form relation hierarchy is in find mode;
    // we choose the first one - I or should we use all of them?! this is an ansupported case anyway
    }
    if (cf != null) {
        cf.performFind(false, true, true);
    }
    return null;
}
Also used : IFormManager(com.servoy.j2db.IFormManager) IFormManager(com.servoy.j2db.IFormManager) FormManager(com.servoy.j2db.FormManager) IForm(com.servoy.j2db.IForm)

Example 12 with IForm

use of com.servoy.j2db.IForm in project servoy-client by Servoy.

the class CmdShowOmitRecords method doIt.

/*
 * _____________________________________________________________ The methods below override methods from superclass AbstractCmd
 */
@Override
public UndoableEdit doIt(java.util.EventObject ae) {
    try {
        // $NON-NLS-1$
        application.blockGUI(application.getI18NMessage("servoy.menuitem.showOmitted.status.text"));
        IFormManager fm = application.getFormManager();
        IForm dm = fm.getCurrentForm();
        dm.showOmittedRecords();
    } finally {
        application.releaseGUI();
    }
    return null;
}
Also used : IFormManager(com.servoy.j2db.IFormManager) IForm(com.servoy.j2db.IForm)

Example 13 with IForm

use of com.servoy.j2db.IForm in project servoy-client by Servoy.

the class CmdSort method doIt.

@Override
public UndoableEdit doIt(java.util.EventObject ae) {
    try {
        // $NON-NLS-1$
        application.blockGUI(application.getI18NMessage("servoy.menuitem.sort.status.text"));
        IFormManager fm = application.getFormManager();
        IForm dm = fm.getCurrentForm();
        dm.showSortDialog();
    } catch (Exception ex) {
        Debug.error(ex);
    } finally {
        application.releaseGUI();
    }
    return null;
}
Also used : IFormManager(com.servoy.j2db.IFormManager) IForm(com.servoy.j2db.IForm)

Example 14 with IForm

use of com.servoy.j2db.IForm in project servoy-client by Servoy.

the class CmdStopSearchFindAll method doIt.

@Override
public UndoableEdit doIt(java.util.EventObject ae) {
    try {
        // $NON-NLS-1$
        application.blockGUI(application.getI18NMessage("servoy.menuitem.showAll.status.text"));
        FormManager fm = (FormManager) application.getFormManager();
        IForm[] rootFindModeForms = fm.getVisibleRootFormsInFind();
        for (IForm fc : rootFindModeForms) {
            fc.loadAllRecords();
        }
    } finally {
        application.releaseGUI();
    }
    return null;
}
Also used : FormManager(com.servoy.j2db.FormManager) IForm(com.servoy.j2db.IForm)

Example 15 with IForm

use of com.servoy.j2db.IForm in project servoy-client by Servoy.

the class AbstractRuntimeTabPaneAlike method js_addTab.

@SuppressWarnings("nls")
public boolean js_addTab(Object[] vargs) {
    if (vargs.length < 1)
        return false;
    int index = 0;
    Object form = vargs[index++];
    IForm formController = null;
    String formName = null;
    if (form instanceof IForm) {
        formController = (IForm) form;
    }
    if (form instanceof BasicFormController.JSForm) {
        formController = ((BasicFormController.JSForm) form).getFormPanel();
    }
    if (formController != null)
        formName = formController.getName();
    if (form instanceof String)
        formName = (String) form;
    if (formName == null) {
        return false;
    }
    String tabName = formName;
    if (vargs.length >= 2) {
        tabName = (String) vargs[index++];
    }
    String tabText = tabName;
    if (vargs.length >= 3) {
        tabText = (String) vargs[index++];
    }
    String tooltip = "";
    if (vargs.length >= 4) {
        tooltip = (String) vargs[index++];
    }
    String iconURL = "";
    if (vargs.length >= 5) {
        iconURL = (String) vargs[index++];
    }
    String fg = null;
    if (vargs.length >= 6) {
        fg = (String) vargs[index++];
    }
    String bg = null;
    if (vargs.length >= 7) {
        bg = (String) vargs[index++];
    }
    RelatedFoundSet relatedFs = null;
    String relationName = null;
    int tabIndex = -1;
    if (vargs.length > 7) {
        Object object = vargs[index++];
        if (object instanceof RelatedFoundSet) {
            relatedFs = (RelatedFoundSet) object;
            relationName = relatedFs.getRelationName();
            if (formController != null && !relatedFs.getDataSource().equals(formController.getDataSource())) {
                return false;
            }
        // TODO do this check to check if the parent table has this relation? How to get the parent table
        // Table parentTable = null;
        // application.getSolution().getRelations(Solution.SOLUTION+Solution.MODULES, parentTable, true, false);
        } else if (object instanceof String) {
            relationName = (String) object;
        } else if (object instanceof Number) {
            tabIndex = ((Number) object).intValue();
        }
    }
    if (vargs.length > 8) {
        tabIndex = Utils.getAsInteger(vargs[index++]);
    }
    testTabName(tabName);
    return getComponent().addTab(formController, formName, tabName, tabText, tooltip, iconURL, fg, bg, relationName, relatedFs, tabIndex);
}
Also used : RelatedFoundSet(com.servoy.j2db.dataprocessing.RelatedFoundSet) IForm(com.servoy.j2db.IForm) BasicFormController(com.servoy.j2db.BasicFormController)

Aggregations

IForm (com.servoy.j2db.IForm)24 IFormManager (com.servoy.j2db.IFormManager)14 FormController (com.servoy.j2db.FormController)7 FormManager (com.servoy.j2db.FormManager)7 RepositoryException (com.servoy.j2db.persistence.RepositoryException)4 FlattenedSolution (com.servoy.j2db.FlattenedSolution)2 IScriptExecuter (com.servoy.j2db.IScriptExecuter)2 AbstractBase (com.servoy.j2db.persistence.AbstractBase)2 Form (com.servoy.j2db.persistence.Form)2 IDataProvider (com.servoy.j2db.persistence.IDataProvider)2 SwingFormManager (com.servoy.j2db.smart.SwingFormManager)2 IDisplayTagText (com.servoy.j2db.ui.IDisplayTagText)2 IStylePropertyChangesRecorder (com.servoy.j2db.ui.IStylePropertyChangesRecorder)2 RenderEventExecutor (com.servoy.j2db.ui.RenderEventExecutor)2 Pair (com.servoy.j2db.util.Pair)2 IOException (java.io.IOException)2 Map (java.util.Map)2 AbstractActiveSolutionHandler (com.servoy.j2db.AbstractActiveSolutionHandler)1 ApplicationException (com.servoy.j2db.ApplicationException)1 BasicFormController (com.servoy.j2db.BasicFormController)1