use of com.thecoderscorner.menu.domain.RuntimeListMenuItemBuilder in project tcMenu by davetcc.
the class UIRuntimeListMenuItem method getChangedMenuItem.
@Override
protected Optional<RuntimeListMenuItem> getChangedMenuItem() {
RuntimeListMenuItemBuilder builder = RuntimeListMenuItemBuilder.aRuntimeListMenuItemBuilder().withExisting(getMenuItem());
List<FieldError> errors = new ArrayList<>();
getChangedDefaults(builder, errors);
RuntimeListMenuItem item = builder.menuItem();
functionNameTextField.setText(item.getFunctionName());
return getItemOrReportError(item, errors);
}
use of com.thecoderscorner.menu.domain.RuntimeListMenuItemBuilder in project tcMenu by davetcc.
the class EmbeddedJavaGeneratorTest method setupGenerator.
@BeforeEach
public void setupGenerator() throws IOException {
storage = mock(ConfigurationStorage.class);
generator = new EmbeddedJavaGenerator(storage, EmbeddedPlatform.RASPBERRY_PIJ);
tempPath = Files.createTempDirectory("gentest");
tree = buildSimpleTreeReadOnly();
tree.addMenuItem(MenuTree.ROOT, new RuntimeListMenuItemBuilder().withId(2039).withName("My List").withFunctionName("listHasChanged").withInitialRows(10).menuItem());
when(storage.getVersion()).thenReturn("1.2.3");
var pluginMgr = new DefaultXmlPluginLoader(new PluginEmbeddedPlatformsImpl(), storage, true);
var data = Objects.requireNonNull(getClass().getResourceAsStream("/plugins/java-test-plugin.xml")).readAllBytes();
plugin = pluginMgr.loadPlugin(new String(data));
}
Aggregations