use of org.openremote.app.client.assets.attributes.AttributeViewImpl in project openremote by openremote.
the class AbstractAssetActivity method createAttributeView.
protected AttributeView createAttributeView(AssetAttribute attribute) {
AttributeViewImpl attributeView = new AttributeViewImpl(environment, view.getStyle(), attribute);
attributeView.setAttributeActions(createAttributeActions(attribute, attributeView));
List<AbstractAttributeViewExtension> extensions = createAttributeExtensions(attribute, attributeView);
if (extensions != null && !extensions.isEmpty()) {
extensions.forEach(this::linkAttributeView);
}
attributeView.setAttributeExtensions(extensions);
linkAttributeView(attributeView);
return attributeView;
}
use of org.openremote.app.client.assets.attributes.AttributeViewImpl in project openremote by openremote.
the class AssetViewActivity method enableLiveUpdates.
@Override
public void enableLiveUpdates(boolean enable) {
liveUpdates = enable;
for (AttributeView attributeView : attributeViews) {
if (attributeView instanceof AttributeViewImpl) {
((AttributeViewImpl) attributeView).getActionButtons().forEach(button -> {
if (button.getStyleName().contains(READ_BUTTON_CLASS)) {
(button).setEnabled(!enable);
}
});
}
}
if (enable) {
// Poll all values once so we have some state
readAllAttributeValues();
}
subscribeLiveUpdates(enable);
}
Aggregations