mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2024-12-01 09:50:32 +00:00
added new OSX QuitHandler
This commit is contained in:
parent
04bbe6ceab
commit
d65c4dfe44
@ -3,10 +3,14 @@ package com.bytezone.diskbrowser.gui;
|
|||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.EventQueue;
|
import java.awt.EventQueue;
|
||||||
|
import java.awt.desktop.QuitEvent;
|
||||||
|
import java.awt.desktop.QuitHandler;
|
||||||
|
import java.awt.desktop.QuitResponse;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import com.apple.eawt.Application;
|
||||||
import com.bytezone.common.Platform;
|
import com.bytezone.common.Platform;
|
||||||
import com.bytezone.common.QuitAction;
|
import com.bytezone.common.QuitAction;
|
||||||
import com.bytezone.common.QuitAction.QuitListener;
|
import com.bytezone.common.QuitAction.QuitListener;
|
||||||
@ -127,6 +131,15 @@ public class DiskBrowser extends JFrame implements DiskSelectionListener, QuitLi
|
|||||||
quitAction.addQuitListener (diskLayoutPanel);
|
quitAction.addQuitListener (diskLayoutPanel);
|
||||||
quitAction.addQuitListener (this);
|
quitAction.addQuitListener (this);
|
||||||
|
|
||||||
|
Application.getApplication ().setQuitHandler (new QuitHandler ()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void handleQuitRequestWith (QuitEvent e, QuitResponse response)
|
||||||
|
{
|
||||||
|
quitAction.quit ();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
catalogPanel.setCloseTabAction (closeTabAction);
|
catalogPanel.setCloseTabAction (closeTabAction);
|
||||||
|
|
||||||
pack ();
|
pack ();
|
||||||
|
Loading…
Reference in New Issue
Block a user