Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » TableViewer refresh
TableViewer refresh [message #325476] Tue, 19 February 2008 11:56 Go to next message
Eclipse UserFriend
Hello,

my TableViewer doesn't refresh. I have a table with buttons and i want
to dynamically change the length of the rows and the columns. After i
change this i call the function
createPartControl(getViewSite().getShell()); in this function i call
viewer.refresh() at the end. But it doesn't change only if i close the
view and open it again. Can somebody help me?

Greetings
Re: TableViewer refresh [message #325477 is a reply to message #325476] Tue, 19 February 2008 12:01 Go to previous messageGo to next message
Eclipse UserFriend
You should never call createPartControl(getViewSite().getShell())
yourself, this doesn't work (like you already discovered).

What do you mean by changing the length of the rows and columns? Do you
want to change (height of a row, the width of column) or do you want to
add/remove rows/columns because your model changes?

Tom

Jörg schrieb:
> Hello,
>
> my TableViewer doesn't refresh. I have a table with buttons and i want
> to dynamically change the length of the rows and the columns. After i
> change this i call the function
> createPartControl(getViewSite().getShell()); in this function i call
> viewer.refresh() at the end. But it doesn't change only if i close the
> view and open it again. Can somebody help me?
>
> Greetings


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: TableViewer refresh [message #325480 is a reply to message #325477] Tue, 19 February 2008 12:08 Go to previous messageGo to next message
Eclipse UserFriend
thanks for your quick answer. i want to change length of the rows and
columns. can you explain me why i should never call
createPartControl(getViewSite().getShell()) by myself?

Jörg

Tom Schindl schrieb:
> You should never call createPartControl(getViewSite().getShell())
> yourself, this doesn't work (like you already discovered).
>
> What do you mean by changing the length of the rows and columns? Do you
> want to change (height of a row, the width of column) or do you want to
> add/remove rows/columns because your model changes?
>
> Tom
>
> Jörg schrieb:
>> Hello,
>>
>> my TableViewer doesn't refresh. I have a table with buttons and i want
>> to dynamically change the length of the rows and the columns. After i
>> change this i call the function
>> createPartControl(getViewSite().getShell()); in this function i call
>> viewer.refresh() at the end. But it doesn't change only if i close the
>> view and open it again. Can somebody help me?
>>
>> Greetings
>
>
Re: TableViewer refresh [message #325481 is a reply to message #325480] Tue, 19 February 2008 12:25 Go to previous messageGo to next message
Eclipse UserFriend
.... and once more the question back:

1. What is the length of rows:
------------------------------
a) height of one row (first 10px, afterwards 20px)
b) number of rows in the viewer (first 10 rows, afterwards 20 rows)

2. What is the lendth of columns:
---------------------------------
a) width of a column (first 10px, afterwards 20px)
b) number of columns in the viewer (first 10 rows, afterwards 20 rows)


You should read the JavaDoc of the method:

--------8<--------
Creates the SWT controls for this workbench part.

Clients should not call this method (the workbench calls this method
when it needs to, which may be never).
--------8<--------

1. The first and most obvious thing is:
---------------------------------------
That I'm quite sure that the Shell is not the parent of View/EditorPart

2. Even if this would be correct you would create a second control in
this view-part, the old don't vanish when you call createPartControl

I for now suppose your use case is 1b) and 2b).

1b) Why isn't calling refresh() enough this will completely rebuild your
viewer from your input

2b) There are examples how to add/remove columns on the fly. I'd suggest
using the 3.3 TableViewerColumn-API but you are free to use the old API.
See http://wiki.eclipse.org/JFaceSnippets


Tom

what is the length of rows
Jörg schrieb:
> thanks for your quick answer. i want to change length of the rows and
> columns. can you explain me why i should never call
> createPartControl(getViewSite().getShell()) by myself?
>
> Jörg
>
> Tom Schindl schrieb:
>> You should never call createPartControl(getViewSite().getShell())
>> yourself, this doesn't work (like you already discovered).
>>
>> What do you mean by changing the length of the rows and columns? Do
>> you want to change (height of a row, the width of column) or do you
>> want to add/remove rows/columns because your model changes?
>>
>> Tom
>>
>> Jörg schrieb:
>>> Hello,
>>>
>>> my TableViewer doesn't refresh. I have a table with buttons and i
>>> want to dynamically change the length of the rows and the columns.
>>> After i change this i call the function
>>> createPartControl(getViewSite().getShell()); in this function i call
>>> viewer.refresh() at the end. But it doesn't change only if i close
>>> the view and open it again. Can somebody help me?
>>>
>>> Greetings
>>
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: TableViewer refresh [message #325482 is a reply to message #325481] Tue, 19 February 2008 12:26 Go to previous messageGo to next message
Eclipse UserFriend
Tom Schindl schrieb:
> ... and once more the question back:
>
> 1. What is the length of rows:
> ------------------------------
> a) height of one row (first 10px, afterwards 20px)
> b) number of rows in the viewer (first 10 rows, afterwards 20 rows)
>
> 2. What is the lendth of columns:
> ---------------------------------
> a) width of a column (first 10px, afterwards 20px)
> b) number of columns in the viewer (first 10 rows, afterwards 20 rows)
>

c&p error (first 10 columns afterwards 20 columns)

>
> You should read the JavaDoc of the method:
>
> --------8<--------
> Creates the SWT controls for this workbench part.
>
> Clients should not call this method (the workbench calls this method
> when it needs to, which may be never).
> --------8<--------
>
> 1. The first and most obvious thing is:
> ---------------------------------------
> That I'm quite sure that the Shell is not the parent of View/EditorPart
>
> 2. Even if this would be correct you would create a second control in
> this view-part, the old don't vanish when you call createPartControl
>
> I for now suppose your use case is 1b) and 2b).
>
> 1b) Why isn't calling refresh() enough this will completely rebuild your
> viewer from your input
>
> 2b) There are examples how to add/remove columns on the fly. I'd suggest
> using the 3.3 TableViewerColumn-API but you are free to use the old API.
> See http://wiki.eclipse.org/JFaceSnippets
>
>
> Tom
>
> what is the length of rows
> Jörg schrieb:
>> thanks for your quick answer. i want to change length of the rows and
>> columns. can you explain me why i should never call
>> createPartControl(getViewSite().getShell()) by myself?
>>
>> Jörg
>>
>> Tom Schindl schrieb:
>>> You should never call createPartControl(getViewSite().getShell())
>>> yourself, this doesn't work (like you already discovered).
>>>
>>> What do you mean by changing the length of the rows and columns? Do
>>> you want to change (height of a row, the width of column) or do you
>>> want to add/remove rows/columns because your model changes?
>>>
>>> Tom
>>>
>>> Jörg schrieb:
>>>> Hello,
>>>>
>>>> my TableViewer doesn't refresh. I have a table with buttons and i
>>>> want to dynamically change the length of the rows and the columns.
>>>> After i change this i call the function
>>>> createPartControl(getViewSite().getShell()); in this function i call
>>>> viewer.refresh() at the end. But it doesn't change only if i close
>>>> the view and open it again. Can somebody help me?
>>>>
>>>> Greetings
>>>
>>>
>
>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: TableViewer refresh [message #325500 is a reply to message #325481] Wed, 20 February 2008 07:52 Go to previous message
Eclipse UserFriend
Right, i meant 1b) and 2b) this links helped me a lot. Thank you

Tom Schindl schrieb:
> ... and once more the question back:
>
> 1. What is the length of rows:
> ------------------------------
> a) height of one row (first 10px, afterwards 20px)
> b) number of rows in the viewer (first 10 rows, afterwards 20 rows)
>
> 2. What is the lendth of columns:
> ---------------------------------
> a) width of a column (first 10px, afterwards 20px)
> b) number of columns in the viewer (first 10 rows, afterwards 20 rows)
>
>
> You should read the JavaDoc of the method:
>
> --------8<--------
> Creates the SWT controls for this workbench part.
>
> Clients should not call this method (the workbench calls this method
> when it needs to, which may be never).
> --------8<--------
>
> 1. The first and most obvious thing is:
> ---------------------------------------
> That I'm quite sure that the Shell is not the parent of View/EditorPart
>
> 2. Even if this would be correct you would create a second control in
> this view-part, the old don't vanish when you call createPartControl
>
> I for now suppose your use case is 1b) and 2b).
>
> 1b) Why isn't calling refresh() enough this will completely rebuild your
> viewer from your input
>
> 2b) There are examples how to add/remove columns on the fly. I'd suggest
> using the 3.3 TableViewerColumn-API but you are free to use the old API.
> See http://wiki.eclipse.org/JFaceSnippets
>
>
> Tom
>
> what is the length of rows
> Jörg schrieb:
>> thanks for your quick answer. i want to change length of the rows and
>> columns. can you explain me why i should never call
>> createPartControl(getViewSite().getShell()) by myself?
>>
>> Jörg
>>
>> Tom Schindl schrieb:
>>> You should never call createPartControl(getViewSite().getShell())
>>> yourself, this doesn't work (like you already discovered).
>>>
>>> What do you mean by changing the length of the rows and columns? Do
>>> you want to change (height of a row, the width of column) or do you
>>> want to add/remove rows/columns because your model changes?
>>>
>>> Tom
>>>
>>> Jörg schrieb:
>>>> Hello,
>>>>
>>>> my TableViewer doesn't refresh. I have a table with buttons and i
>>>> want to dynamically change the length of the rows and the columns.
>>>> After i change this i call the function
>>>> createPartControl(getViewSite().getShell()); in this function i call
>>>> viewer.refresh() at the end. But it doesn't change only if i close
>>>> the view and open it again. Can somebody help me?
>>>>
>>>> Greetings
>>>
>>>
>
>
Previous Topic:LaunchConfiguration -> Output
Next Topic:How to determine the trigger for Content Assist!
Goto Forum:
  


Current Time: Mon Apr 28 02:42:24 EDT 2025

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

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

Back to the top