use of org.apache.cayenne.modeler.action.OpenProjectAction in project cayenne by apache.
the class Main method launch.
protected void launch() {
// TODO: use module auto-loading...
final Injector injector = DIBootstrap.createInjector(appendModules(new ArrayList<Module>()));
// init look and feel before using any Swing classes...
injector.getInstance(PlatformInitializer.class).initLookAndFeel();
// logger should go after Look And Feel or Logger Console will be without style
logger.info("Starting CayenneModeler.");
logger.info("JRE v." + System.getProperty("java.version") + " at " + System.getProperty("java.home"));
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Application application = injector.getInstance(Application.class);
Application.setInstance(application);
application.startup();
// start initial project AFTER the app startup, as we need Application
// preferences to be bootstrapped.
File project = initialProjectFromArgs();
if (project == null) {
project = initialProjectFromPreferences();
}
if (project != null) {
new OpenProjectAction(application).openProject(project);
}
}
});
}
Aggregations