using GEF within a view [message #204232] |
Thu, 01 December 2005 13:28 |
Eclipse User |
|
|
|
Originally posted by: jkarlik.info.fundp.ac.be
hello,
Instead using a editor, i want to put some figures in a view bu
extending ViewPart.
I have a problem when my editPart runs the method getChildren() (this
method returns a empty list because my model object has no chlidren to
display as a figure within the view). If someone can help me, it would
be very nice because i really don't find any solution...
Here is the error message: an error has occured when activing this view
in my EditPart:
public List getModelChildren()
{
return Collections.EMPTY_LIST;
}
in my viewPart:
public void createPartControl(Composite parent)
{
graphicalViewer = createGraphicalViewer(parent);
}
public GraphicalViewer createGraphicalViewer(Composite parent)
{
ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
GraphicalViewer grapViewer = new ScrollingGraphicalViewer();
grapViewer.createControl(parent);
grapViewer.getControl().setBackground(parent.getBackground() );
grapViewer.setRootEditPart(root);
grapViewer.setEditDomain(new EditDomain());
getSite().setSelectionProvider(grapViewer);
grapViewer.setEditPartFactory(getMyEditPartFactory());
grapViewer.setContents(getContent());
return grapViewer;
}
thank you!
|
|
|
Re: using GEF within a view [message #204455 is a reply to message #204232] |
Sat, 03 December 2005 14:59 |
Eclipse User |
|
|
|
Originally posted by: jkarlik.info.fundp.ac.be
karlik joachim a écrit :
> hello,
>
> Instead using a editor, i want to put some figures in a view bu
> extending ViewPart.
>
> I have a problem when my editPart runs the method getChildren() (this
> method returns a empty list because my model object has no chlidren to
> display as a figure within the view). If someone can help me, it would
> be very nice because i really don't find any solution...
>
> Here is the error message: an error has occured when activing this view
>
> in my EditPart:
>
> public List getModelChildren()
> {
> return Collections.EMPTY_LIST;
> }
>
> in my viewPart:
>
> public void createPartControl(Composite parent)
> {
> graphicalViewer = createGraphicalViewer(parent);
> }
>
> public GraphicalViewer createGraphicalViewer(Composite parent)
> {
> ScalableFreeformRootEditPart root = new
> ScalableFreeformRootEditPart();
> GraphicalViewer grapViewer = new ScrollingGraphicalViewer();
> grapViewer.createControl(parent);
> grapViewer.getControl().setBackground(parent.getBackground() );
> grapViewer.setRootEditPart(root);
> grapViewer.setEditDomain(new EditDomain());
> getSite().setSelectionProvider(grapViewer);
> grapViewer.setEditPartFactory(getMyEditPartFactory());
> grapViewer.setContents(getContent());
>
> return grapViewer;
> }
>
> thank you!
I checked everything i m sure that my model and my editparts are
correctly integrated. But i have aproblem to integrate my gaphicalViewer
within my viewPart. Is someone can help me to do that? Is it different
from the integration with an editorPart?
|
|
|
Re: using GEF within a view [message #204462 is a reply to message #204455] |
Sat, 03 December 2005 22:01 |
Eclipse User |
|
|
|
Originally posted by: jkarlik.info.fundp.ac.be
karlik joachim a écrit :
> karlik joachim a écrit :
>
>> hello,
>>
>> Instead using a editor, i want to put some figures in a view bu
>> extending ViewPart.
>>
>> I have a problem when my editPart runs the method getChildren() (this
>> method returns a empty list because my model object has no chlidren to
>> display as a figure within the view). If someone can help me, it would
>> be very nice because i really don't find any solution...
>>
>> Here is the error message: an error has occured when activing this view
>>
>> in my EditPart:
>>
>> public List getModelChildren()
>> {
>> return Collections.EMPTY_LIST;
>> }
>>
>> in my viewPart:
>>
>> public void createPartControl(Composite parent)
>> {
>> graphicalViewer = createGraphicalViewer(parent);
>> }
>> public GraphicalViewer createGraphicalViewer(Composite parent)
>> {
>> ScalableFreeformRootEditPart root = new
>> ScalableFreeformRootEditPart();
>> GraphicalViewer grapViewer = new ScrollingGraphicalViewer();
>> grapViewer.createControl(parent);
>> grapViewer.getControl().setBackground(parent.getBackground() );
>> grapViewer.setRootEditPart(root);
>> grapViewer.setEditDomain(new EditDomain());
>> getSite().setSelectionProvider(grapViewer);
>> grapViewer.setEditPartFactory(getMyEditPartFactory());
>> grapViewer.setContents(getContent());
>>
>> return grapViewer;
>> }
>>
>> thank you!
>
>
> I checked everything i m sure that my model and my editparts are
> correctly integrated. But i have aproblem to integrate my gaphicalViewer
> within my viewPart. Is someone can help me to do that? Is it different
> from the integration with an editorPart?
it seems to work now, but i have again a error message when the view
gets the focus "an error has occured when activing this view". :-(
|
|
|
Powered by
FUDForum. Page generated in 0.03319 seconds