Skip to main content



      Home
Home » Eclipse Projects » GEF » Edit policy for child figures
Edit policy for child figures [message #91719] Fri, 29 August 2003 03:50 Go to next message
Eclipse UserFriend
Originally posted by: gg.decisionsoft.co.uk

I have an edit part that subclasses AbstractGraphicalEditPart, the figure for the part is a panel with a border layout, centred in that panel is another panel where the contents of the editpart go.
The internal frame has a FlowLayout.
My question is: how can I add an edit policy to the internal panel? Are edit policies created for edit parts, or are they created for figures?

Thanks.
--
Geoff
Re: Edit policy for child figures [message #91982 is a reply to message #91719] Mon, 01 September 2003 19:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Your internal contents panel is what we refer to as a contents pane. See
GraphicalEditPart#getContentsPane(). The edit policies belong to the edit
part, but operate on the internal panel.

"Geoff Gibbs" <gg@decisionsoft.co.uk> wrote in message
news:bin0b8$46d$1@eclipse.org...
> I have an edit part that subclasses AbstractGraphicalEditPart, the figure
for the part is a panel with a border layout, centred in that panel is
another panel where the contents of the editpart go.
> The internal frame has a FlowLayout.
> My question is: how can I add an edit policy to the internal panel? Are
edit policies created for edit parts, or are they created for figures?
>
> Thanks.
> --
> Geoff
>
Re: Edit policy for child figures [message #92040 is a reply to message #91982] Tue, 02 September 2003 23:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: gg.decisionsoft.co.uk

Randy Hudson wrote:

> Your internal contents panel is what we refer to as a contents pane. See
> GraphicalEditPart#getContentsPane(). The edit policies belong to the edit
> part, but operate on the internal panel.

I now have my contents panel returned as the contents pane, which makes the adding of children neater, but the edit policy is still operating on the main figure, not the contents pane.
Currently I am using the part's installEditPolicy() to add a FlowLayoutEditPolicy, but I get a class cast exception when I attempt the drag as the main figure's layout is a border layout, it is the contents pane that has the FlowLayout and the children I wish to drag.

>
> "Geoff Gibbs" <gg@decisionsoft.co.uk> wrote in message
> news:bin0b8$46d$1@eclipse.org...
>
>>I have an edit part that subclasses AbstractGraphicalEditPart, the figure
>
> for the part is a panel with a border layout, centred in that panel is
> another panel where the contents of the editpart go.
>
>>The internal frame has a FlowLayout.
>>My question is: how can I add an edit policy to the internal panel? Are
>
> edit policies created for edit parts, or are they created for figures?
>
>>Thanks.
>>--
>>Geoff
>>
>
>
>


--
Geoff
Re: Edit policy for child figures [message #92100 is a reply to message #92040] Tue, 02 September 2003 14:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a multi-part message in MIME format.

------=_NextPart_000_0029_01C3715E.7CA77680
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

There is a bug in FlowLayoutEditPolicy. Please override the following =
method:

protected boolean isHorizontal() {
IFigure figure =3D ((GraphicalEditPart)getHost()).getContentPane();
return ((FlowLayout)figure.getLayoutManager()).isHorizontal();
}

Opened: https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D42406


"Geoff Gibbs" <gg@decisionsoft.co.uk> wrote in message =
news:bj2bh6$17s$1@eclipse.org...
> Randy Hudson wrote:
>=20
> > Your internal contents panel is what we refer to as a contents pane. =
See
> > GraphicalEditPart#getContentsPane(). The edit policies belong to =
the edit
> > part, but operate on the internal panel.
>=20
> I now have my contents panel returned as the contents pane, which =
makes the adding of children neater, but the edit policy is still =
operating on the main figure, not the contents pane.
> Currently I am using the part's installEditPolicy() to add a =
FlowLayoutEditPolicy, but I get a class cast exception when I attempt =
the drag as the main figure's layout is a border layout, it is the =
contents pane that has the FlowLayout and the children I wish to drag.
>=20
> >=20
> > "Geoff Gibbs" <gg@decisionsoft.co.uk> wrote in message
> > news:bin0b8$46d$1@eclipse.org...
> >=20
> >>I have an edit part that subclasses AbstractGraphicalEditPart, the =
figure
> >=20
> > for the part is a panel with a border layout, centred in that panel =
is
> > another panel where the contents of the editpart go.
> >=20
> >>The internal frame has a FlowLayout.
> >>My question is: how can I add an edit policy to the internal panel? =
Are
> >=20
> > edit policies created for edit parts, or are they created for =
figures?
> >=20
> >>Thanks.
> >>--
> >>Geoff
> >>
> >=20
> >=20
> >=20
>=20
>=20
> --=20
> Geoff
>=20

------=_NextPart_000_0029_01C3715E.7CA77680
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2726.2500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>There is a bug in =
FlowLayoutEditPolicy.&nbsp;=20
Please override the following method:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT><B><FONT color=3D#7f0055 =
size=3D2>
<P>protected</B></FONT><FONT size=3D2> </FONT><B><FONT color=3D#7f0055=20
size=3D2>boolean</B></FONT><FONT size=3D2> isHorizontal() =
{<BR>&nbsp;&nbsp;&nbsp;=20
IFigure figure =3D=20
((GraphicalEditPart)getHost()).getContentPane();<BR></FONT ><B><FONT=20
color=3D#7f0055 size=3D2>&nbsp;&nbsp;&nbsp; return</B></FONT><FONT =
size=3D2>=20
((FlowLayout)figure.getLayoutManager()).isHorizontal();<BR>} </FONT></P>
<P><FONT size=3D2>Opened: </FONT><FONT face=3DArial size=3D2><A=20
href=3D"https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D42406">https://bu=
gs.eclipse.org/bugs/show_bug.cgi?id=3D42406</A></FONT></P ></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Geoff Gibbs" &lt;</FONT><A=20
href=3D"mailto:gg@decisionsoft.co.uk"><FONT face=3DArial=20
size=3D2>gg@decisionsoft.co.uk</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:bj2bh6$17s$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:bj2bh6$17s$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Randy Hudson =
wrote:<BR>&gt;=20
<BR>&gt; &gt; Your internal contents panel is what we refer to as a =
contents=20
pane.&nbsp; See<BR>&gt; &gt; GraphicalEditPart#getContentsPane().&nbsp; =
The edit=20
policies belong to the edit<BR>&gt; &gt; part, but operate on the =
internal=20
panel.<BR>&gt; <BR>&gt; I now have my contents panel returned as the =
contents=20
pane, which makes the adding of children neater, but the edit policy is =
still=20
operating on the main figure, not the contents pane.<BR>&gt; Currently I =
am=20
using the part's installEditPolicy() to add a FlowLayoutEditPolicy, but =
I get a=20
class cast exception when I attempt the drag as the main figure's layout =
is a=20
border layout, it is the contents pane that has the FlowLayout and the =
children=20
I wish to drag.<BR>&gt; <BR>&gt; &gt; <BR>&gt; &gt; "Geoff Gibbs" =
&lt;</FONT><A=20
href=3D"mailto:gg@decisionsoft.co.uk"><FONT face=3DArial=20
size=3D2>gg@decisionsoft.co.uk</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message<BR>&gt; &gt; </FONT><A =
href=3D"news:bin0b8$46d$1@eclipse.org"><FONT=20
face=3DArial size=3D2>news:bin0b8$46d$1@eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...<BR>&gt; &gt; <BR>&gt; &gt;&gt;I have an edit part that =
subclasses=20
AbstractGraphicalEditPart, the figure<BR>&gt; &gt; <BR>&gt; &gt; for the =
part is=20
a panel with a border layout, centred in that panel is<BR>&gt; &gt; =
another=20
panel where the contents of the editpart go.<BR>&gt; &gt; <BR>&gt; =
&gt;&gt;The=20
internal frame has a FlowLayout.<BR>&gt; &gt;&gt;My question is: how can =
I add=20
an edit policy to the internal panel? Are<BR>&gt; &gt; <BR>&gt; &gt; =
edit=20
policies created for edit parts, or are they created for =
figures?<BR>&gt; &gt;=20
<BR>&gt; &gt;&gt;Thanks.<BR>&gt; &gt;&gt;--<BR>&gt; =
&gt;&gt;Geoff<BR>&gt;=20
&gt;&gt;<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; <BR>&gt; =
<BR>&gt; --=20
<BR>&gt; Geoff<BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_0029_01C3715E.7CA77680--
Re: Edit policy for child figures [message #92163 is a reply to message #92100] Wed, 03 September 2003 15:56 Go to previous message
Eclipse UserFriend
Originally posted by: gg.decisionsoft.co.uk

> There is a bug in FlowLayoutEditPolicy. Please override the following
> method:
>
>
> protected boolean isHorizontal() {
> IFigure figure = ((GraphicalEditPart)getHost()).getContentPane();
> return ((FlowLayout)figure.getLayoutManager()).isHorizontal();
> }
>
> Opened: https://bugs.eclipse.org/bugs/show_bug.cgi?id=42406

That fixed it!
Thanks!

--
Geoff
Previous Topic:JBuilder to Eclipse Migration
Next Topic:compare files in Eclipse
Goto Forum:
  


Current Time: Thu May 08 06:16:46 EDT 2025

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

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

Back to the top