Search in sources :

Example 6 with WebForm

use of com.servoy.j2db.server.headlessclient.WebForm in project servoy-client by Servoy.

the class WebTabPanel method addTab.

public boolean addTab(IForm formController, String formName, String tabname, String tabText, String tabtooltip, String iconURL, String fg, String bg, String relationName, RelatedFoundSet relatedFs, int idx) {
    if (formController != null) {
        // to make sure we don't have recursion on adding a tab, to a tabpanel, that is based
        // on the form that the tabpanel is placed on
        WebForm webForm = findParent(WebForm.class);
        if (webForm != null) {
            FormController parentFormController = webForm.getController();
            if (parentFormController != null && parentFormController.equals(formController)) {
                return false;
            }
        }
    }
    WebTabFormLookup flp = (WebTabFormLookup) createFormLookupPanel(tabname, relationName, formName);
    if (formController != null)
        flp.setReadOnly(formController.isReadOnly());
    FlattenedSolution fl = application.getFlattenedSolution();
    int mediaId = -1;
    if (iconURL != null && !"".equals(iconURL)) {
        Media media = fl.getMedia(iconURL.replaceAll("media:///", ""));
        if (media != null)
            mediaId = media.getID();
        if (mediaId == -1) {
            Debug.warn("Form '" + formController.getName() + "' with tabpanel  '" + this.name + "' has tabicon  for tab '" + tabname + "'in with icon media url : " + iconURL + " not found");
        }
    }
    byte[] iconData = (mediaId == -1 ? null : ComponentFactory.loadIcon(fl, new Integer(mediaId)));
    int count = allTabs.size();
    int tabIndex = idx;
    if (tabIndex == -1 || tabIndex >= count) {
        tabIndex = count;
    }
    insertTab(application.getI18NMessageIfPrefixed(tabText), iconData, flp, application.getI18NMessageIfPrefixed(tabtooltip), tabIndex, true);
    if (fg != null)
        setTabForegroundAt(tabIndex, PersistHelper.createColor(fg));
    if (bg != null)
        setTabBackgroundAt(tabIndex, PersistHelper.createColor(bg));
    // from the relatedFs - which is already in the relationName param
    if (relatedFs != null && currentForm == flp) {
        FormController fp = flp.getWebForm().getController();
        if (fp != null && flp.getRelationName() != null && flp.getRelationName().equals(relationName)) {
            fp.loadData(relatedFs, null);
        }
    }
    return true;
}
Also used : FormController(com.servoy.j2db.FormController) WebForm(com.servoy.j2db.server.headlessclient.WebForm) Media(com.servoy.j2db.persistence.Media) FlattenedSolution(com.servoy.j2db.FlattenedSolution) Point(java.awt.Point)

Example 7 with WebForm

use of com.servoy.j2db.server.headlessclient.WebForm 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 8 with WebForm

use of com.servoy.j2db.server.headlessclient.WebForm in project servoy-client by Servoy.

the class WebTabPanel method getTagResolver.

/**
 * @param parentState
 * @return
 */
private ITagResolver getTagResolver(IRecordInternal parentState) {
    ITagResolver resolver;
    WebForm webForm = findParent(WebForm.class);
    if (webForm != null) {
        resolver = webForm.getController().getTagResolver();
    } else {
        resolver = TagResolver.createResolver(parentState);
    }
    return resolver;
}
Also used : ITagResolver(com.servoy.base.util.ITagResolver) WebForm(com.servoy.j2db.server.headlessclient.WebForm)

Example 9 with WebForm

use of com.servoy.j2db.server.headlessclient.WebForm in project servoy-client by Servoy.

the class WebDataRendererFactory method applyTabSequence.

public void applyTabSequence(List<Component> tabSequence, IFormUIInternal containerImpl) {
    WebForm wf = (WebForm) containerImpl;
    wf.setTabSeqComponents(tabSequence);
}
Also used : WebForm(com.servoy.j2db.server.headlessclient.WebForm)

Example 10 with WebForm

use of com.servoy.j2db.server.headlessclient.WebForm in project servoy-client by Servoy.

the class WebDataRendererFactory method extendTabSequence.

public void extendTabSequence(List<Component> tabSequence, IFormUIInternal containerImpl) {
    WebForm wf = (WebForm) containerImpl;
    ISupplyFocusChildren<Component> defaultNav = wf.getDefaultNavigator();
    if (defaultNav != null) {
        Component[] fchilds = defaultNav.getFocusChildren();
        for (Component element : fchilds) tabSequence.add(element);
    }
}
Also used : WebForm(com.servoy.j2db.server.headlessclient.WebForm) GraphicalComponent(com.servoy.j2db.persistence.GraphicalComponent) IComponent(com.servoy.j2db.ui.IComponent) IFieldComponent(com.servoy.j2db.ui.IFieldComponent) Component(org.apache.wicket.Component)

Aggregations

WebForm (com.servoy.j2db.server.headlessclient.WebForm)21 FormController (com.servoy.j2db.FormController)7 Point (java.awt.Point)6 Component (org.apache.wicket.Component)5 IComponent (com.servoy.j2db.ui.IComponent)4 IFieldComponent (com.servoy.j2db.ui.IFieldComponent)4 GraphicalComponent (com.servoy.j2db.persistence.GraphicalComponent)3 MarkupContainer (org.apache.wicket.MarkupContainer)3 ITagResolver (com.servoy.base.util.ITagResolver)2 FlattenedSolution (com.servoy.j2db.FlattenedSolution)2 FindState (com.servoy.j2db.dataprocessing.FindState)2 IDisplayData (com.servoy.j2db.dataprocessing.IDisplayData)2 IFoundSetInternal (com.servoy.j2db.dataprocessing.IFoundSetInternal)2 IRecordInternal (com.servoy.j2db.dataprocessing.IRecordInternal)2 Form (com.servoy.j2db.persistence.Form)2 RepositoryException (com.servoy.j2db.persistence.RepositoryException)2 FormScope (com.servoy.j2db.scripting.FormScope)2 IRuntimeComponent (com.servoy.j2db.ui.runtime.IRuntimeComponent)2 ArrayList (java.util.ArrayList)2 AbstractActiveSolutionHandler (com.servoy.j2db.AbstractActiveSolutionHandler)1