This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application(title: "Gtk Window", ) { | |
vbox(spacing: 3) { | |
label(label: "Go ahead:\n Make my day!") | |
button(label: "Press me!", onClicked: {println "I was clicked: ${it.label}"}) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.xml.MarkupBuilder | |
includeTargets << griffonScript("Init") | |
includeTargets << griffonScript("_PluginDependencies") | |
target(default: "Update the application's Eclipse classpath file") { | |
updateClasspathFile() | |
} | |
updateClasspathFile = { newPlugin = null -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RunScript { | |
public static void main(String[] args) { | |
final Binding binding = new Binding(); | |
GroovyShell shell = new GroovyShell(binding); | |
shell.evaluate(new File("GroovyOrder.groovy")); | |
Object result = shell.evaluate(new File("order.dsl")); | |
final Object result = dsl.call(); | |
List<Order> r = (List<Order>) result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fade = { from, to -> | |
Effects.fade(window, from: from, to: to) { win -> | |
println "Window title is ${win.title}" | |
} | |
} | |
application(title: 'Effects Demo', id: 'window', | |
size:[320,480], | |
locationByPlatform:true, | |
iconImage: imageIcon('/griffon-icon-48x48.png').image, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import griffon.effects.* | |
import java.awt.Point | |
import java.awt.Dimension | |
opacity = { Map args -> | |
Effects.opacity(args, window) { win, params -> | |
println "Window title is ${win.title}" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package griffon.util | |
import org.codehaus.groovy.control.CompilationFailedException | |
class ListenerTest extends GroovyTestCase { | |
void testSimpleValues() { | |
GroovyShell shell = new GroovyShell() | |
shell.evaluate(""" | |
import griffon.util.Listener | |
import groovy.beans.Bindable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package graph | |
application(title: 'Graph', | |
pack: true, | |
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]) { | |
graphComponent { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import griffon.presentation.Scaffold | |
class Book { | |
String title | |
String author | |
} | |
@Scaffold(Book) | |
class BookBeanModel {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package b; | |
import org.codehaus.griffon.runtime.core.AbstractGriffonModel; | |
public class BModel extends AbstractGriffonModel { | |
private String input; | |
private String output; | |
public String getInput() { | |
return input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package b; | |
import java.awt.GridLayout; | |
import java.awt.event.*; | |
import javax.swing.*; | |
import javax.swing.event.*; | |
import java.beans.*; | |
import java.util.Map; | |
import griffon.swing.SwingGriffonApplication; |