Skip to content

Instantly share code, notes, and snippets.

@AndrewShitsko
Created December 5, 2016 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewShitsko/b09027a8dc02ae01fb1a8afa2217837c to your computer and use it in GitHub Desktop.
Save AndrewShitsko/b09027a8dc02ae01fb1a8afa2217837c to your computer and use it in GitHub Desktop.
package org.example
import griffon.core.artifact.GriffonView
import griffon.inject.MVCMember
import griffon.metadata.ArtifactProviderFor
import javax.annotation.Nonnull
@ArtifactProviderFor(GriffonView)
class HomeView {
@MVCMember @Nonnull
FactoryBuilderSupport builder
@MVCMember @Nonnull
HomeModel model
void initUI() {
// builder to create UI, it’s window of the application
builder.application(title: application.configuration['application.title'],
sizeToScene: true, centerOnScreen: true, name: 'mainWindow') {
// container for all content
scene(fill: WHITE, width: 200, height: 60) {
// one from type of layouts
gridPane {
label(id: 'clickLabel', row: 0, column: 0,
text: bind(model.clickCountProperty()))
button(row: 1, column: 0, prefWidth: 200,
id: 'clickActionTarget', clickAction)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment