Search in sources :

Example 1 with ShowInfoAction

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();
}
Also used : ShowInfoAction(com.haulmont.cuba.gui.components.ShowInfoAction) ShowInfoAction(com.haulmont.cuba.gui.components.ShowInfoAction) Action(com.haulmont.cuba.gui.components.Action) Security(com.haulmont.cuba.core.global.Security) HierarchicalDsWrapper(com.haulmont.cuba.web.gui.data.HierarchicalDsWrapper)

Aggregations

Security (com.haulmont.cuba.core.global.Security)1 Action (com.haulmont.cuba.gui.components.Action)1 ShowInfoAction (com.haulmont.cuba.gui.components.ShowInfoAction)1 HierarchicalDsWrapper (com.haulmont.cuba.web.gui.data.HierarchicalDsWrapper)1