use of com.servoy.j2db.ui.runtime.HasRuntimeClientProperty in project servoy-client by Servoy.
the class Utils method removeJavascripLinkFromDisplay.
public static Object removeJavascripLinkFromDisplay(IDisplayData display, Object[] value) {
Object obj = value == null ? display.getValueObject() : value[0];
if (obj instanceof String && display instanceof IScriptableProvider) {
IScriptable scriptable = ((IScriptableProvider) display).getScriptObject();
if (scriptable instanceof HasRuntimeClientProperty) {
HasRuntimeClientProperty scriptableWithClientProperty = (HasRuntimeClientProperty) scriptable;
if (!Boolean.TRUE.equals(scriptableWithClientProperty.getClientProperty(IApplication.ALLOW_JAVASCRIPT_LINK_INPUT))) {
// $NON-NLS-1$ //$NON-NLS-2$
obj = ((String) obj).replaceAll("(?i)javascript:", "");
display.setValueObject(obj);
}
}
}
return obj;
}
use of com.servoy.j2db.ui.runtime.HasRuntimeClientProperty in project servoy-client by Servoy.
the class ScrollResponseHeaderContainer method putClientProperty.
/**
* put client property for current and future components.
*/
public void putClientProperty(IPersist persist, Object key, Object value) {
Map<Object, Object> clientProperties = elementToClientProperties.get(persist);
if (clientProperties == null) {
elementToClientProperties.put(persist, clientProperties = new HashMap<Object, Object>());
}
clientProperties.put(key, value);
for (Entry<Component, IPersist> entry : cellToElement.entrySet()) {
if (entry.getValue().equals(persist)) {
Component component = entry.getKey();
if (component instanceof IScriptableProvider) {
IScriptable scriptObject = ((IScriptableProvider) component).getScriptObject();
if (scriptObject instanceof HasRuntimeClientProperty) {
((HasRuntimeClientProperty) scriptObject).putClientProperty(key, value);
}
}
}
}
}
Aggregations