use of org.talend.core.hadoop.IOozieService 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();
}
Aggregations