Search in sources :

Example 31 with FormController

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

the class WebTabPanel method showFoundSet.

protected void showFoundSet(WebTabFormLookup flp, IRecordInternal parentState, List<SortColumn> sort) {
    deregisterSelectionListeners();
    if (!flp.isReady())
        return;
    FormController fp = flp.getWebForm().getController();
    if (fp != null && flp.getRelationName() != null) {
        IFoundSetInternal relatedFoundset = parentState == null ? null : parentState.getRelatedFoundSet(flp.getRelationName(), sort);
        registerSelectionListeners(parentState, flp.getRelationName());
        fp.loadData(relatedFoundset, null);
    }
    ITagResolver resolver = getTagResolver(parentState);
    // refresh tab text
    for (int i = 0; i < allTabs.size(); i++) {
        WebTabHolder element = allTabs.get(i);
        if (element.getPanel() == flp) {
            element.refreshTagStrings(resolver);
            break;
        }
    }
}
Also used : FormController(com.servoy.j2db.FormController) IFoundSetInternal(com.servoy.j2db.dataprocessing.IFoundSetInternal) ITagResolver(com.servoy.base.util.ITagResolver) Point(java.awt.Point)

Example 32 with FormController

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

the class WebTabPanel method recomputeTabSequence.

public void recomputeTabSequence() {
    FormController fc = currentForm.getWebForm().getController();
    fc.recomputeTabSequence(tabSequenceIndex);
}
Also used : FormController(com.servoy.j2db.FormController)

Example 33 with FormController

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

the class WebTabPanel method notifyResized.

public void notifyResized() {
    if (currentForm != null && currentForm.isReady()) {
        WebForm webForm = currentForm.getWebForm();
        FormController controller = webForm.getController();
        if (controller != null && webForm.isFormWidthHeightChanged()) {
            controller.notifyResized();
            webForm.clearFormWidthHeightChangedFlag();
        }
    }
}
Also used : FormController(com.servoy.j2db.FormController) WebForm(com.servoy.j2db.server.headlessclient.WebForm)

Example 34 with FormController

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

the class BaseEventExecutor method fireEventCommand.

public Object fireEventCommand(EventType type, String cmd, Object[] args, Object[] persistArgs, boolean saveData, Object display, boolean focusEvent, int modifiers, String formName, boolean executeWhenFieldValidationFailed, Point mouseLocation, Point absoluteMouseLocation) {
    if (actionListener == null)
        return null;
    FormController fc = actionListener.getFormController();
    // won't be able to execute - form is already destroyed
    if (fc == null)
        return null;
    // also fire when cmd is null (may trigger field validation)
    if (modifiers != MODIFIERS_UNSPECIFIED)
        actionListener.setLastKeyModifiers(modifiers);
    String name = getElementName(display);
    String fName = formName;
    if (fName == null)
        fName = getFormName(display);
    if (fName == null)
        fName = this.formName;
    if (fName == null)
        fName = getFormName();
    // TODO can't this be the only one used and formName/display args as well as formName member removed?
    if (fName == null)
        fName = fc.getName();
    if (this.formName == null && fName != null)
        setFormName(fName);
    // TODO can't an abstract Object getComponent() be created for this and display be removed as arg ? all subclasses have such a reference
    Object source = getSource(display);
    JSEvent event = new JSEvent();
    event.setType(type);
    event.setSource(source);
    event.setFormName(fName);
    event.setElementName(name);
    event.setModifiers(modifiers == MODIFIERS_UNSPECIFIED ? 0 : modifiers);
    if (mouseLocation != null)
        event.setLocation(mouseLocation);
    if (absoluteMouseLocation != null)
        event.setAbsoluteLocation(absoluteMouseLocation);
    return actionListener.executeFunction(cmd, Utils.arrayMerge(Utils.arrayJoin(args, new Object[] { event }), persistArgs), saveData, source, focusEvent, null, executeWhenFieldValidationFailed);
}
Also used : FormController(com.servoy.j2db.FormController) JSEvent(com.servoy.j2db.scripting.JSEvent)

Example 35 with FormController

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

the class J2DBClient method setTitle.

public void setTitle(String name) {
    // $NON-NLS-1$
    String title = "";
    String solutionTitle = getSolution().getTitleText();
    if (solutionTitle == null) {
        title = getSolution().getName();
    } else if (// $NON-NLS-1$
    !solutionTitle.equals("<empty>")) {
        title = solutionTitle;
    }
    title = getI18NMessageIfPrefixed(title);
    if (// $NON-NLS-1$ //$NON-NLS-2$
    name != null && !name.trim().equals("") && !"<empty>".equals(name)) {
        String i18nName = getI18NMessageIfPrefixed(name);
        FormController formController = (FormController) getFormManager().getCurrentForm();
        if (formController != null) {
            String name2 = Text.processTags(i18nName, formController.getTagResolver());
            if (name2 != null)
                i18nName = name2;
        } else {
            String name2 = Text.processTags(i18nName, TagResolver.createResolver(new PrototypeState(null)));
            if (name2 != null)
                i18nName = name2;
        }
        if (// $NON-NLS-1$
        !i18nName.trim().equals("")) {
            if (// $NON-NLS-1$
            "".equals(title)) {
                title += i18nName;
            } else {
                // $NON-NLS-1$
                title += " - " + i18nName;
            }
        }
    }
    String appName = getDisplayApplicationName();
    if (// $NON-NLS-1$
    appName.endsWith("Developer")) {
        // $NON-NLS-1$
        title = appName + " - " + title;
    } else {
        if (// $NON-NLS-1$
        title.equals("")) {
            title = appName;
        } else {
            // $NON-NLS-1$
            title += " - " + appName;
        }
    }
    frame.setTitle(title);
}
Also used : FormController(com.servoy.j2db.FormController) PrototypeState(com.servoy.j2db.dataprocessing.PrototypeState)

Aggregations

FormController (com.servoy.j2db.FormController)70 FormManager (com.servoy.j2db.FormManager)15 Form (com.servoy.j2db.persistence.Form)13 IFoundSetInternal (com.servoy.j2db.dataprocessing.IFoundSetInternal)12 RepositoryException (com.servoy.j2db.persistence.RepositoryException)10 Point (java.awt.Point)10 IRecordInternal (com.servoy.j2db.dataprocessing.IRecordInternal)9 ArrayList (java.util.ArrayList)9 IFormController (com.servoy.j2db.IFormController)8 BasicFormController (com.servoy.j2db.BasicFormController)7 IForm (com.servoy.j2db.IForm)7 WebForm (com.servoy.j2db.server.headlessclient.WebForm)7 FlattenedSolution (com.servoy.j2db.FlattenedSolution)6 IFormUIInternal (com.servoy.j2db.IFormUIInternal)5 IDataProvider (com.servoy.j2db.persistence.IDataProvider)5 List (java.util.List)5 ApplicationException (com.servoy.j2db.ApplicationException)4 IMainContainer (com.servoy.j2db.IMainContainer)4 PrototypeState (com.servoy.j2db.dataprocessing.PrototypeState)4 IDataRenderer (com.servoy.j2db.ui.IDataRenderer)4