Search in sources :

Example 1 with ISAPProviderService

use of org.talend.core.service.ISAPProviderService in project tdi-studio-se by Talend.

the class ComponentChooseDialog method isEnabled.

@Override
public boolean isEnabled(DropTargetEvent e) {
    Object obj = getSelection().getFirstElement();
    if (obj instanceof RepositoryNode) {
        RepositoryNode sourceNode = (RepositoryNode) obj;
        if (PluginChecker.isCDCPluginLoaded()) {
            ICDCProviderService service = (ICDCProviderService) GlobalServiceRegister.getDefault().getService(ICDCProviderService.class);
            if (service != null && (service.isSubscriberTableNode(sourceNode) || service.isSystemSubscriberTable(sourceNode))) {
                return false;
            }
        }
        IHadoopClusterService hadoopClusterService = HadoopRepositoryUtil.getHadoopClusterService();
        if (hadoopClusterService != null && hadoopClusterService.isHadoopClusterNode(sourceNode)) {
            return false;
        }
        IOozieService oozieService = null;
        if (GlobalServiceRegister.getDefault().isServiceRegistered(IOozieService.class)) {
            oozieService = (IOozieService) GlobalServiceRegister.getDefault().getService(IOozieService.class);
        }
        if (oozieService != null && oozieService.isOozieNode(sourceNode)) {
            return false;
        }
        ISAPProviderService sapService = null;
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ISAPProviderService.class)) {
            sapService = (ISAPProviderService) GlobalServiceRegister.getDefault().getService(ISAPProviderService.class);
        }
        if (sapService != null && sapService.isSAPNode(sourceNode)) {
            return false;
        }
    }
    return !this.editor.getProcess().isReadOnly();
}
Also used : IHadoopClusterService(org.talend.core.hadoop.IHadoopClusterService) IOozieService(org.talend.core.hadoop.IOozieService) ISAPProviderService(org.talend.core.service.ISAPProviderService) SAPFunctionRepositoryObject(org.talend.core.repository.model.repositoryObject.SAPFunctionRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) QueryRepositoryObject(org.talend.core.repository.model.repositoryObject.QueryRepositoryObject) MetadataTableRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject) SalesforceModuleRepositoryObject(org.talend.core.repository.model.repositoryObject.SalesforceModuleRepositoryObject) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) SAPIDocRepositoryObject(org.talend.core.repository.model.repositoryObject.SAPIDocRepositoryObject) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ICDCProviderService(org.talend.core.ui.ICDCProviderService)

Aggregations

IHadoopClusterService (org.talend.core.hadoop.IHadoopClusterService)1 IOozieService (org.talend.core.hadoop.IOozieService)1 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)1 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)1 MetadataTableRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject)1 QueryRepositoryObject (org.talend.core.repository.model.repositoryObject.QueryRepositoryObject)1 SAPFunctionRepositoryObject (org.talend.core.repository.model.repositoryObject.SAPFunctionRepositoryObject)1 SAPIDocRepositoryObject (org.talend.core.repository.model.repositoryObject.SAPIDocRepositoryObject)1 SalesforceModuleRepositoryObject (org.talend.core.repository.model.repositoryObject.SalesforceModuleRepositoryObject)1 ISAPProviderService (org.talend.core.service.ISAPProviderService)1 ICDCProviderService (org.talend.core.ui.ICDCProviderService)1 IRepositoryNode (org.talend.repository.model.IRepositoryNode)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1