
from gvsig import *

from commonsdialog import msgbox

from org.gvsig.andami import PluginsLocator
from org.gvsig.scripting.app.extension import ScriptingExtension

def main():
  application = ApplicationLocator.getManager()

  # Creamos la accion si no existe ya  
  actionManager = PluginsLocator.getActionInfoManager()
  action = actionManager.createAction(ScriptingExtension, "tools-hello", "Hello", "hello", "tools-scripting-launcher", None, 1009000000, "Hello world")
  action = actionManager.registerAction(action)

  # Y damos de alta una entra de menu y un boton en la barra de herramientas
  application.addMenu(action, "tools/Hello")
  application.addTool(action, "hello")

  msgbox("Insertada la entrada 'Hello' en el menu 'Herramientas' y un boton en la barra de botones.")
    

