protected TaskDescription getTaskDescription(ModuleFunction modFunc) {
ProgramTaskDescription desc = new ProgramTaskDescription();
ModuleInfo modInfo = modFunc.getModule().getModuleInfo();
FunctionInfo funcInfo = modFunc.getFunction().getInfo();
//custom name:
String name = funcInfo.getTitle();
//default name = "module (program)"
if (name == null) {
name = modInfo.getTitle();
String program = modInfo.getProgram();
if (program != null)
name += " (" + program + ")";
}
desc.setName(name);
//description:
String description = funcInfo.getDescription();
if (description == null)
description = modInfo.getDescription();
desc.setDescription(description);
//extended info:
desc.setProgramName(modInfo.getProgram());
desc.setGroup(funcInfo.getGroup());
PackageInfo pkgInfo = modInfo.getPackageInfo();
if (pkgInfo != null) {
desc.setPackageName(pkgInfo.getName());
desc.setWebsite(pkgInfo.getWebsite());