typeCombo.setEnabled(!readOnly);
lagTextField.setEnabled(!readOnly);
removeButton.setEnabled(!readOnly);
} else {
try {
Duration duration = (Duration) DurationFormat.getInstance().parseObject(lagTextField.getText());
int type = ((Number)DependencyType.mapStringToValue(typeCombo.getSelectedItem().toString())).intValue();
// dependency.setLag(duration.getEncodedMillis());
// dependency.setDependencyType(type);
DependencyService.getInstance().setFields(dependency,duration.getEncodedMillis(),type,this);
} catch (ParseException e) {
Alert.warn(Messages.getString("Message.invalidDuration"),this);
return false;
} catch (InvalidAssociationException e) {
Alert.warn(e.getMessage(),this);