Skip to content

Commit

Permalink
Added pf4j PluginManager
Browse files Browse the repository at this point in the history
  • Loading branch information
astrapi69 committed Sep 12, 2023
1 parent 139c438 commit c638b1c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jsonExtensionsVersion=2.4
jacksonVersion=2.15.2
tangoIconThemeVersion=0.8.90
silkIconThemeVersion=1
pf4jVersion=3.9.0
pf4jVersion=3.10.0
commonsCodecVersion=1.16.0
netExtensionsVersion=5.2
genTreeVersion=8.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
import io.github.astrapi69.swing.splashscreen.ProgressBarSplashScreen;
import io.github.astrapi69.swing.splashscreen.SplashScreenModelBean;
import io.github.astrapi69.throwable.RuntimeExceptionDecorator;
import org.pf4j.DefaultPluginManager;
import org.pf4j.PluginManager;

/**
* The class {@link MysticCryptApplicationFrame}
Expand Down Expand Up @@ -101,6 +103,8 @@ public class MysticCryptApplicationFrame extends ApplicationPanelFrame<Applicati

FrameMode frameMode;

PluginManager pluginManager;

/**
* initial block
*/
Expand Down Expand Up @@ -208,6 +212,7 @@ protected void onBeforeInitialize()
{
instance = this;
}
pluginManager = new DefaultPluginManager();
// add once the default provider to the Security class
setSecurityProvider();
// initialize model and model object
Expand Down Expand Up @@ -270,6 +275,9 @@ protected void onAfterInitialize()
super.onAfterInitialize();
desktopPanePanel = (JDesktopPanePanel<ApplicationModelBean>)getMainComponent();
frameMode = FrameMode.DESKTOP_PANE;
// start and load all plugins of application
pluginManager.loadPlugins();
pluginManager.startPlugins();
setTitle(Messages.getString("mainframe.title"));
setDefaultLookAndFeel(LookAndFeels.NIMBUS, this);
this.setSize(ScreenSizeExtensions.getScreenWidth(), ScreenSizeExtensions.getScreenHeight());
Expand Down

0 comments on commit c638b1c

Please sign in to comment.