Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] How can I select a figure in a ViewPart


You need to register graphical viewer as selection provider :

getSite().setSelectionProvider(getGraphicalViewer());



Patrick Poglitsch <poglitsch@xxxxxxxxxxxxxx>
Sent by: gef-dev-bounces@xxxxxxxxxxx

2005.05.24 13:23

Please respond to
GEF development <gef-dev@xxxxxxxxxxx>

To
GEF development <gef-dev@xxxxxxxxxxx>
cc
Subject
Re: [gef-dev] How can I select a figure in a ViewPart





Hi Randy,

again, thanks for your quick reply.

I think I really have to clarify my question, it was to vague.

Of course it is clear, that only edit parts can be selected. The problem
is that instead of an editor I need a view. I read all the mail from the
newsgroup but there is no clear answer on this issue (altough there were
a lot of requests regarding this problem).
As I understood in case one wants to use a view part instead of an edit
part, one has to implement a lot of functionality on his own.

In my view I use the org.eclipse.gef.GraphicalViewer. On this viewer I
am adding a selection changed listener (this is how it is done commonly
also with other viewers like a TreeViewer).
My problem is that I am not receiving any selection changed event. My
edit parts can be selected (by returning true for the method
isSelectable() ).

What could be the problem for not getting this notification? Any hint
for solving this problem would be really great!

Thanks in advance,
Patrick

Randy Hudson schrieb:

>
> You can't select figures, only editparts.  The editpartviewer
> maintains selection and supports listeners.
>
> -Randy
>
>
>
> *Patrick Poglitsch <poglitsch@xxxxxxxxxxxxxx>*
> Sent by: gef-dev-bounces@xxxxxxxxxxx
>
> 05/23/2005 10:57 AM
> Please respond to
> GEF development
>
>
>                  
> To
>                  GEF development <gef-dev@xxxxxxxxxxx>
> cc
>                  
> Subject
>                  Re: [gef-dev] How can I select a figure in a ViewPart
>
>
>
>                  
>
>
>
>
>
> Thanks for your quick reply.  
>
> sorry for my bad question.
> I would like to know how can I implement a Selectionlistener on a
> ViewPart.
> I checked the newsgroups but I can't find any answer of my question. The
> only answer was that i should implement it by my self.
>
> cheers,
>
> Patrick
>
> Chris Aniszczyk schrieb:
>
> >
> > StructuredSelection selection = new StructuredSelection(myEditPart);
> > getGraphicalViewer().setSelection(selection);
> > // once selected if you want to get it so the graphicalviewer scrolls
> > to reveal the part on the screen
> > getGraphicalViewer().reveal(myEditPart);
> >
> > That should work. Please check the newsgroups first for the answers.
> > It may not seem like it, but there's a lot of answers there.
> >
> > Cheers,
> >
> > ~ Chris
> >
> >
> >
> > *Patrick Poglitsch <poglitsch@xxxxxxxxxxxxxx>*
> > Sent by: gef-dev-bounces@xxxxxxxxxxx
> >
> > 05/23/2005 09:21 AM
> > Please respond to
> > GEF development <gef-dev@xxxxxxxxxxx>
> >
> >
> >                  
> > To
> >                  GEF development <gef-dev@xxxxxxxxxxx>
> > cc
> >                  
> > Subject
> >                  [gef-dev] How can I select a figure in a ViewPart
> >
> >
> >
> >                  
> >
> >
> >
> >
> >
> > I need to select a figure in a ViewPart.
> > Can anyone help me how to select a figure in a ViewPart?
> >
> > please help
> >
> > Patrick
> > _______________________________________________
> > gef-dev mailing list
> > gef-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/gef-dev
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >gef-dev mailing list
> >gef-dev@xxxxxxxxxxx
> >https://dev.eclipse.org/mailman/listinfo/gef-dev
> >  
> >
>
> --
> ----------------------------------------------------
> Patrick Poglitsch
>
> Testing Technologies IST GmbH
> Rosenthalerstr. 13, 10119 Berlin, Germany
>
> phone: +49 30 726 19 19 22
> fax  : +49 30 726 19 19 20
> email: poglitsch@xxxxxxxxxxxxxx
> web  : www.testingtech.de
>
> ---------------------------------------------------
>
>
> _______________________________________________
> gef-dev mailing list
> gef-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/gef-dev
>
>------------------------------------------------------------------------
>
>_______________________________________________
>gef-dev mailing list
>gef-dev@xxxxxxxxxxx
>https://dev.eclipse.org/mailman/listinfo/gef-dev
>  
>

--
----------------------------------------------------
Patrick Poglitsch

Testing Technologies IST GmbH
Rosenthalerstr. 13, 10119 Berlin, Germany

phone: +49 30 726 19 19 22
fax  : +49 30 726 19 19 20
email: poglitsch@xxxxxxxxxxxxxx
web  : www.testingtech.de

---------------------------------------------------


_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev


Back to the top