Search in sources :

Example 1 with UserDefIndicatorSubFolderRepNode

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

the class DeleteResourceProvider method shouldShowRenameFolderMenu.

private boolean shouldShowRenameFolderMenu(RepositoryNode node) {
    boolean show = false;
    if (node instanceof AnalysisSubFolderRepNode) {
        AnalysisSubFolderRepNode anaSubFolderNode = (AnalysisSubFolderRepNode) node;
        show = !anaSubFolderNode.isVirtualFolder();
    } else if (node instanceof ReportSubFolderRepNode) {
        ReportSubFolderRepNode repSubFolderNode = (ReportSubFolderRepNode) node;
        show = !repSubFolderNode.isVirtualFolder();
    } else if (node instanceof UserDefIndicatorSubFolderRepNode || node instanceof PatternRegexSubFolderRepNode || node instanceof PatternSqlSubFolderRepNode || node instanceof RulesSQLSubFolderRepNode || node instanceof RulesParserSubFolderRepNode || node instanceof DBConnectionSubFolderRepNode || node instanceof DFConnectionSubFolderRepNode || node instanceof JrxmlTempSubFolderNode) {
        show = true;
    }
    return show;
}
Also used : PatternSqlSubFolderRepNode(org.talend.dq.nodes.PatternSqlSubFolderRepNode) UserDefIndicatorSubFolderRepNode(org.talend.dq.nodes.UserDefIndicatorSubFolderRepNode) PatternRegexSubFolderRepNode(org.talend.dq.nodes.PatternRegexSubFolderRepNode) RulesSQLSubFolderRepNode(org.talend.dq.nodes.RulesSQLSubFolderRepNode) DBConnectionSubFolderRepNode(org.talend.dq.nodes.DBConnectionSubFolderRepNode) DFConnectionSubFolderRepNode(org.talend.dq.nodes.DFConnectionSubFolderRepNode) ReportSubFolderRepNode(org.talend.dq.nodes.ReportSubFolderRepNode) RulesParserSubFolderRepNode(org.talend.dq.nodes.RulesParserSubFolderRepNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) JrxmlTempSubFolderNode(org.talend.dq.nodes.JrxmlTempSubFolderNode)

Example 2 with UserDefIndicatorSubFolderRepNode

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

the class FolderObjFilter method select.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object,
     * java.lang.Object)
     */
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
    if (element instanceof IResource) {
        IResource res = (IResource) element;
        if (IResource.FOLDER == res.getType()) {
            IFolder folder = (IFolder) element;
            // MOD mzhao 2010-08-12 14891: use same repository API with TOS to persistent metadata
            if (folder.getProjectRelativePath().toString().startsWith(EResourceConstant.METADATA.getPath())) {
                String folderName = folder.getName();
                if (folderName.equals("bin")) {
                    // $NON-NLS-1$
                    return false;
                }
                if (folderName.equals(EResourceConstant.METADATA.getPath())) {
                    return true;
                } else if (ResourceManager.getConnectionFolder().getFullPath().isPrefixOf(folder.getFullPath())) {
                    return true;
                }
                return false;
            } else // MOD zshen 2011-1-16 18724: Java UDI enhancements to hide lib folder.
            if (folder.getProjectRelativePath().toString().startsWith(EResourceConstant.USER_DEFINED_INDICATORS.getPath()) && (folder.getName().equals("lib"))) {
                // $NON-NLS-1$
                return false;
            }
            // ~18724
            ResourceAttributes resourceAttributes = folder.getResourceAttributes();
            if (resourceAttributes == null) {
                return true;
            }
            if (resourceAttributes.isHidden()) {
                return false;
            }
        } else {
            return true;
        }
    } else if (element instanceof UserDefIndicatorSubFolderRepNode) {
        if (EResourceConstant.USER_DEFINED_INDICATORS_LIB.getName().equalsIgnoreCase(((UserDefIndicatorSubFolderRepNode) element).getObject().getLabel())) {
            return false;
        }
    }
    return true;
}
Also used : UserDefIndicatorSubFolderRepNode(org.talend.dq.nodes.UserDefIndicatorSubFolderRepNode) IResource(org.eclipse.core.resources.IResource) ResourceAttributes(org.eclipse.core.resources.ResourceAttributes) IFolder(org.eclipse.core.resources.IFolder)

Aggregations

UserDefIndicatorSubFolderRepNode (org.talend.dq.nodes.UserDefIndicatorSubFolderRepNode)2 IFolder (org.eclipse.core.resources.IFolder)1 IResource (org.eclipse.core.resources.IResource)1 ResourceAttributes (org.eclipse.core.resources.ResourceAttributes)1 AnalysisSubFolderRepNode (org.talend.dq.nodes.AnalysisSubFolderRepNode)1 DBConnectionSubFolderRepNode (org.talend.dq.nodes.DBConnectionSubFolderRepNode)1 DFConnectionSubFolderRepNode (org.talend.dq.nodes.DFConnectionSubFolderRepNode)1 JrxmlTempSubFolderNode (org.talend.dq.nodes.JrxmlTempSubFolderNode)1 PatternRegexSubFolderRepNode (org.talend.dq.nodes.PatternRegexSubFolderRepNode)1 PatternSqlSubFolderRepNode (org.talend.dq.nodes.PatternSqlSubFolderRepNode)1 ReportSubFolderRepNode (org.talend.dq.nodes.ReportSubFolderRepNode)1 RulesParserSubFolderRepNode (org.talend.dq.nodes.RulesParserSubFolderRepNode)1 RulesSQLSubFolderRepNode (org.talend.dq.nodes.RulesSQLSubFolderRepNode)1