Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Label.setIconDimension deprecated?
Label.setIconDimension deprecated? [message #177700] Thu, 14 April 2005 21:16 Go to next message
Eclipse UserFriend
Originally posted by: christian.sell.netcologne.de

Hello,

after migrating to M6 I found that the method

org.eclipse.draw2d.Label.setIconDimension(Dimension d)

has been deprecated. However, I found that it was quite handy for
reserving space on labels that did not bear an icon, so that the text
would be aligned with lables that do bear an icon.
I have not found any other way to achieve this, other than providing
invisible icons as placeholders. The method does still achieve the
desired result even in M6, so why not keep it?

thanks,
christian
Re: Label.setIconDimension deprecated? [message #177718 is a reply to message #177700] Thu, 14 April 2005 21:23 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Alternate ways to do the same:
-> Use a MarginBorder (this would be the correct way)
-> Set icon-text gap

"Christian Sell" <christian.sell@netcologne.de> wrote in message
news:d3mmv0$orp$1@news.eclipse.org...
> Hello,
>
> after migrating to M6 I found that the method
>
> org.eclipse.draw2d.Label.setIconDimension(Dimension d)
>
> has been deprecated. However, I found that it was quite handy for
> reserving space on labels that did not bear an icon, so that the text
> would be aligned with lables that do bear an icon.
> I have not found any other way to achieve this, other than providing
> invisible icons as placeholders. The method does still achieve the
> desired result even in M6, so why not keep it?
>
> thanks,
> christian
Re: Label.setIconDimension deprecated? [message #177733 is a reply to message #177718] Thu, 14 April 2005 22:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: christian.sell.netcologne.de

Pratik Shah wrote:
> Alternate ways to do the same:
> -> Use a MarginBorder (this would be the correct way)
> -> Set icon-text gap

if I understand you correctly, that would mean setting the MarginBorder
(or icon/text gap) only on those labels that do not have an icon - right?
The advantage of the setIconDimension approach is that it can be applied
to all labels, irrespective of whether they have an icon or not..

>
> "Christian Sell" <christian.sell@netcologne.de> wrote in message
> news:d3mmv0$orp$1@news.eclipse.org...
>
>>Hello,
>>
>>after migrating to M6 I found that the method
>>
>>org.eclipse.draw2d.Label.setIconDimension(Dimension d)
>>
>>has been deprecated. However, I found that it was quite handy for
>>reserving space on labels that did not bear an icon, so that the text
>>would be aligned with lables that do bear an icon.
>>I have not found any other way to achieve this, other than providing
>>invisible icons as placeholders. The method does still achieve the
>>desired result even in M6, so why not keep it?
>>
>>thanks,
>>christian
>
>
>
Re: Label.setIconDimension deprecated? [message #177741 is a reply to message #177733] Thu, 14 April 2005 22:40 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
"Christian Sell" <christian.sell@netcologne.de> wrote in message
news:d3mrge$uun$1@news.eclipse.org...
> Pratik Shah wrote:
> > Alternate ways to do the same:
> > -> Use a MarginBorder (this would be the correct way)
> > -> Set icon-text gap
>
> if I understand you correctly, that would mean setting the MarginBorder
> (or icon/text gap) only on those labels that do not have an icon - right?
> The advantage of the setIconDimension approach is that it can be applied
> to all labels, irrespective of whether they have an icon or not..

Yeah, but that's a hack.

>
> >
> > "Christian Sell" <christian.sell@netcologne.de> wrote in message
> > news:d3mmv0$orp$1@news.eclipse.org...
> >
> >>Hello,
> >>
> >>after migrating to M6 I found that the method
> >>
> >>org.eclipse.draw2d.Label.setIconDimension(Dimension d)
> >>
> >>has been deprecated. However, I found that it was quite handy for
> >>reserving space on labels that did not bear an icon, so that the text
> >>would be aligned with lables that do bear an icon.
> >>I have not found any other way to achieve this, other than providing
> >>invisible icons as placeholders. The method does still achieve the
> >>desired result even in M6, so why not keep it?
> >>
> >>thanks,
> >>christian
> >
> >
> >
Re: Label.setIconDimension deprecated? [message #177974 is a reply to message #177700] Fri, 15 April 2005 20:46 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

We're trying to delete as many fields as possible. That dimension is one
such field. The behavior you are relying on is undefined. It would be
better to wrate a custom-purpose figure which has some hardcoded icon size
such as 16x16. You could do so with far less code than is in Label.
Previous Topic:GridLayer & GuideLayer
Next Topic:Horizontal layout
Goto Forum:
  


Current Time: Fri Apr 26 06:38:57 GMT 2024

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

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

Back to the top