Skip to main content



      Home
Home » Eclipse Projects » GEF » Problem in casting
Problem in casting [message #147070] Tue, 10 August 2004 06:34 Go to next message
Eclipse UserFriend
Originally posted by: p_sanghi_79.yahoo.com

Hi,

I am trying to develop an editor containing several components on the
palette that can be dragged on the canvas. I am trying to develop the same
on the lines of gef logic example. Can you please tell me the control flow
of this statement.

getHost().getParent().

present in LogicElementEditPolicy in the edit package. This statement
returns an object of LogicDiagramEditPart but in my case a similar
statement is returning ScalableFreeformRootEditPart.

Can anybody please tell me the control flow being followed here to return
LogicDiagramEditPart.

awaiting an early response

thanks and regards
Re: Problem in casting [message #147078 is a reply to message #147070] Tue, 10 August 2004 08:58 Go to previous message
Eclipse UserFriend
Originally posted by: eostroukhov.hotmail.com

getHost returns the edit part your edit policy is attached to. getParent
method of the editPart returns the edit part that has the given part as a
child. In your case you call getParent of the edit part that is the root of
your model (i.e. LogicDiagramEditPart).
To get the LogicDiagramEditPart in the uniform way you can either look in
the edit part registry (this wil isolate you from the later changes).

"Pankaj Sanghi" <p_sanghi_79@yahoo.com> wrote in message
news:cfa8bs$fup$1@eclipse.org...
> Hi,
>
> I am trying to develop an editor containing several components on the
> palette that can be dragged on the canvas. I am trying to develop the same
> on the lines of gef logic example. Can you please tell me the control flow
> of this statement.
>
> getHost().getParent().
>
> present in LogicElementEditPolicy in the edit package. This statement
> returns an object of LogicDiagramEditPart but in my case a similar
> statement is returning ScalableFreeformRootEditPart.
>
> Can anybody please tell me the control flow being followed here to return
> LogicDiagramEditPart.
>
> awaiting an early response
>
> thanks and regards
>
Previous Topic:JFace TreeViewer and EditPart
Next Topic:Simpler Example
Goto Forum:
  


Current Time: Sun May 11 14:13:42 EDT 2025

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

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

Back to the top