コード例 #1
0
 public QuantityRequirement(
     String requirementName, String enterString, String recordName, boolean isOptional) {
   super(requirementName, enterString, recordName, isOptional, true);
   ClientQuantity clientQuantity = new ClientQuantity();
   clientQuantity.setValue(1.0);
   setDefaultValue(clientQuantity);
 }
コード例 #2
0
 @Override
 protected Result onFinish(Context context) {
   ClientQuantity quantity = getValue();
   Unit unit = getRequirement(UNIT).getValue();
   quantity.setUnit(unit == null ? 0 : unit.getID());
   quantity.setValue((Double) getRequirement(VALUE).getValue());
   return null;
 }
コード例 #3
0
 @Override
 public void setValue(Object value) {
   ClientQuantity clientQuantity = (ClientQuantity) value;
   if (clientQuantity != null) {
     getRequirement(UNIT)
         .setValue(
             CommandUtils.getServerObjectById(clientQuantity.getUnit(), AccounterCoreType.UNIT));
     getRequirement(VALUE).setValue(clientQuantity.getValue());
   }
   super.setValue(value);
 }