Search in sources :

Example 1 with DeployCategoryStatus

use of org.talend.mdm.repository.core.service.DeployService.DeployCategoryStatus in project tmdm-studio-se by Talend.

the class DeployStatusDialog method initMultiStatus.

@Override
protected IStatus initMultiStatus(IStatus multiStatus) {
    IStatus[] children = multiStatus.getChildren();
    Map<ERepositoryObjectType, List<IStatus>> map = new HashMap<ERepositoryObjectType, List<IStatus>>();
    for (IStatus status : children) {
        collectTypeStatus(map, status);
    }
    // $NON-NLS-1$
    MultiStatus retStatus = new MultiStatus(RepositoryPlugin.PLUGIN_ID, Status.OK, "", null);
    for (Entry<ERepositoryObjectType, List<IStatus>> entry : map.entrySet()) {
        ERepositoryObjectType key = entry.getKey();
        IInteractiveHandler handler = InteractiveService.findHandler(key);
        if (handler != null) {
            MultiStatus submultiStatus = new DeployCategoryStatus(RepositoryPlugin.PLUGIN_ID, Status.OK, Messages.bind(Messages.MultiStatusDialog_MultiStatus_Messages, key.getLabel()), null);
            for (IStatus status : entry.getValue()) {
                if (isShown(handler, status)) {
                    submultiStatus.add(status);
                }
            }
            if (submultiStatus.getChildren().length > 0) {
                retStatus.add(submultiStatus);
            }
        }
    }
    isShowWarningMsg = map.containsKey(IServerObjectRepositoryType.TYPE_VIEW) && (!map.containsKey(IServerObjectRepositoryType.TYPE_DATAMODEL));
    map.clear();
    return retStatus;
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) DeployCategoryStatus(org.talend.mdm.repository.core.service.DeployService.DeployCategoryStatus) HashMap(java.util.HashMap) MultiStatus(org.eclipse.core.runtime.MultiStatus) IInteractiveHandler(org.talend.mdm.repository.core.service.IInteractiveHandler) ArrayList(java.util.ArrayList) List(java.util.List) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 IStatus (org.eclipse.core.runtime.IStatus)1 MultiStatus (org.eclipse.core.runtime.MultiStatus)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 DeployCategoryStatus (org.talend.mdm.repository.core.service.DeployService.DeployCategoryStatus)1 IInteractiveHandler (org.talend.mdm.repository.core.service.IInteractiveHandler)1