use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class TagStringPropertyType method getDataLinks.
@Override
public TargetDataLinks getDataLinks(String formElementValue, PropertyDescription pd, FlattenedSolution flattenedSolution, final INGFormElement formElement) {
final Set<String> dataProviders = new HashSet<>();
final boolean[] recordDP = new boolean[1];
Text.processTags(formElementValue, new ITagResolver() {
@Override
public String getStringValue(String name) {
String dp = name;
if (dp.startsWith(ScriptVariable.GLOBALS_DOT_PREFIX)) {
dp = ScriptVariable.SCOPES_DOT_PREFIX + dp;
}
dataProviders.add(dp);
// TODO Can't it be something special like record count or current record which are special cases and could still not depend on record...?
recordDP[0] = recordDP[0] || (!ScopesUtils.isVariableScope(dp) && formElement.getForm().getScriptVariable(dp) == null);
return dp;
}
});
return dataProviders.size() == 0 ? TargetDataLinks.NOT_LINKED_TO_DATA : new TargetDataLinks(dataProviders.toArray(new String[dataProviders.size()]), recordDP[0]);
}
use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class WebAccordionPanel 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();
}
}
}
use of com.servoy.base.util.ITagResolver in project servoy-client by Servoy.
the class WebAccordionPanel method getTagResolver.
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;
}
Aggregations