Search in sources :

Example 91 with Form

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

the class DataRenderer method onDrop.

public boolean onDrop(JSDNDEvent event) {
    Form form = dragNdropController.getForm();
    int onDropID = form.getOnDropMethodID();
    if (onDropID > 0) {
        // $NON-NLS-1$
        Object dropHappened = dragNdropController.executeFunction(Integer.toString(onDropID), new Object[] { event }, false, null, false, "onDropMethodID");
        if (dropHappened instanceof Boolean)
            return ((Boolean) dropHappened).booleanValue();
    }
    return false;
}
Also used : Form(com.servoy.j2db.persistence.Form) Point(java.awt.Point)

Example 92 with Form

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

the class FormLookupPanel method getDefaultSort.

public List<SortColumn> getDefaultSort() {
    if (defaultSort == null) {
        try {
            FormController fc = getFormPanel();
            if (fc != null) {
                Form f = fc.getForm();
                defaultSort = ((FoundSetManager) application.getFoundSetManager()).getSortColumns(f.getDataSource(), f.getInitialSort());
            }
        } catch (RepositoryException e) {
            Debug.error(e);
            defaultSort = new ArrayList<SortColumn>(1);
        }
    }
    return defaultSort;
}
Also used : FormController(com.servoy.j2db.FormController) Form(com.servoy.j2db.persistence.Form) ArrayList(java.util.ArrayList) RepositoryException(com.servoy.j2db.persistence.RepositoryException)

Example 93 with Form

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

the class ScrollResponseHeaderContainer method initDragNDrop.

public void initDragNDrop(FormController formController, int clientDesignYOffset) {
    this.yOffset = clientDesignYOffset;
    boolean enableDragDrop = false;
    if (cellview instanceof Portal) {
        Portal cellviewPortal = (Portal) cellview;
        enableDragDrop = (cellviewPortal.getOnDragMethodID() > 0 || cellviewPortal.getOnDragEndMethodID() > 0 || cellviewPortal.getOnDragOverMethodID() > 0 || cellviewPortal.getOnDropMethodID() > 0);
    } else {
        Form form = formController.getForm();
        enableDragDrop = (form.getOnDragMethodID() > 0 || form.getOnDragEndMethodID() > 0 || form.getOnDragOverMethodID() > 0 || form.getOnDropMethodID() > 0);
    }
    if (enableDragDrop) {
        dragNdropController = formController;
        addDragNDropBehavior();
    }
}
Also used : IForm(com.servoy.j2db.IForm) Form(com.servoy.j2db.persistence.Form) WebForm(com.servoy.j2db.server.headlessclient.WebForm) Portal(com.servoy.j2db.persistence.Portal) RuntimePortal(com.servoy.j2db.ui.scripting.RuntimePortal)

Example 94 with Form

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

the class WebDataRenderer method onDrag.

public int onDrag(JSDNDEvent event) {
    Form form = dragNdropController.getForm();
    int onDragID = form.getOnDragMethodID();
    if (onDragID > 0) {
        // $NON-NLS-1$
        Object dragReturn = dragNdropController.executeFunction(Integer.toString(onDragID), new Object[] { event }, false, null, false, "onDragMethodID");
        if (dragReturn instanceof Number)
            return ((Number) dragReturn).intValue();
    }
    return DRAGNDROP.NONE;
}
Also used : Form(com.servoy.j2db.persistence.Form) WebForm(com.servoy.j2db.server.headlessclient.WebForm) Point(java.awt.Point)

Example 95 with Form

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

the class WebDataRenderer method onDragEnd.

public void onDragEnd(JSDNDEvent event) {
    Form form = dragNdropController.getForm();
    int onDragEndID = form.getOnDragEndMethodID();
    if (onDragEndID > 0) {
        // $NON-NLS-1$
        dragNdropController.executeFunction(Integer.toString(onDragEndID), new Object[] { event }, false, null, false, "onDragEndMethodID");
    }
}
Also used : Form(com.servoy.j2db.persistence.Form) WebForm(com.servoy.j2db.server.headlessclient.WebForm) Point(java.awt.Point)

Aggregations

Form (com.servoy.j2db.persistence.Form)146 FlattenedForm (com.servoy.j2db.persistence.FlattenedForm)35 ArrayList (java.util.ArrayList)32 Point (java.awt.Point)26 FlattenedSolution (com.servoy.j2db.FlattenedSolution)24 IPersist (com.servoy.j2db.persistence.IPersist)22 ISMForm (com.servoy.j2db.solutionmodel.ISMForm)20 JSONObject (org.json.JSONObject)20 Solution (com.servoy.j2db.persistence.Solution)16 Dimension (java.awt.Dimension)15 Part (com.servoy.j2db.persistence.Part)14 RepositoryException (com.servoy.j2db.persistence.RepositoryException)14 FormController (com.servoy.j2db.FormController)13 WebFormComponent (com.servoy.j2db.server.ngclient.WebFormComponent)12 IMobileSMForm (com.servoy.base.solutionmodel.mobile.IMobileSMForm)11 IForm (com.servoy.j2db.IForm)11 ScriptMethod (com.servoy.j2db.persistence.ScriptMethod)11 FormElement (com.servoy.j2db.server.ngclient.FormElement)11 HashMap (java.util.HashMap)11 JSFunction (org.mozilla.javascript.annotations.JSFunction)11