Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » Calling a method on Button Push(Calling a method on Button Push)
Calling a method on Button Push [message #1781565] Thu, 08 February 2018 16:58 Go to next message
Dominik Nickl is currently offline Dominik NicklFriend
Messages: 5
Registered: February 2018
Junior Member
Hi
I've bin working with Parsely for quite a bit now and encountert a little probem.

I have a entylist of different literature types and want so search for a specific titel
I added a label and button, but now i'm unsure of how to address th specific entrylist to call my search method

formControlFactory {
control {
Entrylist : search -> {
val c = new Composite(parent, SWT.NONE)
c.layout = new GridLayout(2, false)
val t = createText(c, SWT.BORDER)
val b = new Button(c, SWT.PUSH)
b.^text = "Search Titel"
b.addListener(SWT.MouseDown) [
MessageDialog.openInformation(c.shell, "Event", Entrylist.search(search))
//I just don't know, how i reference the Entrylist, the button and label are linked to.

]
return t
} target {
observeText
}
}
}
Re: Calling a method on Button Push [message #1782195 is a reply to message #1781565] Tue, 20 February 2018 11:07 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
Dear Dominik

The current EObject can be accessed in the block with the getter getOwner (or simply "owner"). That will have to be casted to Entrylist if you really need the Entrylist properties.
Please keep in mind that in the release 2.0 (scheduled in June together with Photon) we might rename that getter to a more intuitive name. We could also change the semantics of the DSL so that the current EObject (already casted) is automatically made available in the block; if you think that would be a valuable feature, please open a bug.

Please let us know if this fixes your problem.
cheers
Lorenzo


Re: Calling a method on Button Push [message #1782567 is a reply to message #1782195] Mon, 26 February 2018 14:55 Go to previous message
Dominik Nickl is currently offline Dominik NicklFriend
Messages: 5
Registered: February 2018
Junior Member
That solved my Problem

Thanks

[Updated on: Sun, 04 March 2018 15:17]

Report message to a moderator

Previous Topic:EMF Parsley 1.2.2 Released
Next Topic:Loading Resource via Filechooser
Goto Forum:
  


Current Time: Fri Apr 19 07:20:47 GMT 2024

Powered by FUDForum. Page generated in 0.01796 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top