intellij-ideagroovygriffon

How to use Griffon Swingx plugin with IntelliJ?


I've setup a Griffon project using ItelliJ and trying to use SwingX componants in a view but I can't manage to make it work. My griffon-app/conf/BuildConfig.groovy looks like this:

griffon.project.dependency.resolution = {
    inherits("global") { }
    log "warn"
    repositories {
        griffonHome()
        mavenLocal()
        mavenCentral()
        jcenter()
    }
    dependencies {
        compile 'org.codehaus.griffon.plugins:griffon-swingx-plugin:1.1.0'
    }
}

And my view looks like this:

package data.viewer

import java.awt.*

application(title: 'data-viewer',
  pack: true,
  location: [0,0],
  locationByPlatform: true,
  iconImage:   imageIcon('/griffon-icon-48x48.png').image,
  iconImages: [imageIcon('/griffon-icon-48x48.png').image,
               imageIcon('/griffon-icon-32x32.png').image,
               imageIcon('/griffon-icon-16x16.png').image])
{
    panel(){
        boxLayout(axis: BoxLayout.Y_AXIS)
        jxbutton(text: "Time map")
        panel(){
            panel(){
                label(icon: imageIcon('/europe.jpg'))
            }
            panel(layout: new GridLayout(10, 1)){
                button(text: "Indicatieur1")
            }
        }
    }
}

But I'm still getting an error:

sept. 06, 2015 4:01:10 PM groovy.util.FactoryBuilderSupport createNode
AVERTISSEMENT: Could not find match for name 'jxbutton'
groovy.lang.MissingMethodException: No signature of method: java.lang.Object.jxbutton() is applicable for argument types: (java.util.LinkedHashMap, null) values: [[text:Time map], null]

Can someone tell me what I am missiing?


Solution

  • Griffon plugins served from bintray/jcenter are incompatible with Griffon 1.x. These plugins only work with Griffon 2.x (http://griffon-framework.org/)

    Installing plugins for Griffon 1.x requires you to use the Griffon Artifact Portal, for example http://artifacts.griffon-framework.org/plugin/swingx-builder/installation