|Re: activateDirectEdit idiom question [message #637723 is a reply to message #637632]
||Mon, 08 November 2010 14:12
| Pascal G
Registered: July 2009
On 10-11-08 02:12 AM, Hugo A. Garcia wrote:|
> Just want to confirm that the following idiom is the only way to edit a
> part in an EditPart?
> List<SWTBotGefEditPart> parts =
> SWTBotGefEditPart part = parts.get(0);
> List<SWTBotGefEditPart> children = part.children();
> Is there another idiom for editing the children of an EditPart?
For me, I can't use GefEditor#directEditType() because it sends a
default selection event. I need to do some validation before the default
selection is sent, so here's what I do instead:
SWTBotText textControl = gefEditor.bot().text();
Of course, I have this wrapped in an helper method.
Now, if you want to edit a child of an edit part, then you would have to do:
SWTBotGefEditPart child = editPart.children().get(0);
Helper.edit(child, gefEditor, newExpression);
> Haven't tried this yet but will soon: How would I edit a non visual
> property of the parent EditPart, one that is shown in the properties
> view but not in the diagram?
For this you won't need the gef component. It is simple SWTWorkbenchBot
work: get the view (Properties), activate/show it, search for widgets
inside it, do some edition.
Hope this helps.
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/
*Because performance matters.*
Powered by FUDForum
. Page generated in 0.01869 seconds