Search in sources :

Example 11 with JrxmlTempleteRepNode

use of org.talend.dq.nodes.JrxmlTempleteRepNode in project tdq-studio-se by Talend.

the class DQDeleteAction method checkSourceFilesEditorOpening.

/**
 * DOC xqliu Comment method "checkSourceFilesEditorOpening".
 *
 * @param deleteElements
 * @return
 */
@SuppressWarnings({ "hiding", "rawtypes", "unchecked" })
private Object[] checkSourceFilesEditorOpening(Object[] deleteElements) {
    List list = new ArrayList();
    boolean opened = false;
    // $NON-NLS-1$
    String openSourceFileNames = "";
    for (Object obj : deleteElements) {
        if (obj instanceof SourceFileRepNode || obj instanceof JrxmlTempleteRepNode) {
            ReturnCode rc = WorkspaceResourceHelper.checkSourceFileNodeOpening((RepositoryNode) obj);
            if (rc.isOk()) {
                opened = rc.isOk();
                openSourceFileNames += rc.getMessage();
            } else {
                list.add(obj);
            }
        } else if (obj instanceof SourceFileSubFolderNode || obj instanceof JrxmlTempSubFolderNode) {
            ReturnCode rc = WorkspaceResourceHelper.checkSourceFileSubFolderNodeOpening((RepositoryNode) obj);
            if (rc.isOk()) {
                opened = rc.isOk();
                openSourceFileNames += rc.getMessage();
            } else {
                list.add(obj);
            }
        } else {
            list.add(obj);
        }
    }
    if (opened) {
        WorkspaceResourceHelper.showSourceFilesOpeningWarnMessages(openSourceFileNames);
    }
    return list.toArray();
}
Also used : ReturnCode(org.talend.utils.sugars.ReturnCode) ArrayList(java.util.ArrayList) SourceFileSubFolderNode(org.talend.dq.nodes.SourceFileSubFolderNode) List(java.util.List) ArrayList(java.util.ArrayList) SourceFileRepNode(org.talend.dq.nodes.SourceFileRepNode) JrxmlTempleteRepNode(org.talend.dq.nodes.JrxmlTempleteRepNode) DQRepositoryNode(org.talend.dq.nodes.DQRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) JrxmlTempSubFolderNode(org.talend.dq.nodes.JrxmlTempSubFolderNode)

Aggregations

JrxmlTempleteRepNode (org.talend.dq.nodes.JrxmlTempleteRepNode)11 SourceFileRepNode (org.talend.dq.nodes.SourceFileRepNode)6 ArrayList (java.util.ArrayList)5 IRepositoryNode (org.talend.repository.model.IRepositoryNode)5 IPath (org.eclipse.core.runtime.IPath)4 JrxmlTempSubFolderNode (org.talend.dq.nodes.JrxmlTempSubFolderNode)4 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)3 AnalysisRepNode (org.talend.dq.nodes.AnalysisRepNode)3 PatternRepNode (org.talend.dq.nodes.PatternRepNode)3 ReportAnalysisRepNode (org.talend.dq.nodes.ReportAnalysisRepNode)3 ReportRepNode (org.talend.dq.nodes.ReportRepNode)3 RuleRepNode (org.talend.dq.nodes.RuleRepNode)3 SysIndicatorDefinitionRepNode (org.talend.dq.nodes.SysIndicatorDefinitionRepNode)3 RepositoryNode (org.talend.repository.model.RepositoryNode)3 ExchangeCategoryRepNode (org.talend.dataprofiler.core.ui.exchange.ExchangeCategoryRepNode)2 ExchangeComponentRepNode (org.talend.dataprofiler.core.ui.exchange.ExchangeComponentRepNode)2 DBCatalogRepNode (org.talend.dq.nodes.DBCatalogRepNode)2 DBColumnFolderRepNode (org.talend.dq.nodes.DBColumnFolderRepNode)2 DBColumnRepNode (org.talend.dq.nodes.DBColumnRepNode)2 DBConnectionFolderRepNode (org.talend.dq.nodes.DBConnectionFolderRepNode)2