Skip to content

Commit 76b0e54

Browse files
author
dave
committed
minor fixes
1 parent c5f16ed commit 76b0e54

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/cli/CreateProjectCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void generateDefaultJavaProject(Path dir, CodeGeneratorOptions options, C
192192
var mainRes = dir.resolve("src").resolve("main").resolve("resources");
193193
// move the class and resource files into selected package in options.
194194
var newSourcePackage = mainSrc.resolve(options.getPackageNamespace().replace('.', FileSystems.getDefault().getSeparator().charAt(0)));
195-
String projectName = String.join("", newProject);
195+
String projectName = String.join("", options.getApplicationName());
196196

197197
// adjust the various project files minimally so they can be loaded into an IDE in
198198
// the new package structure.

tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/generator/ejava/EmbeddedJavaGenerator.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ private void generateMenuInMenu(JavaClassBuilder classBuilder, CodeGeneratorOpti
105105
boolean hasMenuInMenuDefinitions = !options.getMenuInMenuCollection().getAllDefinitions().isEmpty();
106106
if(hasMenuInMenuDefinitions) {
107107
var method = new GeneratedJavaMethod(METHOD_REPLACE, "void", "buildMenuInMenuComponents")
108+
.withParameter("BaseMenuConfig context")
108109
.withStatement("MenuManagerServer menuManager = context.getBean(MenuManagerServer.class);")
109110
.withStatement("MenuCommandProtocol protocol = context.getBean(MenuCommandProtocol.class);")
110111
.withStatement("ScheduledExecutorService executor = context.getBean(ScheduledExecutorService.class);")
@@ -124,6 +125,9 @@ private void generateMenuInMenu(JavaClassBuilder classBuilder, CodeGeneratorOpti
124125
));
125126
method.withStatement(variableName + ".start();");
126127
}
128+
classBuilder.addPackageImport("com.thecoderscorner.menu.mgr.*")
129+
.addPackageImport("com.thecoderscorner.menu.remote.*")
130+
.addPackageImport("java.util.concurrent.ScheduledExecutorService");
127131
classBuilder.addStatement(method);
128132
} else {
129133
classBuilder.addStatement(new GeneratedJavaMethod(METHOD_REPLACE, "void", "configureMenuInMenuComponents")

0 commit comments

Comments
 (0)