use of com.thecoderscorner.menu.domain.FloatMenuItemBuilder in project tcMenu by davetcc.
the class TagValMenuCommandProtocolTest method testWritingFloatItem.
@Test
public void testWritingFloatItem() {
FloatMenuItem floatItem = DomainFixtures.aFloatMenu("FloatMenu", 1);
floatItem = new FloatMenuItemBuilder().withExisting(floatItem).withVisible(false).menuItem();
protocol.toChannel(bb, new MenuFloatBootCommand(22, floatItem, (float) 12.0));
testBufferAgainstExpected(FLOAT_BOOT_ITEM, "PI=22|ID=1|IE=105|NM=FloatMenu|RO=0|VI=0|FD=3|VC=12.0|\u0002");
}
use of com.thecoderscorner.menu.domain.FloatMenuItemBuilder in project tcMenu by davetcc.
the class UIFloatMenuItem method getChangedMenuItem.
@Override
protected Optional<FloatMenuItem> getChangedMenuItem() {
List<FieldError> errors = new ArrayList<>();
int dp = safeIntFromProperty(decimalPlaces.textProperty(), "Decimal Places", errors, 1, 6);
FloatMenuItemBuilder builder = FloatMenuItemBuilder.aFloatMenuItemBuilder().withExisting(getMenuItem()).withDecimalPlaces(dp);
getChangedDefaults(builder, errors);
return getItemOrReportError(builder.menuItem(), errors);
}
Aggregations