// TODO: i18n
@Override
protected List<DataSourceField> addDataSourceFields() {
List<DataSourceField> fields = super.addDataSourceFields();
DataSourceIntegerField idField = new DataSourceIntegerField(Field.ID, MSG
.dataSource_operationSchedule_field_id());
idField.setPrimaryKey(true);
idField.setCanEdit(false);
fields.add(idField);
DataSourceTextField operationNameField = createTextField(Field.OPERATION_NAME, MSG
.dataSource_operationSchedule_field_operationName(), null, 100, true);
// sort the op def names in the drop down
TreeSet<OperationDefinition> operationDefinitions = new TreeSet<OperationDefinition>(
new Comparator<OperationDefinition>() {
public int compare(OperationDefinition o1, OperationDefinition o2) {
return o1.getDisplayName().compareTo(o2.getDisplayName());
}
});
operationDefinitions.addAll(this.resourceType.getOperationDefinitions());
LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
for (OperationDefinition operationDefinition : operationDefinitions) {
valueMap.put(operationDefinition.getName(), operationDefinition.getDisplayName());
}
operationNameField.setValueMap(valueMap);
fields.add(operationNameField);
DataSourceTextField operationDisplayNameField = createTextField(Field.OPERATION_DISPLAY_NAME, MSG
.dataSource_operationSchedule_field_operationDisplayName(), null, 100, true);
fields.add(operationDisplayNameField);
DataSourceField subjectField = new DataSourceField(Field.SUBJECT, FieldType.ANY, MSG.common_title_owner());
subjectField.setCanEdit(false);
fields.add(subjectField);
DataSourceTextField descriptionField = createTextField(Field.DESCRIPTION, MSG
.dataSource_operationSchedule_field_description(), null, 100, false);
fields.add(descriptionField);
DataSourceDateTimeField nextFireTimeField = new DataSourceDateTimeField(Field.NEXT_FIRE_TIME, MSG
.dataSource_operationSchedule_field_nextFireTime());
nextFireTimeField.setCanEdit(false);
fields.add(nextFireTimeField);
DataSourceIntegerField timeoutField = createIntegerField(Field.TIMEOUT, MSG
.dataSource_operationSchedule_field_timeout(), 30, null, false);
fields.add(timeoutField);
return fields;
}