Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Peter-Frank Spierenburg
@spierepf
Thanks very much!
Peter-Frank Spierenburg
@spierepf
Greetings, I am writing an application with two MVC groups that share the same model class. Is there a way to let the dependency injection system know to only instantiate a single instance of that model?
Peter-Frank Spierenburg
@spierepf
Ignore my last message. I found the @Singleton annotation. :)
Peter-Frank Spierenburg
@spierepf
Lol. Adding @Singleton causes a third instance of the model class to be instantiated.
Clearly the @Singleton annotation is not what I want...
Andres Almiray
@aalmiray
you must pass a “model” key/value as argument to createMVCGrup
Peter-Frank Spierenburg
@spierepf
Awesome! Thanks!
markoong
@markoong
Hi! I am in the process of learning Griffon and need some help, I've requested the permission to post to the nabble forum, should I ping somebody in particular to get the permission or should I just write here (it's a bit verbose) instead ?
Andres Almiray
@aalmiray
hi @markoong, apologies in advance, your request will be authorized this evening. In the meantime feel free to use this channel
markoong
@markoong
thank you @aalmiray, so let's start with something IDE related: I've setup a groovy-swing project following the guide and opened the gradle based project with Intellij Idea (Ultimate) , and I think the groovy based griffon DSL is not recognized, as I have the view full of warnings and highlights (e.g.: borderLayout cannot be applied to '()' and 'menuBar' cannot be applied to '(groovy.lang.Closure<javax.swing.JMenu>)' ), the programming experience is degraded because I get no intellisense and the syntax coloring is a mess because of warnings: any hints ?
I forgot: the gradle project has been successfully imported and passes its tests and runs successfully
Andres Almiray
@aalmiray
hi @markoong, your subscription to the Griffon ML has been processed. Please try posting a message at any time :smile:
Andres Almiray
@aalmiray
I've also have the latest Intellij Ultimate (2018.2) and I can confirm intellisense works as expected. Create a brand new project with "lazybones create griffon-groovy-swing foo" then opened in Intellij. The file org.example.FooView was opened successfully with all SwingBuilder nodes recognized, no red squigglies in the code. Running Gradle 4.7 with JDK8u181 on OSX
markoong
@markoong
hi again @aalmiray , I've played a little bit with my Intellij configuration, created brand new projects with lazybones and even invalidate caches and restarted, but the "problem" seems to persist, to the point that I'm starting thinking that it could be not a problem. Being new to both, Intellij Idea and Griffon, could you please confirm that the view full of inspection warnings is normal ? intellij-griffon-dsl-warnings.png
markoong
@markoong
you can get a better view here, the inspection warnings details are here: as you can see I was slightly wrong in my first message, as I get Intellisense...after having imported the gradle project into Intellij (as suggested by IDE). Some env details:
2018-09-03 23:34:01,834 [ 123] INFO - #com.intellij.idea.Main - OS: Linux (3.12.67-64-desktop, amd64)
2018-09-03 23:34:01,834 [ 123] INFO - #com.intellij.idea.Main - JRE: 1.8.0_152-release-1248-b8 (JetBrains s.r.o)
2018-09-03 23:34:01,834 [ 123] INFO - #com.intellij.idea.Main - JVM: 25.152-b8 (OpenJDK 64-Bit Server VM)

Gradle 4.9

Build time: 2018-07-16 08:14:03 UTC
Revision: efcf8c1cf533b03c70f394f270f46a174c738efc

Kotlin DSL: 0.18.4
Kotlin: 1.2.41
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Linux 3.12.67-64-desktop amd64

markoong
@markoong
The only way to "solve" the problem is to annotate the method:
@SuppressWarnings(["GroovyAssignabilityCheck"])
    void initUI() {
Andres Almiray
@aalmiray
The are no errors in the pictures you posted. IntelliJ should mark them with red squiggles if it does not recognize the type, variable, or method name. So far the only symbol that IntelliJ can't find is clickAction but this variable will be provided by the framework if the controller has a method named click or clickAction. This is explained in the Griffon Guide.
markoong
@markoong

All right I assumed Intellij should had not shown all those "Incompatible type assignments" warnings; looking at e.g.:

'button' cannot be applied to '(['id':java.lang.String], ?)'

I still don't understand if this is an Intellij issue anyway, for example when I open a Gradle script its DSL isn't marked by any warnings.
I can try reporting an issue if somebody confirm it as such...

Mark Nellemann
@mnellemann
Hi all. Is it possible to bind the slider (groovyfx dsl) value to a controller.method() or model.property ?
Andres Almiray
@aalmiray
AFAIC slider(value: bind(model.someValueProperty()))
Mark Nellemann
@mnellemann
makes perfect sense, thanks. Does the model.someValue has to be a String ? For a slider I would think an Integer or Float would be more suitable.
Andres Almiray
@aalmiray
You can make it any type you need. You can also use the type conversions provided by JavaFX bindings, such as someIntegerValueProperty().asString()
Mark Nellemann
@mnellemann
Awesome :) Comming from Grails and web this is all new to me, but really exicting. Works perfectly as an Integer, and with .asString() in my label.
Vincenzo Forchì
@vforchi
Hi, a user just made me realize that the start scripts do not work on shells other than bash: as a workaround I modified them from gradle, but you may want to change the templates
Andres Almiray
@aalmiray
@vforchi could you share some details on the changes you had to make? I could adapt those changes and make them available in the project templates ;-)
Vincenzo Forchì
@vforchi
I just made a quick hack to force it to use bash:
startScripts {
doLast {
unixScript.text = unixScript.text.replaceAll("#!/usr/bin/env sh", "#!/usr/bin/env bash")
}
}
I think that if you want it to work on any shell you would pretty much have to write two or three different scripts
Andres Almiray
@aalmiray
got it, thanks! griffon/griffon#305
Mark Nellemann
@mnellemann
The application.title from conf/Config.groovy set's the title in my app window, but griffon.javafx.JavaFXGriffonApplication is shown in task-switch and in the task-bar, as seen here; is there another place to configure this ?
Andres Almiray
@aalmiray
Does this happen when running on Linux?
In oSX you may need to use https://github.com/codecentric/NSMenuFX
Mark Nellemann
@mnellemann
Does this happen when running on Linux? Yes, testing on Gnome desktop.
Andres Almiray
@aalmiray
Hmmm
I'd recommend following up with the people at Gluon http://gluonhq.com/
I assume you're running JavaFX 8 given that GroovyFX does not work with Java 9 yet
Mark Nellemann
@mnellemann
yes
I'll check w. gluonhq or maybe it will be fixed in javafx 9 or 11. Lot's of other things to discover and learn anyways :) Thanks.
Andres Almiray
@aalmiray
Be advised that a new version of GroovyFX will be needed post Java9. The current work targets JavaFX 11 and onwards
Mark Nellemann
@mnellemann
Question regarding testing - from the example app I see how the verifyThat('#someField', hasText('some text') works. Is it possible to verify that a field has text of a certain length? The text will be random, so can't verify the exact content.
Andres Almiray
@aalmiray
It all depends on the matchers exposed by https://github.com/TestFX/TestFX
Mark Nellemann
@mnellemann
Happy New Year everyone. I'm trying to add a custom application icon, and from the 2.15.1 guide I've used the example code iconImage: imageIcon("/griffon-icon-48x48.png").image as parameter to builder.application(). When I try to run the app, I get this error: griffon.exceptions.GriffonViewInitializationException: Unexpected error when initializing view of type biz.nellemann.pwdfx.PasswordFxView belonging to mvcgroup [passwordFx:passwordFx] Caused by: groovy.lang.MissingMethodException: No signature of method: biz.nellemann.pwdfx.PasswordFxView.imageIcon() is applicable for argument types: (java.lang.String) values: [/griffon-icon-48x48.png] at biz.nellemann.pwdfx.PasswordFxView.initUI(PasswordFxView.groovy:27). Works perfectly fine without the iconImage.
Andres Almiray
@aalmiray
It may be the case that imageIcon is evaluated eagerly, specially if the code is written as builder.application(iconImage: imageIcon(...)). The solution is to prefix the node with the builder, such as builder.application(iconImage: builder.imageIcon(...)).
Mark Nellemann
@mnellemann
Thanks. I've just tried it, but when line 27 in PasswordFxView.groovy is uncommented, it says: groovy.lang.MissingMethodException: No signature of method: griffon.util.CompositeBuilder.imageIcon() is applicable for argument types: ([Ljava.lang.Object;) values: [[/griffon-icon-48x48.png]].
Andres Almiray
@aalmiray
the imageIcon node does not accept Object[] not List as arguments.
Mark Nellemann
@mnellemann
Not sure I understand that - sorry for the newbie questions... but I got it working w. icons: new Image('/griffon-icon-48x48.png'), so I'm good.
myteer
@myteer
@aalmiray when will griffon 3.0.0 be released?
Andres Almiray
@aalmiray
@myteer we don’t have a concrete date yet. JSR-377 must have a final release yet. We hope to get it done by August 2019. Is there something you need from the 3.x line?
myteer
@myteer
Oh I got it! Just want to try JPMS in griffon.