create MacApplicationMenu if running on Mac

This commit is contained in:
Anton Keks 2015-08-15 16:18:15 +03:00
parent 2d1b5e0f1b
commit 1322018321
3 changed files with 7 additions and 7 deletions

View File

@ -59,12 +59,13 @@ public class Main {
LOG.finer("Labels and Config initialized after " + (System.currentTimeMillis() - startTime));
MainComponent mainComponent = DaggerMainComponent.create();
LOG.finer("ComponentRegistry initialized after " + (System.currentTimeMillis() - startTime));
if (Platform.MAC_OS) mainComponent.createMacApplicationMenu();
LOG.finer("Components initialized after " + (System.currentTimeMillis() - startTime));
processCommandLine(args, mainComponent);
// create the main window using dependency injection
MainWindow mainWindow = mainComponent.getMainWindow();
MainWindow mainWindow = mainComponent.createMainWindow();
LOG.fine("Startup time: " + (System.currentTimeMillis() - startTime));
while (!mainWindow.isDisposed()) {
@ -118,7 +119,7 @@ public class Main {
private static void processCommandLine(String[] args, MainComponent mainComponent) {
if (args.length != 0) {
CommandLineProcessor cli = mainComponent.getCommandLineProcessor();
CommandLineProcessor cli = mainComponent.createCommandLineProcessor();
try {
cli.parse(args);
}

View File

@ -15,7 +15,7 @@ import javax.inject.Singleton;
})
@Singleton
public interface MainComponent {
MainWindow getMainWindow();
MacApplicationMenu getMacApplicationMenu();
CommandLineProcessor getCommandLineProcessor();
MainWindow createMainWindow();
MacApplicationMenu createMacApplicationMenu();
CommandLineProcessor createCommandLineProcessor();
}

View File

@ -16,7 +16,6 @@ import javax.inject.Inject;
* in order to conform better to Mac standards.
*/
public class MacApplicationMenu {
@Inject AboutDialog aboutDialog;
@Inject PreferencesDialog preferencesDialog;
@Inject SelectFetchersDialog selectFetchersDialog;