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