use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class WebAccordionPanel 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;
}
}
}
use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class PartNode method getAggregatesFromRenderer.
private void getAggregatesFromRenderer(final List<AggregateVariable> aggregates, final Form f, DataRenderer a_renderer) throws RepositoryException {
Map<IPersist, IDisplay> allFields = a_renderer.getFieldComponents();
Iterator<IDisplay> it = allFields.values().iterator();
while (it.hasNext()) {
IDisplay display = it.next();
if (display instanceof IDisplayData) {
String dataProviderID = ((IDisplayData) display).getDataProviderID();
if (dataProviderID != null) {
IDataProvider dp = application.getFlattenedSolution().getDataproviderLookup(application.getFoundSetManager(), f).getDataProvider(dataProviderID);
if (dp instanceof AggregateVariable) {
if (!aggregates.contains(dp))
aggregates.add((AggregateVariable) dp);
}
} else if (display instanceof IDisplayTagText) {
String tagText = ((IDisplayTagText) display).getTagText();
Text.processTags(tagText, new ITagResolver() {
public String getStringValue(String name) {
try {
IDataProvider dp = application.getFlattenedSolution().getDataproviderLookup(application.getFoundSetManager(), f).getDataProvider(name);
if (dp instanceof AggregateVariable) {
if (!aggregates.contains(dp))
aggregates.add((AggregateVariable) dp);
}
} catch (Exception e) {
Debug.error(e);
}
return null;
}
});
}
}
}
}
use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class SpecialTabPanel method setRecord.
public void setRecord(IRecordInternal parentState, boolean stopEditing) {
parentData = parentState;
if (// enclosingComponent may already point to the next (uninitialised) form, see stateChanged()
currentForm != null) {
showFoundSet(currentForm, parentState, getDefaultSort());
}
ITagResolver resolver = getTagResolver(parentState);
for (int i = 0; i < originalTabText.size(); i++) {
String element = originalTabText.get(i);
if (element != null) {
enclosingComponent.setTitleAt(i, Text.processTags(element, resolver));
}
}
for (int i = 0; i < originalTabTooltip.size(); i++) {
String tooltip = originalTabTooltip.get(i);
if (tooltip != null) {
enclosingComponent.setToolTipTextAt(i, Text.processTags(tooltip, resolver));
}
}
}
use of com.servoy.base.util.ITagResolver 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;
}
}
}
use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class WebTabPanel method setRecord.
public void setRecord(IRecordInternal parentState, boolean stopEditing) {
parentData = parentState;
if (currentForm != null) {
showFoundSet(currentForm, parentState, getDefaultSort());
} else if (allTabs.size() > 0) {
showFoundSet(allTabs.get(0).getPanel(), parentState, getDefaultSort());
}
ITagResolver resolver = getTagResolver(parentState);
for (int i = 0; i < allTabs.size(); i++) {
WebTabHolder element = allTabs.get(i);
if (element.refreshTagStrings(resolver)) {
getStylePropertyChanges().setChanged();
}
}
}
Aggregations