Home » Eclipse Projects » Eclipse Platform » Re: TableView updateItem/refreshItem
Re: TableView updateItem/refreshItem [message #306575] |
Wed, 02 August 2006 06:17  |
Eclipse User |
|
|
|
Derek Morris schrieb:
> Hi,
>
> I have implemented a TableViewer. It is not that big (W35xH16) but the
> refresh when updating individual items seems quite slow. I am using
> updateItem (and tried refreshItem) when an itme needs updating, but I've
> just noticed the comment (for both):
> "This method is internal to the framework; subclassers should not call
> this method. "
>
> So:
> Q1: If these are internal, what should I be using instead?
> Q2: Any hints as to how I could improve the performance?
>
> Thanks,
> ---
> Derek
What do you mean with slow? If it's really the case please provide a
snippet we can reproduce this behaviour.
If you are using TableViewer you should not directly work with
TableItems any more but use:
Q1: tableViewer.update(modelObject,null);
Q2: tableViewer.setUseHashlookup(true);
Is really the TableViewer the culprit or maybe your LabelProvider
implementation?
Please follow up on eclipse.platform with viewer questions.
Tom
|
|
| |
Re: TableView updateItem/refreshItem [message #306577 is a reply to message #306576] |
Wed, 02 August 2006 07:28   |
Eclipse User |
|
|
|
The object provided by your IStructuredContentProvider. A viewer always
consists of 3 Compontents:
- ITableLabelProvider (ITableColorProvider,IFontColorProvider)
- IStructuredContentProvider
- Object Input Source
TableViewer v = new TableViewer(table);
v.setContentProvider(new IStructuredContentProvider() {});
v.setInput("");
The ContentProvider has a method Object[] getElements() the instances
returned inside this Array are used in all public-methods, there's no
need to directly access any TableItem, ... any more.
Tom
Derek Morris schrieb:
> Tom,
>
> Thanks for the reply. When you say
>> Q1: tableViewer.update(modelObject,null);
>
> What do you mean by the modelObject?
>
> ---
> Derek
>
> Tom Schindl wrote:
>> Derek Morris schrieb:
>>> Hi,
>>>
>>> I have implemented a TableViewer. It is not that big (W35xH16) but the
>>> refresh when updating individual items seems quite slow. I am using
>>> updateItem (and tried refreshItem) when an itme needs updating, but I've
>>> just noticed the comment (for both):
>>> "This method is internal to the framework; subclassers should not call
>>> this method. "
>>>
>>> So:
>>> Q1: If these are internal, what should I be using instead?
>>> Q2: Any hints as to how I could improve the performance?
>>>
>>> Thanks,
>>> ---
>>> Derek
>>
>> What do you mean with slow? If it's really the case please provide a
>> snippet we can reproduce this behaviour.
>>
>> If you are using TableViewer you should not directly work with
>> TableItems any more but use:
>>
>> Q1: tableViewer.update(modelObject,null);
>> Q2: tableViewer.setUseHashlookup(true);
>>
>>
>> Is really the TableViewer the culprit or maybe your LabelProvider
>> implementation?
>>
>> Please follow up on eclipse.platform with viewer questions.
>>
>> Tom
|
|
|
Re: TableView updateItem/refreshItem [message #306583 is a reply to message #306577] |
Wed, 02 August 2006 09:28   |
Eclipse User |
|
|
|
Originally posted by: dmsubs.NOSPAM.consertum.com
Tom,
Thanks for the explanation - it was just your reference to modelObject
that confused me.
I've now implemented what you have said, and I now seem to be
perpetually refreshing.
doUpdateItem in my (subclassed) TableViewer is being called repeatedly.
Looking back through the stack, it is because my labelProvider is
calling update(modelObject, null)...
Any thoughts?
Thanks,
---
Derek
Tom Schindl wrote:
> The object provided by your IStructuredContentProvider. A viewer always
> consists of 3 Compontents:
>
> - ITableLabelProvider (ITableColorProvider,IFontColorProvider)
> - IStructuredContentProvider
> - Object Input Source
>
>
> TableViewer v = new TableViewer(table);
> v.setContentProvider(new IStructuredContentProvider() {});
> v.setInput("");
>
>
> The ContentProvider has a method Object[] getElements() the instances
> returned inside this Array are used in all public-methods, there's no
> need to directly access any TableItem, ... any more.
>
> Tom
>
> Derek Morris schrieb:
>> Tom,
>>
>> Thanks for the reply. When you say
>>> Q1: tableViewer.update(modelObject,null);
>> What do you mean by the modelObject?
>>
>> ---
>> Derek
>>
>> Tom Schindl wrote:
>>> Derek Morris schrieb:
>>>> Hi,
>>>>
>>>> I have implemented a TableViewer. It is not that big (W35xH16) but the
>>>> refresh when updating individual items seems quite slow. I am using
>>>> updateItem (and tried refreshItem) when an itme needs updating, but I've
>>>> just noticed the comment (for both):
>>>> "This method is internal to the framework; subclassers should not call
>>>> this method. "
>>>>
>>>> So:
>>>> Q1: If these are internal, what should I be using instead?
>>>> Q2: Any hints as to how I could improve the performance?
>>>>
>>>> Thanks,
>>>> ---
>>>> Derek
>>> What do you mean with slow? If it's really the case please provide a
>>> snippet we can reproduce this behaviour.
>>>
>>> If you are using TableViewer you should not directly work with
>>> TableItems any more but use:
>>>
>>> Q1: tableViewer.update(modelObject,null);
>>> Q2: tableViewer.setUseHashlookup(true);
>>>
>>>
>>> Is really the TableViewer the culprit or maybe your LabelProvider
>>> implementation?
>>>
>>> Please follow up on eclipse.platform with viewer questions.
>>>
>>> Tom
|
|
|
Re: TableView updateItem/refreshItem [message #306587 is a reply to message #306577] |
Wed, 02 August 2006 09:42   |
Eclipse User |
|
|
|
Originally posted by: dmsubs.NOSPAM.consertum.com
Tom,
Thanks for the explanation - it was just your reference to modelObject
that confused me.
I've now implemented what you have said, and I now seem to be
perpetually refreshing.
doUpdateItem in my (subclassed) TableViewer is being called repeatedly.
Looking back through the stack, it is because my labelProvider is
calling update(modelObject, null)...
Any thoughts?
Thanks,
---
Derek
Tom Schindl wrote:
> The object provided by your IStructuredContentProvider. A viewer always
> consists of 3 Compontents:
>
> - ITableLabelProvider (ITableColorProvider,IFontColorProvider)
> - IStructuredContentProvider
> - Object Input Source
>
>
> TableViewer v = new TableViewer(table);
> v.setContentProvider(new IStructuredContentProvider() {});
> v.setInput("");
>
>
> The ContentProvider has a method Object[] getElements() the instances
> returned inside this Array are used in all public-methods, there's no
> need to directly access any TableItem, ... any more.
>
> Tom
>
> Derek Morris schrieb:
>> Tom,
>>
>> Thanks for the reply. When you say
>>> Q1: tableViewer.update(modelObject,null);
>> What do you mean by the modelObject?
>>
>> ---
>> Derek
>>
>> Tom Schindl wrote:
>>> Derek Morris schrieb:
>>>> Hi,
>>>>
>>>> I have implemented a TableViewer. It is not that big (W35xH16) but the
>>>> refresh when updating individual items seems quite slow. I am using
>>>> updateItem (and tried refreshItem) when an itme needs updating, but I've
>>>> just noticed the comment (for both):
>>>> "This method is internal to the framework; subclassers should not call
>>>> this method. "
>>>>
>>>> So:
>>>> Q1: If these are internal, what should I be using instead?
>>>> Q2: Any hints as to how I could improve the performance?
>>>>
>>>> Thanks,
>>>> ---
>>>> Derek
>>> What do you mean with slow? If it's really the case please provide a
>>> snippet we can reproduce this behaviour.
>>>
>>> If you are using TableViewer you should not directly work with
>>> TableItems any more but use:
>>>
>>> Q1: tableViewer.update(modelObject,null);
>>> Q2: tableViewer.setUseHashlookup(true);
>>>
>>>
>>> Is really the TableViewer the culprit or maybe your LabelProvider
>>> implementation?
>>>
>>> Please follow up on eclipse.platform with viewer questions.
>>>
>>> Tom
|
|
| |
Re: TableView updateItem/refreshItem [message #306592 is a reply to message #306588] |
Wed, 02 August 2006 10:37  |
Eclipse User |
|
|
|
Originally posted by: dmsubs.NOSPAM.consertum.com
Aaaaahhhhhh. Got it. I understand now.
Thanks for your help.
---
Derek
Tom Schindl wrote:
> Derek Morris schrieb:
>> Tom,
>>
>> Thanks for the explanation - it was just your reference to modelObject
>> that confused me.
>>
>> I've now implemented what you have said, and I now seem to be
>> perpetually refreshing.
>>
>> doUpdateItem in my (subclassed) TableViewer is being called repeatedly.
>> Looking back through the stack, it is because my labelProvider is
>> calling update(modelObject, null)...
>>
>> Any thoughts?
>>
>> Thanks,
>>
>
> No no.
>
> 1. Why do you need to subclass TableViewer
> 2. Why does your LabelProvider call update => This way you get into a
> cycle. Because TableViewer.update() results finally in a call to
> LableProvider.getColumnText().
>
> There should never by a need to SubClass-TableViewer to overwrite
> methods except you really know what you are doing.
>
> Normally you call tableViewer.update(modelObject,null) because some code
> has modified attributes of your modelObject. The LabelProvider's
> responsiblity is only to convert the modelObject is something
> displayable by the Table (Text/Image/Color/Font).
>
> Please describe to me what's your usecase or provide a minimal
> codesnippet I can run out of the box to help you.
>
> Tom
|
|
|
Goto Forum:
Current Time: Wed May 07 15:53:21 EDT 2025
Powered by FUDForum. Page generated in 0.03662 seconds
|