[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: text clipping in Label - how to prevent?

I take it that by clipped you mean the text is truncated (i.e., an ellipsis
is shown at its end since not all of it fits in available space)?  That
happens when the label is not sized to be as big as it wants to be.  I am
not sure why that is happening in your case though.

It seems you're going in a round-about way for what you want to achieve.
Maybe a simpler approach will make things easier for you.  Why don't you try
something like this?

Label flagFigure = new Label("ThisIsALongerLabel",
Images.getImage("flagpole.gif"));


"Erik Johnson" <ejohnson@xxxxxxxxx> wrote in message
news:d1qh57$cue$1@xxxxxxxxxxxxxxxxxxx
> This I think is a pretty basic question, but for some reason I cannot get
> this to work properly.
>
> I'm creating a custom Figure-based class that draws "flags".  The flag
uses
> an GIF image (Label) for the flag pole and another Label with the flag
text.
> I use a horizontal ToolbarLayout.  I have the figure working properly but
I
> cannot disable text clipping on the label.  What am I doing wrong?
>
> Code:
>  public FlagFigure() {
>   super();
>   IFigure flagPole = new Label(Images.getImage("flagpole.gif"));
>   IFigure bookmarkLabel = new Label("ThisIsALongerLabel");
>   setLayoutManager(new ToolbarLayout(true));
>   bookmarkLabel.setBorder(new MarginBorder(15, 2, 0, 0));
>   add(flagPole);
>   add(bookmarkLabel);
>  }
>
> Thanks for any help,
> Erik
>
>
>