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

y.swing-shortcut-manager_2.9.1-1.1.0.0.source-code.Main.scala Maven / Gradle / Ivy

The newest version!
/*
This file is part of swing-keyboard-manager
, a shortcut manager
for Java Swing used in Penn TotalRecall


swing-keyboard-manager is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as published
by the Free Software Foundation, version 3 only.

swing-keyboard-manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with swing-keyboard-manager.  If not, see
.
*/

package edu.upenn.psych.memory.shortcutmanager

object Main {

  def main(args: Array[String]) = {
    val namespace = "/" + getClass.getPackage.getName.replace(".", "/")
    val resourcePath = "/actions.xml"
    Option(Main.getClass.getResource(resourcePath)) match {
      case Some(url) => {
        val listener = new XActionListener() {
          override def xActionUpdated(xaction: XAction,
                                      old: Option[Shortcut]) =
            println("heard " + xaction + " formerly " + old)
        }
        new ShortcutManager(url, namespace, listener).setVisible(true)
      }
      case None => Console.err println "no keyboard shortcuts file found"
    }
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy