- public ConfigurationManager configuration;
- FileAssociationManager associationManager = new FileAssociationManager();
+ public ConfigurationManager configurationManager;
+ final MainFrame mainFrame;
+
+ public InstantLauncher() throws IOException {
+ configurationManager = new ConfigurationManager();
+ mainFrame = new MainFrame(this);
+ }
+
+ /**
+ * @return <code>true</code> if file was opened. <code>false</code> if
+ * unknown file type.
+ */
+ public boolean openFile(final File file) {
+ FileAssociation fileAssociation = configurationManager.getConfiguration().findFileAssociation(file);
+ if (fileAssociation == null) return false;
+
+ final String[] commands = fileAssociation.getCommands();
+ runOpeningApplication(file, commands);
+
+ return false;
+ }