summaryrefslogtreecommitdiff
path: root/src/swing
diff options
context:
space:
mode:
authorIngo Maier <ingo.maier@epfl.ch>2011-08-12 16:16:12 +0000
committerIngo Maier <ingo.maier@epfl.ch>2011-08-12 16:16:12 +0000
commit8b4d5de0b6326b2377e6822bdc03275fa4c13682 (patch)
tree71f1d66190b72b2f4beb18a9253bbb77e638ce6c /src/swing
parent9185598c8b55b2bd2cd4699af311ce326623dd5c (diff)
downloadscala-8b4d5de0b6326b2377e6822bdc03275fa4c13682.tar.gz
scala-8b4d5de0b6326b2377e6822bdc03275fa4c13682.tar.bz2
scala-8b4d5de0b6326b2377e6822bdc03275fa4c13682.zip
Pulled up the SuperMixin that calls closeOperat...
Pulled up the SuperMixin that calls closeOperations for frames into window and let dialogs mix it in as well. Closes #3708.
Diffstat (limited to 'src/swing')
-rw-r--r--src/swing/scala/swing/RichWindow.scala14
-rw-r--r--src/swing/scala/swing/Window.scala8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/swing/scala/swing/RichWindow.scala b/src/swing/scala/swing/RichWindow.scala
index 78e22f9c60..977aab300a 100644
--- a/src/swing/scala/swing/RichWindow.scala
+++ b/src/swing/scala/swing/RichWindow.scala
@@ -75,14 +75,6 @@ sealed trait RichWindow extends Window {
class Frame(gc: java.awt.GraphicsConfiguration = null) extends RichWindow {
override lazy val peer: JFrame with InterfaceMixin = new JFrame(gc) with InterfaceMixin with SuperMixin
- protected trait SuperMixin extends JFrame {
- override protected def processWindowEvent(e: java.awt.event.WindowEvent) {
- super.processWindowEvent(e)
- if (e.getID() == java.awt.event.WindowEvent.WINDOW_CLOSING)
- closeOperation()
- }
- }
-
def iconify() { peer.setExtendedState(peer.getExtendedState | AWTFrame.ICONIFIED) }
def uniconify() { peer.setExtendedState(peer.getExtendedState & ~AWTFrame.ICONIFIED) }
def iconified: Boolean = (peer.getExtendedState & AWTFrame.ICONIFIED) != 0
@@ -189,10 +181,10 @@ object Dialog {
*/
class Dialog(owner: Window, gc: java.awt.GraphicsConfiguration = null) extends RichWindow {
override lazy val peer: JDialog with InterfaceMixin =
- if (owner == null) new JDialog with InterfaceMixin
+ if (owner == null) new JDialog with InterfaceMixin with SuperMixin
else owner match {
- case f: Frame => new JDialog(f.peer, "", false, gc) with InterfaceMixin
- case d: Dialog => new JDialog(d.peer, "", false, gc) with InterfaceMixin
+ case f: Frame => new JDialog(f.peer, "", false, gc) with InterfaceMixin with SuperMixin
+ case d: Dialog => new JDialog(d.peer, "", false, gc) with InterfaceMixin with SuperMixin
}
def this() = this(null)
diff --git a/src/swing/scala/swing/Window.scala b/src/swing/scala/swing/Window.scala
index 71982a9b18..c3918551db 100644
--- a/src/swing/scala/swing/Window.scala
+++ b/src/swing/scala/swing/Window.scala
@@ -27,6 +27,14 @@ abstract class Window extends UIElement with RootPanel with Publisher { outer =>
protected trait InterfaceMixin extends javax.swing.RootPaneContainer
+ protected trait SuperMixin extends AWTWindow {
+ override protected def processWindowEvent(e: java.awt.event.WindowEvent) {
+ super.processWindowEvent(e)
+ if (e.getID() == java.awt.event.WindowEvent.WINDOW_CLOSING)
+ closeOperation()
+ }
+ }
+
/**
* This method is called when the window is closing, after all other window
* event listeners have been processed.