Search in sources :

Example 11 with ITagResolver

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]);
}
Also used : ITagResolver(com.servoy.base.util.ITagResolver) HashSet(java.util.HashSet)

Example 12 with ITagResolver

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();
        }
    }
}
Also used : ITagResolver(com.servoy.base.util.ITagResolver) Point(java.awt.Point)

Example 13 with ITagResolver

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;
}
Also used : ITagResolver(com.servoy.base.util.ITagResolver) WebForm(com.servoy.j2db.server.headlessclient.WebForm)

Aggregations

ITagResolver (com.servoy.base.util.ITagResolver)13 IFoundSetInternal (com.servoy.j2db.dataprocessing.IFoundSetInternal)5 Point (java.awt.Point)5 FormController (com.servoy.j2db.FormController)3 IDisplayData (com.servoy.j2db.dataprocessing.IDisplayData)2 IRecordInternal (com.servoy.j2db.dataprocessing.IRecordInternal)2 WebForm (com.servoy.j2db.server.headlessclient.WebForm)2 IJSFoundSet (com.servoy.base.scripting.api.IJSFoundSet)1 BasicFormController (com.servoy.j2db.BasicFormController)1 IApplication (com.servoy.j2db.IApplication)1 ServoyBeanState (com.servoy.j2db.component.ServoyBeanState)1 FoundSet (com.servoy.j2db.dataprocessing.FoundSet)1 IDisplay (com.servoy.j2db.dataprocessing.IDisplay)1 IDisplayRelatedData (com.servoy.j2db.dataprocessing.IDisplayRelatedData)1 ISwingFoundSet (com.servoy.j2db.dataprocessing.ISwingFoundSet)1 SortColumn (com.servoy.j2db.dataprocessing.SortColumn)1 DbIdentValue (com.servoy.j2db.dataprocessing.ValueFactory.DbIdentValue)1 IServoyAwareBean (com.servoy.j2db.dataui.IServoyAwareBean)1 AggregateVariable (com.servoy.j2db.persistence.AggregateVariable)1 IDataProvider (com.servoy.j2db.persistence.IDataProvider)1