Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Dynamically resizing label
Dynamically resizing label [message #158720] Fri, 19 November 2004 14:37 Go to next message
Eclipse UserFriend
Originally posted by: pavan.podila.gmail.com

Hi,
I am trying to use inline-editing for a label, similar to the
LogicLabelEditPart of the logic example. One problem I am facing is when
I type in text, the cell editor is not resizing dynamically. I have
looked at the logic code and it's not doing anything special for
resizing the celleditor. Can someone point out what's going wrong here.
Also when I press enter, the label is not resizing itself based on the
new text entered.


Looking forward,
Pavan
Re: Dynamically resizing label [message #158790 is a reply to message #158720] Fri, 19 November 2004 17:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Pavan Podila" <pavan.podila@gmail.com> wrote in message
news:cnl0et$nm2$1@www.eclipse.org...
> Hi,
> I am trying to use inline-editing for a label, similar to the
> LogicLabelEditPart of the logic example. One problem I am facing is when
> I type in text, the cell editor is not resizing dynamically. I have

Are you showing direct edit feedback? The logic editor does this.

> looked at the logic code and it's not doing anything special for
> resizing the celleditor. Can someone point out what's going wrong here.
> Also when I press enter, the label is not resizing itself based on the
> new text entered.

Does it get the new text?

It sounds like your width is set to a specific size instead of -1.

>
>
> Looking forward,
> Pavan
Re: Dynamically resizing label [message #158868 is a reply to message #158790] Fri, 19 November 2004 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pavan.podila.gmail.com

This is a multi-part message in MIME format.
--------------080107080307000300050002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Randy,
Can you point me to the code where the LogicLabel shows the
direct-edit feedback. You are right when you said that a specific width
is being set. I tried giving -1 to the width/height of my figure, but
was not having any effect. I am pasting the code that constructs my
figure. How do I set my width/height to -1 to get the automatic resizing
effect.

private void construct()
{
FlowPage flowPage = new FlowPage();
flowPage.setHorizontalAligment(PositionConstants.CENTER);
textFlow = new TextFlow();
textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
ParagraphTextLayout.WORD_WRAP_SOFT));
flowPage.add(textFlow);
flowPage.setConstraint(textFlow, new Rectangle(-1, -1, 5, 5));

setLayoutManager(new FlowLayout());
add(flowPage);
setOpaque(true);
setBorder(new LineBorder());
}

Do get back soon.


Randy Hudson wrote:

>"Pavan Podila" <pavan.podila@gmail.com> wrote in message
>news:cnl0et$nm2$1@www.eclipse.org...
>
>
>>Hi,
>> I am trying to use inline-editing for a label, similar to the
>>LogicLabelEditPart of the logic example. One problem I am facing is when
>>I type in text, the cell editor is not resizing dynamically. I have
>>
>>
>
>Are you showing direct edit feedback? The logic editor does this.
>
>
>
>>looked at the logic code and it's not doing anything special for
>>resizing the celleditor. Can someone point out what's going wrong here.
>>Also when I press enter, the label is not resizing itself based on the
>>new text entered.
>>
>>
>
>Does it get the new text?
>
>It sounds like your width is set to a specific size instead of -1.
>
>
>
>>Looking forward,
>>Pavan
>>
>>
>
>
>
>

--------------080107080307000300050002
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>Hi Randy,<br>
&nbsp;&nbsp;&nbsp; Can you point me to the code where the LogicLabel shows the
direct-edit feedback. You are right when you said that a specific width
is being set. I tried giving -1 to the width/height of my figure, but
was not having any effect. I am pasting the code that constructs my
figure. How do I set my width/height to -1 to get the automatic
resizing effect.<br>
<br>
&nbsp;&nbsp;&nbsp; private void construct()<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FlowPage flowPage = new FlowPage();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; flowPage.setHorizontalAligment(PositionConstants.CENTER);<br >
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; textFlow = new TextFlow();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ParagraphTextLayout.WORD_WRAP_SOFT));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; flowPage.add(textFlow);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; flowPage.setConstraint(textFlow, new Rectangle(-1, -1, 5, 5));<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; setLayoutManager(new FlowLayout());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; add(flowPage);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; setOpaque(true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; setBorder(new LineBorder());<br>
&nbsp;&nbsp;&nbsp; }<br>
<br>
Do get back soon.<br>
<br>
</tt><br>
Randy Hudson wrote:
<blockquote cite="midcnlc6i$htn$1@www.eclipse.org" type="cite">
<pre wrap="">"Pavan Podila" <a class="moz-txt-link-rfc2396E" href="mailto:pavan.podila@gmail.com">&lt;pavan.podila@gmail.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:cnl0et$nm2$1@www.eclipse.org">news:cnl0et$nm2$1@www.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I am trying to use inline-editing for a label, similar to the
LogicLabelEditPart of the logic example. One problem I am facing is when
I type in text, the cell editor is not resizing dynamically. I have
</pre>
</blockquote>
<pre wrap=""><!---->
Are you showing direct edit feedback? The logic editor does this.

</pre>
<blockquote type="cite">
<pre wrap="">looked at the logic code and it's not doing anything special for
resizing the celleditor. Can someone point out what's going wrong here.
Also when I press enter, the label is not resizing itself based on the
new text entered.
</pre>
</blockquote>
<pre wrap=""><!---->
Does it get the new text?

It sounds like your width is set to a specific size instead of -1.

</pre>
<blockquote type="cite">
<pre wrap="">
Looking forward,
Pavan
</pre>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>

--------------080107080307000300050002--
Re: Dynamically resizing label [message #159246 is a reply to message #158868] Tue, 23 November 2004 16:37 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a multi-part message in MIME format.

------=_NextPart_000_017D_01C4D150.D1A46FA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

See DirectEditPolicy and subclasses
"Pavan Podila" <pavan.podila@gmail.com> wrote in message =
news:419E470C.2010705@gmail.com...
Hi Randy,
Can you point me to the code where the LogicLabel shows the =
direct-edit feedback. You are right when you said that a specific width =
is being set. I tried giving -1 to the width/height of my figure, but =
was not having any effect. I am pasting the code that constructs my =
figure. How do I set my width/height to -1 to get the automatic resizing =
effect.

private void construct()
{
FlowPage flowPage =3D new FlowPage();
flowPage.setHorizontalAligment(PositionConstants.CENTER);
textFlow =3D new TextFlow();
textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
ParagraphTextLayout.WORD_WRAP_SOFT));
flowPage.add(textFlow);
flowPage.setConstraint(textFlow, new Rectangle(-1, -1, 5, 5));

setLayoutManager(new FlowLayout());
add(flowPage);
setOpaque(true);
setBorder(new LineBorder());
}

Do get back soon.


Randy Hudson wrote:=20
"Pavan Podila" <pavan.podila@gmail.com> wrote in message
news:cnl0et$nm2$1@www.eclipse.org...
Hi,
I am trying to use inline-editing for a label, similar to the
LogicLabelEditPart of the logic example. One problem I am facing is when
I type in text, the cell editor is not resizing dynamically. I have
=20
Are you showing direct edit feedback? The logic editor does this.

looked at the logic code and it's not doing anything special for
resizing the celleditor. Can someone point out what's going wrong here.
Also when I press enter, the label is not resizing itself based on the
new text entered.
=20
Does it get the new text?

It sounds like your width is set to a specific size instead of -1.

Looking forward,
Pavan
=20


------=_NextPart_000_017D_01C4D150.D1A46FA0
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=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>See DirectEditPolicy and =
subclasses</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Pavan Podila" &lt;<A=20
href=3D"mailto:pavan.podila@gmail.com">pavan.podila@gmail.com</A>&gt; =
wrote in=20
message <A=20
=
href=3D"news:419E470C.2010705@gmail.com">news:419E470C.2010705@gmail.com<=
/A>...</DIV><TT>Hi=20
Randy,<BR>&nbsp;&nbsp;&nbsp; Can you point me to the code where the =
LogicLabel=20
shows the direct-edit feedback. You are right when you said that a =
specific=20
width is being set. I tried giving -1 to the width/height of my =
figure, but=20
was not having any effect. I am pasting the code that constructs my =
figure.=20
How do I set my width/height to -1 to get the automatic resizing=20
effect.<BR><BR>&nbsp;&nbsp;&nbsp; private void=20
construct()<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
FlowPage flowPage =3D new FlowPage();<BR>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
=
flowPage.setHorizontalAligment(PositionConstants.CENTER);<BR >&nbsp;&nbsp;=
&nbsp;=20
&nbsp;&nbsp;&nbsp; textFlow =3D new TextFlow();<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; textFlow.setLayoutManager(new=20
ParagraphTextLayout(textFlow,<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
ParagraphTextLayout.WORD_WRAP_SOFT));<BR>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
flowPage.add(textFlow);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
flowPage.setConstraint(textFlow, new Rectangle(-1, -1, 5,=20
5));<BR><BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; setLayoutManager(new =

FlowLayout());<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
add(flowPage);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
setOpaque(true);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
setBorder(new=20
LineBorder());<BR>&nbsp;&nbsp;&nbsp; }<BR><BR>Do get back=20
soon.<BR><BR></TT><BR>Randy Hudson wrote:=20
<BLOCKQUOTE cite=3Dmidcnlc6i$htn$1@www.eclipse.org type=3D"cite"><PRE =
wrap=3D"">"Pavan Podila" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:pavan.podila@gmail.com">&lt;pavan.podila@gmail.com&gt;</A>=
wrote in message
<A class=3Dmoz-txt-link-freetext =
href=3D"news:cnl0et$nm2$1@www.eclipse.org">news:cnl0et$nm2$1@www.eclipse.=
org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hi,
I am trying to use inline-editing for a label, similar to the
LogicLabelEditPart of the logic example. One problem I am facing is when
I type in text, the cell editor is not resizing dynamically. I have
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->
Are you showing direct edit feedback? The logic editor does this.

</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">looked at the logic code =
and it's not doing anything special for
resizing the celleditor. Can someone point out what's going wrong here.
Also when I press enter, the label is not resizing itself based on the
new text entered.
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->
Does it get the new text?

It sounds like your width is set to a specific size instead of -1.

</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Looking forward,
Pavan
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->

</PRE></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_017D_01C4D150.D1A46FA0--
Previous Topic:How to implement Part's Property changes as a Command
Next Topic:gef plugin requirements
Goto Forum:
  


Current Time: Thu Mar 28 21:40:00 GMT 2024

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

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

Back to the top