Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » setting the focus on a Figure
setting the focus on a Figure [message #242213] Tue, 08 April 2008 07:26 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,

My selection of the right edit part work but what is missing actually
is the selection of the figure of the edit part

anybody have the trick

Thx

Alexandre
Re: setting the focus on a Figure [message #242234 is a reply to message #242213] Tue, 08 April 2008 15:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

you mean that an edit part which can be ellipse or any polygon?

thats an interesting idea and should be introduced in the future releases of GEF..,
Re: setting the focus on a Figure [message #242265 is a reply to message #242234] Wed, 09 April 2008 06:57 Go to previous message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

sharad a écrit :
> you mean that an edit part which can be ellipse or any polygon?
>
> thats an interesting idea and should be introduced in the future releases of GEF..,

yes, in my use case I move edit part from keyboard and I want to still
have the focus on my moved edit part so I want to have the focus on the
figure inside the edit part

I've done it by doing this

// Gets the table widget
Widget widget = getSelectedWidget().getParent().getParent();
int index = widget.getIndexOfSelectedChild();

Widget child = widget.getContents().get(index);
execute(new MoveWidgetAndKeepSelectionCommand(getText(), widget, child,
index + 1));

EditPart rep = viewer.getRootEditPart();
String id = getID(child);
List result = new ArrayList();
findEditPartsForElement(rep, id, result);
viewer.deselectAll();
if (result.size() == 1) {
WidgetEditPart ep = (WidgetEditPart) result.get(0);
ep = (WidgetEditPart) ep.getChildren().get(0);
ep.setSelected(EditPart.SELECTED_PRIMARY);
ep.setFocus(true);
viewer.setFocus(ep);
viewer.select(ep);
viewer.setSelection(new StructuredSelection(ep));
Previous Topic:Showing connections in Outline View
Next Topic:KeyHandler doesn't retrieve an enabled action
Goto Forum:
  


Current Time: Thu Apr 18 10:48:52 GMT 2024

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

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

Back to the top