if (exec != null) {
final ExecutionCtrl execCtrl = (ExecutionCtrl)exec;
final PageDefinition pgdef = execCtrl.getCurrentPageDefinition();
final Page page = execCtrl.getCurrentPage();
final ComponentDefinition compdef =
pgdef != null ? pgdef.getComponentDefinition(cls, true):
page != null ? page.getComponentDefinition(cls, true): null;
if (compdef != null && compdef.getLanguageDefinition() != null)
return compdef; //already from langdef (not from pgdef)
final ComponentDefinition compdef2 =
Components.getDefinitionByDeviceType(exec.getDesktop().getDeviceType(), cls);
return compdef != null && (compdef2 == null ||
!Objects.equals(compdef.getImplementationClass(), compdef2.getImplementationClass())) ?
compdef: compdef2; //Feature 2816083: use compdef2 if same class
}
for (Iterator it = LanguageDefinition.getDeviceTypes().iterator(); it.hasNext();) {
final ComponentDefinition compdef =
Components.getDefinitionByDeviceType((String)it.next(), cls);
if (compdef != null)
return compdef;
}
return null;