All Downloads are FREE. Search and download functionalities are using the official Maven repository.

moreswing.swing.i18n.LFrame.scala Maven / Gradle / Ivy

The newest version!
package moreswing.swing.i18n

import scala.swing.Frame

/** Extends [[scala.swing.Frame]] with localization support.
 *
 * @author myst3r10n
*/
trait LFrame extends Frame with LocaleListener {

  private var titleKey: String = null

  /** Add listener to [[scala.swingx.i18n.LocaleManager]]. */
  LocaleManager += this

  /** Called by [[scala.swingx.i18n.LocaleManager]] if locale changed. */
  def localeChanged {

    if(title != null)
      title = titleKey

  }

  /** Set title. */
  override def title_= (s: String) {

    this.titleKey = s
    super.title = LocaleManager.text(titleKey)

  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy