Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Parsley » Dialog enhancement
Dialog enhancement [message #1734424] Wed, 08 June 2016 10:16 Go to next message
Patrick Tournet is currently offline Patrick TournetFriend
Messages: 17
Registered: July 2009
Location: Aix-en-Provence, FRANCE
Junior Member
Hello,

I've just discovered Parsley and so far loving it ! But I'm sort of hitting a wall, so I'm turning to you for some pointers :

I have a large collection of QR [int id, String raw_text, String edt_text] elements that I need to edit (initially all edt_text are null). I've chosen a SaveableTableFormView, which I've enriched with a filter I provide to the TableViewer (in XXXSaveableTableFormView.createPartControl) that allows me to select either the already edited items or the original ones.

I'm now trying to use the Dialog (which pops when you double-click on an item in the TableView) and expand its capabilities to do some "advanced" editing. Here are the things that I'm trying to achieve and haven't been able to figure out how to do them on my own (or that only work partially) :
- if edt_txt is null, copy raw_text and use a multiline editbox with at least 3 times the height of the standard one
- on OK, save the value of edt_txt
- adding a button that would be able to create a new object (not modelled yet) based on the selection in edt_txt

What I have done is create the following in my .parsley file :
dialogControlFactory {
	control {
		QR : edt_text -> {createText(it.raw_text)}
	}
}

but, if the editbox is correctly initialized, whatever I type inside it's never saved and the field size is adjusted to it's content (instead of using the whole dialog width), and is limited to one line of text.

I'm guessing there are ways to customize this dialog, I just would like to know where to look, not to spend too much time on that...

Thanks


I can do anything and I can do it better than anyone. Be as I am : be the best ! Wink
Re: Dialog enhancement [message #1734488 is a reply to message #1734424] Wed, 08 June 2016 16:28 Go to previous message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 213
Registered: January 2012
Senior Member

Hi Patrick,
for customizing the layout in order to use a multiline text and to grab vertical and horizontal space, you can do this:
Writer : name -> {
	val t = createText(it.name,SWT::MULTI, SWT::BORDER, SWT::WRAP, SWT::V_SCROLL)
	t.layoutData = GridDataFactory.fillDefaults.grab(true,true).create
	t
} 


while for the binding:
	edbc.bindValue(SWTObservables.observeText(t, SWT.Modify)  ,createFeatureObserveable(EXTLibraryPackage.Literals.WRITER__NAME))


So in the end you may have:

	dialogControlFactory {
		control {
			Writer : name -> {
				val t = createText(it.name,SWT::MULTI, SWT::BORDER,	SWT::WRAP, SWT::V_SCROLL)
				t.layoutData = GridDataFactory.fillDefaults.grab(true,true).create
				edbc.bindValue(SWTObservables.observeText(t, SWT.Modify)  ,createFeatureObserveable(EXTLibraryPackage.Literals.WRITER__NAME))
				t
			} 
		}
	}

[Updated on: Wed, 08 June 2016 17:02]

Report message to a moderator

Previous Topic:EMF Parsley 0.7.1
Next Topic:FeatureCaptionProvider
Goto Forum:
  


Current Time: Sun Oct 21 19:27:51 GMT 2018

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

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

Back to the top