Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » The usage of function setItemMetrics() in Table.js
The usage of function setItemMetrics() in Table.js [message #512829] Mon, 08 February 2010 06:43 Go to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Hello all experts:

I found a javascript function in Table.js which is named as setItemMetrics but could not find any reference to it.

I am now facing a problem probably caused by the usage of this method and hope to get some suggestion...

I have two images with different sizes(100x16 & 16x16) in cells of two different columns.when the table is shown, the image area of the small one is set as wide as the bigger one which means the AREA(but not the image itself) of the 16x16 sized image is enlarged to 100x16. I tracked this problem down and found that the only entry to image width modification was the setItemMetircs function but now am blocked cos I just can't find out by which class this function is called.

Could you please lend me a hand?

As you might have known, my RAP version is 1.2:)

Thx and Best Regards!

Tingel Christian.

[Updated on: Mon, 08 February 2010 06:48]

Report message to a moderator

Re: The usage of function setItemMetrics() in Table.js [message #512879 is a reply to message #512829] Mon, 08 February 2010 04:42 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Tingel,

the Table.js#setItemMetrics is called from the server side - see
TableLCAUtil#writeItemMetrics(Table).

HTH,
Ivan

On 2/8/2010 8:43 AM, tingel christian wrote:
> Hello all experts:
>
> I found a javascript function in Table.js which is named as
> setItemMetrics but could not find any reference to it.
>
> I am now facing a problem probably caused by the usage of this method
> and hope to get some suggestion...
>
> I have two images with different sizes(100x16 & 16x16) in cells of two
> different columns.when the table is shown, the image area of the small
> one is set as wide as the bigger one which means the AREA(but not the
> image itself) of the 16x16 sized image is enlarged to 100x16. I
> tracked this problem down and found that the only entry to image width
> modification was the setItemMetircs function but now am blocked cos I
> just can't find out by which class this function is called.
>
> Could you please lend me a hand?
>
> Thx and Best Regards!
>
> Tingel Christian.
Re: The usage of function setItemMetrics() in Table.js [message #512946 is a reply to message #512879] Mon, 08 February 2010 12:20 Go to previous messageGo to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
C U again, Ivan, and thanks a lot:)

I followed your direction and finally found the root cause of the problem who lies in the following code:

Table#getItemImageSize():
final Point getItemImageSize() {
return itemImageSize == null ? new Point( 0, 0 ) : itemImageSize;
}

This means that all images in a table can and can only occupy an equally-sized image area.

Don't you think that allowing all images in a table have their own image area would be better?

Thanks and Best Regards!

Tingel Christian

Ivan Furnadjiev wrote on Sun, 07 February 2010 23:42
Hi Tingel,

the Table.js#setItemMetrics is called from the server side - see
TableLCAUtil#writeItemMetrics(Table).

HTH,
Ivan

On 2/8/2010 8:43 AM, tingel christian wrote:
> Hello all experts:
>
> I found a javascript function in Table.js which is named as
> setItemMetrics but could not find any reference to it.
>
> I am now facing a problem probably caused by the usage of this method
> and hope to get some suggestion...
>
> I have two images with different sizes(100x16 & 16x16) in cells of two
> different columns.when the table is shown, the image area of the small
> one is set as wide as the bigger one which means the AREA(but not the
> image itself) of the 16x16 sized image is enlarged to 100x16. I
> tracked this problem down and found that the only entry to image width
> modification was the setItemMetircs function but now am blocked cos I
> just can't find out by which class this function is called.
>
> Could you please lend me a hand?
>
> Thx and Best Regards!
>
> Tingel Christian.

Re: The usage of function setItemMetrics() in Table.js [message #513099 is a reply to message #512946] Mon, 08 February 2010 20:15 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Tingel,

does SWT support different image sizes? If yes, please file an
enhancement request.

Best,
Ivan

On 2/8/2010 2:20 PM, tingel christian wrote:
> C U again, Ivan, and thanks a lot:)
>
> I followed your direction and finally found the root cause of the
> problem who lies in the following code:
>
> Table#getItemImageSize():
> final Point getItemImageSize() {
> return itemImageSize == null ? new Point( 0, 0 ) : itemImageSize;
> }
>
> This means that all images in a table can and can only occupy an
> equally-sized image area.
>
> Don't you think that allowing all images in a table have their own
> image area would be better?
>
> Thanks and Best Regards!
>
> Tingel Christian
>
> Ivan Furnadjiev wrote on Sun, 07 February 2010 23:42
>> Hi Tingel,
>>
>> the Table.js#setItemMetrics is called from the server side - see
>> TableLCAUtil#writeItemMetrics(Table).
>>
>> HTH,
>> Ivan
>>
>> On 2/8/2010 8:43 AM, tingel christian wrote:
>> > Hello all experts:
>> >
>> > I found a javascript function in Table.js which is named as >
>> setItemMetrics but could not find any reference to it.
>> >
>> > I am now facing a problem probably caused by the usage of this
>> method > and hope to get some suggestion...
>> >
>> > I have two images with different sizes(100x16 & 16x16) in cells of
>> two > different columns.when the table is shown, the image area of
>> the small > one is set as wide as the bigger one which means the
>> AREA(but not the > image itself) of the 16x16 sized image is enlarged
>> to 100x16. I > tracked this problem down and found that the only
>> entry to image width > modification was the setItemMetircs function
>> but now am blocked cos I > just can't find out by which class this
>> function is called.
>> >
>> > Could you please lend me a hand?
>> >
>> > Thx and Best Regards!
>> >
>> > Tingel Christian.
>
>
Re: The usage of function setItemMetrics() in Table.js [message #513142 is a reply to message #513099] Tue, 09 February 2010 03:22 Go to previous messageGo to next message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Hi Ivan:

Unfortunately, SWT does not support this function either, but honestly I don't think this is a proper specification cos you know it's really a big constrain for developers who are always facing this and that kinds of requirement and you can hardly require them all not to use images with different size in different columns, right?

So if you don't mind, I wish the RAP/RCP team could have a little bit consideration about the specification -- RAP/RCP do support different sized images in tableviewer, but to use it or not, it's up to the user.

Any way, I am a big fan of RCP/RAP who wishes them getting better and better and I hope you wouldn't regard me as a trouble maker~~~ Smile

Thanks a lot and Best Regards!

Tingel Christian
Re: The usage of function setItemMetrics() in Table.js [message #513185 is a reply to message #513142] Tue, 09 February 2010 09:31 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Christian,

this issue has been discussed before. The least common denominator here
is Windows [1] (see there for a workaround).
I am sorry to say, but we are currently not considering to implement
this for two reasons. The compatibility to SWT and the fact that it is a
considerable amount of work to implement.

Regards,
Rüdiger

[1] 55380: Issue with TableItem.setImage() under Windows and multiple
columns
https://bugs.eclipse.org/bugs/show_bug.cgi?id=55380

On 09.02.2010 04:22, tingel christian wrote:
> Hi Ivan:
>
> Unfortunately, SWT does not support this function either, but honestly I
> don't think this is a proper specification cos you know it's really a
> big constrain for developers who are always facing this and that kinds
> of requirement and you can hardly require them all not to use images
> with different size in different columns, right?
>
> So if you don't mind, I wish the RAP/RCP team could have a little bit
> consideration about the specification -- RAP/RCP do support different
> sized images in tableviewer, but to use it or not, it's up to the user.
>
> Any way, I am a big fan of RCP/RAP who wishes them getting better and
> better and I hope you wouldn't regard me as a trouble maker~~~ :)
> Thanks a lot and Best Regards!
>
> Tingel Christian
Re: The usage of function setItemMetrics() in Table.js [message #513404 is a reply to message #513185] Wed, 10 February 2010 04:13 Go to previous message
tingel christian is currently offline tingel christianFriend
Messages: 46
Registered: December 2009
Member
Wakatta.

Thanks Rüdiger.But I have to say...It's really sad news. Sad

Best Regards

Tingel Christian

Rüdiger Herrmann wrote on Tue, 09 February 2010 04:31
Christian,

this issue has been discussed before. The least common denominator here
is Windows [1] (see there for a workaround).
I am sorry to say, but we are currently not considering to implement
this for two reasons. The compatibility to SWT and the fact that it is a
considerable amount of work to implement.

Regards,
Rüdiger

[1] 55380: Issue with TableItem.setImage() under Windows and multiple
columns
https://bugs.eclipse.org/bugs/show_bug.cgi?id=55380

On 09.02.2010 04:22, tingel christian wrote:
> Hi Ivan:
>
> Unfortunately, SWT does not support this function either, but honestly I
> don't think this is a proper specification cos you know it's really a
> big constrain for developers who are always facing this and that kinds
> of requirement and you can hardly require them all not to use images
> with different size in different columns, right?
>
> So if you don't mind, I wish the RAP/RCP team could have a little bit
> consideration about the specification -- RAP/RCP do support different
> sized images in tableviewer, but to use it or not, it's up to the user.
>
> Any way, I am a big fan of RCP/RAP who wishes them getting better and
> better and I hope you wouldn't regard me as a trouble maker~~~ Smile
> Thanks a lot and Best Regards!
>
> Tingel Christian

Previous Topic:[Dialog] L&F 1.3M5
Next Topic:Loading ICO images
Goto Forum:
  


Current Time: Thu Apr 25 14:57:21 GMT 2024

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

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

Back to the top