diff --git a/lib/AppleJavaExtensions.jar b/lib/AppleJavaExtensions.jar deleted file mode 100644 index 6659a81c69f..00000000000 Binary files a/lib/AppleJavaExtensions.jar and /dev/null differ diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 8ec31a46d11..214530e363e 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -118,7 +118,6 @@ import org.jabref.logic.undo.AddUndoableActionEvent; import org.jabref.logic.undo.UndoChangeEvent; import org.jabref.logic.undo.UndoRedoEvent; -import org.jabref.logic.util.OS; import org.jabref.logic.util.io.FileUtil; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.database.BibDatabaseMode; @@ -136,7 +135,6 @@ import org.fxmisc.easybind.EasyBind; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import osx.macadapter.MacAdapter; /** * The main window of the application. @@ -286,18 +284,6 @@ public void init() { currentBasePanel.getUndoManager().postUndoRedoEvent(); currentBasePanel.getMainTable().requestFocus(); }); - - //Note: The registration of Apple event is at the end of initialization, because - //if the events happen too early (ie when the window is not initialized yet), the - //opened (double-clicked) documents are not displayed. - if (OS.OS_X) { - try { - new MacAdapter().registerMacEvents(this); - } catch (Exception e) { - LOGGER.error("Could not interface with Mac OS X methods.", e); - } - } - initShowTrackingNotification(); } diff --git a/src/main/java/org/jabref/gui/OSXCompatibleToolbar.java b/src/main/java/org/jabref/gui/OSXCompatibleToolbar.java deleted file mode 100644 index f71c9e72af5..00000000000 --- a/src/main/java/org/jabref/gui/OSXCompatibleToolbar.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.jabref.gui; - -import java.awt.Component; - -import javax.swing.JButton; -import javax.swing.JToolBar; - -import org.jabref.logic.util.OS; - -public class OSXCompatibleToolbar extends JToolBar { - - public OSXCompatibleToolbar() { - } - - public OSXCompatibleToolbar(int orientation) { - super(orientation); - } - - public OSXCompatibleToolbar(String name) { - super(name); - } - - public OSXCompatibleToolbar(String name, int orientation) { - super(name, orientation); - } - - @Override - public Component add(Component a) { - if (a instanceof JButton) { - JButton button = (JButton) a; - if (OS.OS_X) { - button.putClientProperty("JButton.buttonType", "toolbar"); - } - } - - return super.add(a); - } - -} diff --git a/src/main/java/osx/macadapter/MacAdapter.java b/src/main/java/osx/macadapter/MacAdapter.java deleted file mode 100644 index 9c7938aa5f6..00000000000 --- a/src/main/java/osx/macadapter/MacAdapter.java +++ /dev/null @@ -1,83 +0,0 @@ -package osx.macadapter; - -import java.io.File; -import java.util.List; - -import org.jabref.gui.JabRefFrame; - -import com.apple.eawt.AboutHandler; -import com.apple.eawt.AppEvent; -import com.apple.eawt.AppEvent.AboutEvent; -import com.apple.eawt.AppEvent.OpenFilesEvent; -import com.apple.eawt.AppEvent.PreferencesEvent; -import com.apple.eawt.AppEvent.QuitEvent; -import com.apple.eawt.AppReOpenedListener; -import com.apple.eawt.Application; -import com.apple.eawt.OpenFilesHandler; -import com.apple.eawt.PreferencesHandler; -import com.apple.eawt.QuitHandler; -import com.apple.eawt.QuitResponse; - -public class MacAdapter implements PreferencesHandler, AboutHandler, QuitHandler, OpenFilesHandler, AppReOpenedListener { - - private JabRefFrame parentFrame; - - public void registerMacEvents(JabRefFrame inputFrame) { - parentFrame = inputFrame; - Application.getApplication().setOpenFileHandler(this); - Application.getApplication().setAboutHandler(this); - Application.getApplication().setPreferencesHandler(this); - Application.getApplication().setQuitHandler(this); - Application.getApplication().addAppEventListener(this); - } - - @Override - // The OSXAdapter calls this method when a ".bib" file has been double-clicked from the Finder. - public void openFiles(OpenFilesEvent event) { - if (parentFrame == null) { - return; - } - - List files = event.getFiles(); - - for (File file : files) { - parentFrame.openAction(file.getAbsolutePath()); - } - } - - @Override - public void handleQuitRequestWith(QuitEvent evt, QuitResponse resp) { - if (parentFrame == null) { - return; - } - - if (parentFrame.quit()) { - resp.performQuit(); - } else { - resp.cancelQuit(); - } - } - - @Override - public void handleAbout(AboutEvent arg0) { - if (parentFrame == null) { - return; - } - - parentFrame.about(); - } - - @Override - public void handlePreferences(PreferencesEvent arg0) { - if (parentFrame == null) { - return; - } - - // parentFrame.showPreferencesDialog(); - } - - @Override - public void appReOpened(AppEvent.AppReOpenedEvent appReOpenedEvent) { - parentFrame.setVisible(true); - } -}