Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsactivateDirectEdit idiom question
https://www.eclipse.org/forums/index.php/mv/msg/199809/637632/#msg_637632
Just want to confirm that the following idiom is the only way to edit a
part in an EditPart?
List<SWTBotGefEditPart> parts =
editor.editParts(instanceOf(XXX_EditPart.class));
SWTBotGefEditPart part = parts.get(0);
List<SWTBotGefEditPart> children = part.children();
children.get(0).activateDirectEdit();
editor.directEditType("Something");
Is there another idiom for editing the children of an EditPart?
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?
-H]]>Hugo A. Garcia2010-11-08T07:12:58-00:00Re: activateDirectEdit idiom question
https://www.eclipse.org/forums/index.php/mv/msg/199809/637723/#msg_637723
> Hi
>
> Just want to confirm that the following idiom is the only way to edit a
> part in an EditPart?
>
> List<SWTBotGefEditPart> parts =
> editor.editParts(instanceOf(XXX_EditPart.class));
> SWTBotGefEditPart part = parts.get(0);
> List<SWTBotGefEditPart> children = part.children();
> children.get(0).activateDirectEdit();
> editor.directEditType("Something");
>
> 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:
> 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?
>
> -H
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.
*Because performance matters.*]]>Pascal G2010-11-08T14:12:07-00:00Re: activateDirectEdit idiom question
https://www.eclipse.org/forums/index.php/mv/msg/199809/638187/#msg_638187
> Hi
>
> Just want to confirm that the following idiom is the only way to edit a
> part in an EditPart?
>
> List<SWTBotGefEditPart> parts =
> editor.editParts(instanceOf(XXX_EditPart.class));
> SWTBotGefEditPart part = parts.get(0);
> List<SWTBotGefEditPart> children = part.children();
> children.get(0).activateDirectEdit();
> editor.directEditType("Something");
>
> Is there another idiom for editing the children of an EditPart?
>
> 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?
Answer to your second question with the properties view:
Just select the properties view with swtbot and find the table in that
view and edit the line with your property.