Usage of GEF only in an eclipse view (no editor) [message #212188] |
Mon, 20 March 2006 04:48 |
Eclipse User |
|
|
|
Originally posted by: jojy.sv.gmail.com
Hello,
Recently I came across the GEF and its features.
I find that this is a framework for creating appealing editors.
Can any one of tell me how I can use GEF and draw2d in an eclipse View.
Because I just want to display some information in a view I dont want to
edit information.
I might require only the Figures and may be edit parts I suppose.
Any sample code would be of great help
Thanks a lot
George
|
|
|
|
|
|
|
Re: Usage of GEF only in an eclipse view (no editor) [message #212294 is a reply to message #212242] |
Tue, 21 March 2006 06:59 |
Eclipse User |
|
|
|
Originally posted by: jojy.sv.gmail.com
Hi Schosser
From the documentation I understand I need to override these three methods
in my Editparts
protected List getModelSourceConnections ()
protected List getModelChildren ()
and public List getSourceConnections ()
But I am not so sure what is supposed to be done in each of them.
Let me explain my requirement in detail.
I have a Data Structure which holds different other data structures with
in it.
I just used the same data structures as the model objects.
And I just need to display state of (instance values) these data
structures in an eclipse view in a hierarchial way.
So I hope I need to created do make some connection parts as well to show
the the links between the data structures.
But since I am using my existing data structure as the model I am not sure
how I can add this connection model or connectioneditpart to my diagram
at run time.
Please help me on this
Thanks a lot
Regards
George Sebastian
|
|
|
|
|
Re: Usage of GEF only in an eclipse view (no editor) [message #213512 is a reply to message #212205] |
Thu, 06 April 2006 16:57 |
Eclipse User |
|
|
|
Originally posted by: ben.vitale.precipia.com
Hi,
I'm trying to accomplish the same task: a GEF-based editor inside an
Eclipse view. The code below is quite helpful, but I'm wondering what
my view part class should be extending/implementing. Currently it's:
public class ScenarioBuilderView extends ViewPart
But it's complaining about getGraphicalViewer() and others not being
present in the ViewPart interface. Do I need to implement another class
as well? What is the relationship between ViewPart and
org.eclipse.gef.GraphicalViewer?
Thanks
Ben
A. Schosser wrote:
> Hi Sebastian,
>
> you have to initialize a (GEF) GraphicalViewer inside your view part.
> You should add something like the following to your view part class:
>
> private ScrollingGraphicalViewer m_viewer;
>
> /*
> * @see WorkbenchPart#createPartControl(Composite parent)
> */
> public void createPartControl(Composite parent)
> {
> initializeGraphicalViewer();
> getGraphicalViewer().createControl(parent);
> getViewSite().setSelectionProvider(getGraphicalViewer());
> getSite().setSelectionProvider(getGraphicalViewer());
> }
>
> public void initializeGraphicalViewer()
> {
> getGraphicalViewer().setRootEditPart(new
> ScalableFreeformRootEditPart());
> // set YOUR (GEF) part factory
> getGraphicalViewer().setEditPartFactory(new YourEditPartFactory());
> //m_viewer.setEditDomain(new ViewPartEditDomain(this));
> }
>
> public ScrollingGraphicalViewer getGraphicalViewer()
> {
> if (m_viewer == null)
> m_viewer = new ScrollingGraphicalViewer();
> return m_viewer;
> }
>
> Kind regards,
>
> --A. Schosser
> Mind8 GmbH
>
> George Sebastian <jojy.sv@gmail.com> wrote:
>
>> Hello,
>>
>> Recently I came across the GEF and its features.
>>
>> I find that this is a framework for creating appealing editors.
>>
>> Can any one of tell me how I can use GEF and draw2d in an eclipse View.
>>
>> Because I just want to display some information in a view I don�t
>> want to edit information.
>>
>> I might require only the Figures and may be edit parts I suppose.
>>
>> Any sample code would be of great help Thanks a lot
>>
>> George
|
|
|
Powered by
FUDForum. Page generated in 0.03825 seconds