Transcripción
Extracto de la transcripción automática del vídeo realizada por YouTube.
for those of you that don't let me tell you that desktop application development is not dead at least not in the JVM is quite alive though some people still don't talk about it so the whole point of this talk is to demonstrate that the Griffin framework
is up to the task for developing applications on the desktop and it's quite enjoyable it's quite fun and if you already know a little bit about groovy and if you know some the stuff behind grills do you find that Griffin has many refreshing ideas coming
from both this talk i usually give it with my wife in shell vision but sadly she is not here with us today she was yesterday and the talk is actually two people talking together about how we can create an application and we're going back and forth so this
is a nice discussion but now we'll try to do it on my own so we'll see how it goes and now we have this so there are my three different areas one is a scroll pain that contains a list the second is just a panel that's a placeholder for the moment
and the third one is another panel we are not as another placeholder notice that I'm making use of me clay out that is probably the best layout that exists out there for swing and there is also a port for Java effects in case you're wondering if you're
doing layout with grid back layout please stop hurting yourself switch to a better layout meekly how is that better layout in worst case use form layout from the agudah switch also very great anyway with this we had three elements so let's see them in
action I have several aliases for my commands instead of typing Griffin I just type G and run app just in case you're wondering I can also do this ra this will be expanded to run app or I can just do app a which actually spends for app which is an alias
from run app so i just type less and still get the same behavior yeah what type when when the command can do this thing for you if it understands that those little letters those small things then should work okay so now we have the address book information
the application with the three elements good i will say so the layered working perfect so now let's the next step will be to put some buttons here let's put some action for example let's create a new contact save it delete it and print out the
information that it contains there will be a step number three actually yes the menu bar and buttons so now we see in the view two elements new here a menu bar that contains menus and menu items and the buttons the nice thing about this dsl is that the the
hierarchy the structure the view I is right there in front of you or do eyes if we were to do this in plain Java then we had to create a components in perhaps on a helper method and then set up the layout and then call each one of the incident probably in
temporary variables or a list or a map and then attach them to the container what's nice about the Builder is that it knows that the menu bar is the current container when I'm inside menu and when I'm called menu item the current contain is the
menu that I have here so it knows that these are the children and they will be added to the menu the menu will be added to the menu bar and the menu bar will be added to the top container there's nothing else that needs to be done so here i have the menus
here i have the buttons notice there's some repetition here the names yes i know we'll see how to fix that in a moment so let's run it again let's see uh-huh there we see the menus and the buttons right now they do not do anything they are
not reacting to our input events but at least we know that setting up those nose work next step will be to put some actions on it let's see if we are select new I should get a printout if I click on delete as you shall get a printout step number four we
get this now we change for using simple text to something called new action save action this is one of the things that come from using convention over configuration and these actions are actually backed by a swing at javax.swing action subclass so you can
set the name the small icon large icon description tooltip and whatnot you may be wondering who creates these actions well they belong to the other component of our base embassy group which is the controller and this is the second element that we're going
to see and notice that we make use of the same action here in the menu item and the button this is just standard groovy standard swing stuff reusing an action so let's go into the controller and we get this actions in a controller can be written in two
modes like we did in in grails 13 and previews they will have to be closures closure properties or you can have them as methods now I know that Grails added the support for methods as actions in controllers in grails 20 guess what we did it in back in Griffin
0 1 3.5 years ago we rock so doesn't matter which ones which way you choose crushers or methods it will work if I change this name here to something else that will be the same name by convention that has to be used here okay so let's see that let's
run them remember the only changes is that we're setting the actions in the controller and making sure that we make use of the actions in the builder in the view so if I click new here I get the correct printout now if i select dumped here i also get a
[ ... ]
Nota: se han omitido las otras 2.714 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.