Edit policy for child figures [message #91719] |
Fri, 29 August 2003 03:50  |
Eclipse User |
|
|
|
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 #92040 is a reply to message #91982] |
Tue, 02 September 2003 23:04   |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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. =20
Please override the following method:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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> =20
IFigure figure =3D=20
((GraphicalEditPart)getHost()).getContentPane();<BR></FONT ><B><FONT=20
color=3D#7f0055 size=3D2> 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> </DIV>
<DIV><FONT face=3DArial size=3D2>"Geoff Gibbs" <</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>> 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>> Randy Hudson =
wrote:<BR>>=20
<BR>> > Your internal contents panel is what we refer to as a =
contents=20
pane. See<BR>> > GraphicalEditPart#getContentsPane(). =
The edit=20
policies belong to the edit<BR>> > part, but operate on the =
internal=20
panel.<BR>> <BR>> 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>> 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>> <BR>> > <BR>> > "Geoff Gibbs" =
<</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>> wrote in=20
message<BR>> > </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>> > <BR>> >>I have an edit part that =
subclasses=20
AbstractGraphicalEditPart, the figure<BR>> > <BR>> > for the =
part is=20
a panel with a border layout, centred in that panel is<BR>> > =
another=20
panel where the contents of the editpart go.<BR>> > <BR>> =
>>The=20
internal frame has a FlowLayout.<BR>> >>My question is: how can =
I add=20
an edit policy to the internal panel? Are<BR>> > <BR>> > =
edit=20
policies created for edit parts, or are they created for =
figures?<BR>> >=20
<BR>> >>Thanks.<BR>> >>--<BR>> =
>>Geoff<BR>>=20
>><BR>> > <BR>> > <BR>> > <BR>> <BR>> =
<BR>> --=20
<BR>> Geoff<BR>> </FONT></BODY></HTML>
------=_NextPart_000_0029_01C3715E.7CA77680--
|
|
|
|
Powered by
FUDForum. Page generated in 0.05427 seconds