java.lang.Object
com.marginallyclever.ro3.apps.AppFactory
AppFactory uses Reflection to find and register all Apps in a given package.
Then DockingPanel can call on the factory to create instances of those Apps as needed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Appstatic intstatic voidlistApps(PrintStream out) List all registered Apps to the given PrintStream.static voidstatic voidregisterApps(String sourcePath) Use Reflection to find and register all Apps in the given package.
-
Constructor Details
-
AppFactory
public AppFactory()
-
-
Method Details
-
registerApps
Use Reflection to find and register all Apps in the given package. ScanResult#getSubclasses finds all classes that extend App. ScanResult#getClassesImplementing finds all classes that implement an interface, which is what ChatGPT suggested, but App is not an interface, so it finds none.- Parameters:
sourcePath- the package to scan for Apps
-
listApps
List all registered Apps to the given PrintStream.- Parameters:
out- the PrintStream to write to
-
main
-
getRegisteredAppsCount
public static int getRegisteredAppsCount() -
create
-