Skip to content

Commit 88f2045

Browse files
committed
Complete GUI console
1 parent 78d9124 commit 88f2045

59 files changed

Lines changed: 1593 additions & 2048 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

alpha-assembly/alpha-assembly-maven-plugin/src/main/resources/com/techsenger/alpha/assembly/maven/plugin/gui-config.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@
6060
<Module groupId="com.techsenger.tabshell" artifactId="tabshell-dialogs" version="${bom.tabshell.version}"/>
6161
<Module groupId="com.techsenger.tabshell" artifactId="tabshell-layout" version="${bom.tabshell.version}"/>
6262

63-
<!--### RICH TEXT ###-->
64-
<!-- todo: check versions -->
65-
<Module groupId="org.fxmisc.richtext" artifactId="richtextfx" version="${bom.richtextfx.version}"/>
66-
<Module groupId="org.fxmisc.flowless" artifactId="flowless" version="${bom.flowless.version}"/>
67-
<Module groupId="org.fxmisc.undo" artifactId="undofx" version="${undofx.version}"/>
68-
<Module groupId="org.fxmisc.wellbehaved" artifactId="wellbehavedfx" version="${wellbehavedfx.version}"/>
69-
<Module groupId="org.reactfx" artifactId="reactfx" version="${reactfx.version}"/>
70-
7163
<!--### UML ###-->
7264
<Module groupId="net.sourceforge.plantuml" artifactId="plantuml-asl" version="${bom.plantuml.version}"/>
7365

alpha-core/src/main/java/com/techsenger/alpha/core/impl/DefaultFramework.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,13 @@ public RepoService getRepoService() {
189189
public synchronized void shutdown() {
190190
shuttingDown = true;
191191
logger.debug("Shutting down framework");
192-
List<ComponentDescriptor> descriptors =
193-
new ArrayList<>(componentManager.getDescriptors());
192+
List<ComponentDescriptor> descriptors = new ArrayList<>(componentManager.getDescriptors());
194193
Collections.sort(descriptors, new Comparator<ComponentDescriptor>() {
194+
195195
@Override public int compare(ComponentDescriptor d1, ComponentDescriptor d2) {
196196
return d2.getId() - d1.getId(); // reverse
197197
}
198+
198199
});
199200
for (ComponentDescriptor descriptor : descriptors) {
200201
try {

alpha-executor/src/main/java/com/techsenger/alpha/executor/api/CommandExecutorFactory.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
import com.techsenger.alpha.core.api.Framework;
2020
import com.techsenger.alpha.executor.impl.DefaultCommandExecutor;
21+
import com.techsenger.alpha.net.client.api.ClientService;
22+
import com.techsenger.alpha.net.client.api.ClientServiceFactory;
2123

2224
/**
2325
*
@@ -26,7 +28,11 @@
2628
public final class CommandExecutorFactory {
2729

2830
public static CommandExecutor create(Framework framework) throws Exception {
29-
return new DefaultCommandExecutor(framework);
31+
return new DefaultCommandExecutor(framework, ClientServiceFactory.create());
32+
}
33+
34+
public static CommandExecutor create(Framework framework, ClientService client) throws Exception {
35+
return new DefaultCommandExecutor(framework, client);
3036
}
3137

3238
private CommandExecutorFactory() {

alpha-executor/src/main/java/com/techsenger/alpha/executor/impl/DefaultCommandContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import com.techsenger.alpha.executor.api.ParameterProvider;
2323
import com.techsenger.alpha.executor.api.command.ExecutionTarget;
2424
import com.techsenger.alpha.net.client.api.ClientService;
25-
import com.techsenger.alpha.net.client.api.ClientServiceFactory;
2625
import com.techsenger.alpha.net.client.api.ClientSession;
2726
import java.util.Map;
2827
import java.util.concurrent.ConcurrentHashMap;
@@ -47,7 +46,7 @@ public class DefaultCommandContext implements CommandContext {
4746

4847
private ClientSession session;
4948

50-
private ClientService client = ClientServiceFactory.create();
49+
private final ClientService client;
5150

5251
private ExecutionProgress progress;
5352

@@ -56,9 +55,10 @@ public class DefaultCommandContext implements CommandContext {
5655
/**
5756
* Constructor.
5857
*/
59-
public DefaultCommandContext(Framework framework, CommandExecutor executor) {
58+
public DefaultCommandContext(Framework framework, CommandExecutor executor, ClientService client) {
6059
this.framework = framework;
6160
this.executor = executor;
61+
this.client = client;
6262
}
6363

6464
@Override

alpha-executor/src/main/java/com/techsenger/alpha/executor/impl/DefaultCommandExecutor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
import com.techsenger.alpha.executor.spi.Command;
7070
import com.techsenger.alpha.executor.spi.CommandDescriptor;
7171
import com.techsenger.alpha.executor.spi.CommandService;
72+
import com.techsenger.alpha.net.client.api.ClientService;
7273
import com.techsenger.toolkit.core.StopWatch;
7374
import com.techsenger.toolkit.core.StringUtils;
7475
import com.techsenger.toolkit.core.jpms.ServiceUtils;
@@ -102,8 +103,8 @@ public final class DefaultCommandExecutor implements CommandExecutor {
102103
/**
103104
* Constructor.
104105
*/
105-
public DefaultCommandExecutor(Framework framework) throws Exception {
106-
this.commandContext = new DefaultCommandContext(framework, this);
106+
public DefaultCommandExecutor(Framework framework, ClientService client) throws Exception {
107+
this.commandContext = new DefaultCommandContext(framework, this, client);
107108
var commandProviders = ServiceUtils.loadProviders(DefaultCommandExecutor.class.getModule().getLayer(), false,
108109
CommandService.class);
109110
var customCommands = commandProviders.stream()

alpha-executor/src/main/java/com/techsenger/alpha/executor/impl/commands/ComponentDeployCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public class ComponentDeployCommand extends AbstractComponentNameVerCommand {
4848
private List<String> parentAliases = new ArrayList<>();
4949

5050
@Parameter(names = {"--use-parent-cl"}, required = false,
51-
description = "sets whether the class loader of the parent component should be used; "
52-
+ "can be used only for components with one parent having one loader")
51+
description = "use the parent component's class loader "
52+
+ "(only if there is a single parent with a single loader)")
5353
private boolean useParentClassLoader;
5454

5555
@Override

alpha-executor/src/main/java/com/techsenger/alpha/executor/spi/AbstractCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public abstract class AbstractCommand implements Command {
4141
* Continue on fail.
4242
*/
4343
@Parameter(names = {"--continue-on-fail"}, required = false,
44-
description = "allows program to execute next command if this command has given an error,"
44+
description = "allows program to execute next command if this command has given an error, "
4545
+ "default is false")
4646
private boolean continueOnFail = false;
4747

alpha-gui/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
<groupId>org.slf4j</groupId>
2323
<artifactId>slf4j-api</artifactId>
2424
</dependency>
25-
<!-- <dependency>
26-
<groupId>org.fxmisc.richtext</groupId>
27-
<artifactId>richtextfx</artifactId>
28-
</dependency>-->
2925
<dependency>
3026
<groupId>org.openjfx</groupId>
3127
<artifactId>jfx-incubator-richtext</artifactId>

alpha-gui/src/main/java/com/techsenger/alpha/gui/AlphaApplication.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package com.techsenger.alpha.gui;
1818

19-
import com.techsenger.alpha.gui.console.InMemoryHistoryManager;
2019
import com.techsenger.alpha.gui.menu.FileMenuRegistrar;
20+
import com.techsenger.alpha.gui.style.ConsoleIcons;
2121
import com.techsenger.tabshell.core.DefaultShellContext;
2222
import com.techsenger.tabshell.core.DefaultShellFxView;
2323
import com.techsenger.tabshell.core.DefaultShellPresenter;
@@ -27,9 +27,10 @@
2727
import com.techsenger.tabshell.icons.IconStylesheetFactory;
2828
import com.techsenger.tabshell.layout.tabhost.TabHostFxView;
2929
import com.techsenger.tabshell.layout.tabhost.TabHostPresenter;
30+
import com.techsenger.tabshell.material.style.Stylesheet;
3031
import com.techsenger.tabshell.material.theme.AtlantaFxTheme;
32+
import java.util.ArrayList;
3133
import javafx.application.Application;
32-
import javafx.application.Platform;
3334
import javafx.scene.text.Font;
3435
import javafx.stage.Stage;
3536

@@ -57,12 +58,15 @@ public AppearanceSettings getAppearance() {
5758

5859
@Override
5960
public void start(Stage stage) throws Exception {
60-
var shellView = new DefaultShellFxView<>(this, stage, IconStylesheetFactory.forAll());
61+
var stylesheets = new ArrayList<Stylesheet>(IconStylesheetFactory.forAll());
62+
stylesheets.add(new Stylesheet(ConsoleIcons.class.getResource("icons.css")));
63+
var shellView = new DefaultShellFxView<>(this, stage, stylesheets);
6164
var context = new DefaultShellContext(createSettings(), new InMemoryHistoryManager(), getHostServices());
6265
var shellPresenter = new DefaultShellPresenter<>(shellView, context);
63-
shellPresenter.setOnClose(() -> Platform.exit());
66+
shellPresenter.setOnClose(() ->
67+
Thread.startVirtualThread(() -> ModuleActivatorProvider.getFramework().shutdown()));
6468
shellPresenter.initialize();
65-
shellView.setTitle("Console");
69+
shellView.setTitle("Alpha Framework");
6670

6771
var workspaceView = new TabHostFxView<>(true);
6872
var workspacePresenter = new TabHostPresenter<>(workspaceView);

alpha-gui/src/main/java/com/techsenger/alpha/gui/AlphaComponents.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public interface AlphaComponents {
4343

4444
ComponentName CONSOLE_TAB = new DefaultComponentName("Console Tab");
4545

46+
ComponentName CONSOLE_TOOL_BAR = new DefaultComponentName("Console ToolBar");
47+
4648
// ShellTabKey FILE_TAB = new ShellTabKey("File Tab");
4749
//
4850
// TabKey CONVERTED_XML_TAB = new TabKey("Converted XML Tab");

0 commit comments

Comments
 (0)