use of com.haulmont.cuba.gui.components.ShowInfoAction in project cuba by cuba-platform.
the class WebTree method setDatasource.
@Override
public void setDatasource(HierarchicalDatasource datasource) {
Preconditions.checkNotNullArgument(datasource, "datasource is null");
if (this.datasource != null) {
throw new UnsupportedOperationException("Changing datasource is not supported by the Tree component");
}
this.datasource = datasource;
this.hierarchyProperty = datasource.getHierarchyPropertyName();
collectionDsListenersWrapper = createCollectionDsListenersWrapper();
component.setContainerDataSource(new HierarchicalDsWrapper(datasource, collectionDsListenersWrapper));
tryToAssignCaptionProperty();
Security security = AppBeans.get(Security.NAME);
if (security.isSpecificPermitted(ShowInfoAction.ACTION_PERMISSION)) {
ShowInfoAction action = (ShowInfoAction) getAction(ShowInfoAction.ACTION_ID);
if (action == null) {
action = new ShowInfoAction();
addAction(action);
}
action.setDatasource(datasource);
}
collectionDsListenersWrapper.bind(datasource);
for (Action action : getActions()) {
action.refreshState();
}
assignAutoDebugId();
}
Aggregations