final ServiceTask serviceTask = getServiceTask();
if (serviceTask != null) {
CustomServiceTask targetTask = null;
for (final CustomServiceTask customServiceTask : customServiceTasks) {
if (customServiceTask.getId().equals(serviceTask.getExtensionId())) {
targetTask = customServiceTask;
break;
}
}
if (targetTask != null) {
final List<Class<CustomServiceTask>> classHierarchy = new ArrayList<Class<CustomServiceTask>>();
final List<FieldInfo> fieldInfoObjects = new ArrayList<FieldInfo>();
Class clazz = targetTask.getClass();
classHierarchy.add(clazz);
boolean hierarchyOpen = true;
while (hierarchyOpen) {
clazz = clazz.getSuperclass();
if (CustomServiceTask.class.isAssignableFrom(clazz)) {
classHierarchy.add(clazz);
} else {
hierarchyOpen = false;
}
}
for (final Class<CustomServiceTask> currentClass : classHierarchy) {
for (final Field field : currentClass.getDeclaredFields()) {
if (field.isAnnotationPresent(Property.class)) {
fieldInfoObjects.add(new FieldInfo(field));
}
}
}
// Sort the list so the fields are in the correct order
Collections.sort(fieldInfoObjects);
Control previousAnchor = workParent;
final CLabel labelNodeName = factory.createCLabel(workParent, targetTask.getName(), SWT.NONE);
labelNodeName.setFont(boldFont);
data = new FormData();
data.top = new FormAttachment(previousAnchor, VSPACE);
labelNodeName.setLayoutData(data);
previousAnchor = labelNodeName;
if (targetTask.getClass().isAnnotationPresent(Help.class)) {
final Help helpAnnotation = targetTask.getClass().getAnnotation(Help.class);
final CLabel labelShort = factory.createCLabel(workParent, helpAnnotation.displayHelpShort(), SWT.WRAP);
data = new FormData();
data.top = new FormAttachment(previousAnchor, VSPACE);