Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[nomaster] Revert "Added a Swing PopupMenu wrapper"

This reverts commit bdff881.

This is necessary to maintain binary compatibility with 2.10.0.
  • Loading branch information...
commit b4f277a847a9c29d3e0f7a90509c9e6a7c9fde17 1 parent b87e9b3
@adriaanm adriaanm authored
View
33 docs/examples/swing/PopupDemo.scala
@@ -1,33 +0,0 @@
-package examples.swing
-
-import swing._
-import event._
-import Swing._
-
-/**
- * @author John Sullivan
- * @author Ingo Maier
- */
-object PopupDemo extends SimpleSwingApplication {
- def top = new MainFrame {
- val popupMenu = new PopupMenu {
- contents += new Menu("menu 1") {
- contents += new RadioMenuItem("radio 1.1")
- contents += new RadioMenuItem("radio 1.2")
- }
- contents += new Menu("menu 2") {
- contents += new RadioMenuItem("radio 2.1")
- contents += new RadioMenuItem("radio 2.2")
- }
- }
- val button = new Button("Show Popup Menu")
- reactions += {
- case ButtonClicked(b) => popupMenu.show(b, 0, b.bounds.height)
- case PopupMenuCanceled(m) => println("Menu " + m + " canceled.")
- }
- listenTo(popupMenu)
- listenTo(button)
-
- contents = new FlowPanel(button)
- }
-}
View
65 src/swing/scala/swing/PopupMenu.scala
@@ -1,65 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2007-2012, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-
-package scala.swing
-
-import javax.swing.JPopupMenu
-import javax.swing.event.{PopupMenuListener, PopupMenuEvent}
-import event._
-
-/**
- * A popup menu.
- *
- * Example usage:
- *
- * {{{
- * val popupMenu = new PopupMenu {
- * contents += new Menu("menu 1") {
- * contents += new RadioMenuItem("radio 1.1")
- * contents += new RadioMenuItem("radio 1.2")
- * }
- * contents += new Menu("menu 2") {
- * contents += new RadioMenuItem("radio 2.1")
- * contents += new RadioMenuItem("radio 2.2")
- * }
- * }
- * val button = new Button("Show Popup Menu")
- * reactions += {
- * case e: ButtonClicked => popupMenu.show(button, 0, button.bounds.height)
- * }
- * listenTo(button)
- * }}}
- *
- * @author John Sullivan
- * @author Ingo Maier
- * @see javax.swing.JPopupMenu
- */
-class PopupMenu extends Component with SequentialContainer.Wrapper with Publisher {
- override lazy val peer: JPopupMenu = new JPopupMenu with SuperMixin
-
- peer.addPopupMenuListener(new PopupMenuListener {
- def popupMenuCanceled(e: PopupMenuEvent) {
- publish(PopupMenuCanceled(PopupMenu.this))
- }
- def popupMenuWillBecomeInvisible(e: PopupMenuEvent) {
- publish(PopupMenuWillBecomeInvisible(PopupMenu.this))
- }
- def popupMenuWillBecomeVisible(e: PopupMenuEvent) {
- publish(PopupMenuWillBecomeVisible(PopupMenu.this))
- }
- })
-
- def show(invoker: Component, x: Int, y: Int): Unit = peer.show(invoker.peer, x, y)
-
- def margin: Insets = peer.getMargin
- def label: String = peer.getLabel
- def label_=(s: String) { peer.setLabel(s) }
-}
-
View
18 src/swing/scala/swing/event/PopupMenuEvent.scala
@@ -1,18 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2007-2012, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-\* */
-
-
-
-package scala.swing
-package event
-
-abstract class PopupMenuEvent extends ComponentEvent
-
-case class PopupMenuCanceled(source: PopupMenu) extends PopupMenuEvent
-case class PopupMenuWillBecomeInvisible(source: PopupMenu) extends PopupMenuEvent
-case class PopupMenuWillBecomeVisible(source: PopupMenu) extends PopupMenuEvent
Please sign in to comment.
Something went wrong with that request. Please try again.