Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » TableColumnLayout and Memento
TableColumnLayout and Memento [message #329096] Thu, 12 June 2008 15:38 Go to next message
Stewart Francis is currently offline Stewart FrancisFriend
Messages: 9
Registered: July 2009
Junior Member
Hi, therre doesn't appear to be a jface newsgroup so I've posted this
here. Please redirect me if there's somewhere more appropriate to post
this.

I'm interested in using a Memento to preserve the state of a
TableColumnLayout, so that my table is recreated as it was when my view
is closed and reopened. My TableColumnLayout is given ColumnWeightData
for each TableColumn I add, with weight 1, and minimum width 75. If a
column is resized, the ColumnWeightData is changed for ColumnPixelData
internally, and a fixed width is assigned to the column. When saving
the state of my view in a memento, I am unable to retrieve the
ColumnLayoutData for each column - the getLayoutData(Scrollable, int)
method declared on AbstractColumnData has default access. As the
ColumnLayoutData is stored as widget data, I can retrieve it by
'guessing' the key, but I would much rather access it through a public
API. Is there any alternative to this? I've experimented with writing
a listener to record when a column is manually resized (seemed like
overkill as the TableColumnLayout already does this, and deactivates
listeners based on whether or not they were resized by a user or
programmatically), and setting the width and minimum weight of a column
to be the recorded width (column resize behavior is different to having
a mixture of columns sized by weight, and fixed width).

Thanks in advance,

Setwart Francis
Re: TableColumnLayout and Memento [message #329102 is a reply to message #329096] Thu, 12 June 2008 17:44 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hm,

Why do you need access to the ColumnLayout? You could simply ask the
column for the width and calculate it your own for relative columns.

Tom

Stewart Francis schrieb:
> Hi, therre doesn't appear to be a jface newsgroup so I've posted this
> here. Please redirect me if there's somewhere more appropriate to post
> this.
>
> I'm interested in using a Memento to preserve the state of a
> TableColumnLayout, so that my table is recreated as it was when my view
> is closed and reopened. My TableColumnLayout is given ColumnWeightData
> for each TableColumn I add, with weight 1, and minimum width 75. If a
> column is resized, the ColumnWeightData is changed for ColumnPixelData
> internally, and a fixed width is assigned to the column. When saving
> the state of my view in a memento, I am unable to retrieve the
> ColumnLayoutData for each column - the getLayoutData(Scrollable, int)
> method declared on AbstractColumnData has default access. As the
> ColumnLayoutData is stored as widget data, I can retrieve it by
> 'guessing' the key, but I would much rather access it through a public
> API. Is there any alternative to this? I've experimented with writing
> a listener to record when a column is manually resized (seemed like
> overkill as the TableColumnLayout already does this, and deactivates
> listeners based on whether or not they were resized by a user or
> programmatically), and setting the width and minimum weight of a column
> to be the recorded width (column resize behavior is different to having
> a mixture of columns sized by weight, and fixed width).
>
> Thanks in advance,
>
> Setwart Francis


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: TableColumnLayout and Memento [message #329120 is a reply to message #329102] Fri, 13 June 2008 09:08 Go to previous messageGo to next message
Stewart Francis is currently offline Stewart FrancisFriend
Messages: 9
Registered: July 2009
Junior Member
Hi, thanks for the response. I'd like to recreate a table so that after
the view is part of is closed and reopened, the column appearance and
behavior is unaffected. Only being able to access the column width, I
can't determine whether it was determined by weight, or an absolute
width has been specified by the user.

Tom Schindl wrote:
> Hm,
>
> Why do you need access to the ColumnLayout? You could simply ask the
> column for the width and calculate it your own for relative columns.
>
> Tom
>
> Stewart Francis schrieb:
>> Hi, therre doesn't appear to be a jface newsgroup so I've posted this
>> here. Please redirect me if there's somewhere more appropriate to
>> post this.
>>
>> I'm interested in using a Memento to preserve the state of a
>> TableColumnLayout, so that my table is recreated as it was when my
>> view is closed and reopened. My TableColumnLayout is given
>> ColumnWeightData for each TableColumn I add, with weight 1, and
>> minimum width 75. If a column is resized, the ColumnWeightData is
>> changed for ColumnPixelData internally, and a fixed width is assigned
>> to the column. When saving the state of my view in a memento, I am
>> unable to retrieve the ColumnLayoutData for each column - the
>> getLayoutData(Scrollable, int) method declared on AbstractColumnData
>> has default access. As the ColumnLayoutData is stored as widget data,
>> I can retrieve it by 'guessing' the key, but I would much rather
>> access it through a public API. Is there any alternative to this?
>> I've experimented with writing a listener to record when a column is
>> manually resized (seemed like overkill as the TableColumnLayout
>> already does this, and deactivates listeners based on whether or not
>> they were resized by a user or programmatically), and setting the
>> width and minimum weight of a column to be the recorded width (column
>> resize behavior is different to having a mixture of columns sized by
>> weight, and fixed width).
>>
>> Thanks in advance,
>>
>> Setwart Francis
>
>
Re: TableColumnLayout and Memento [message #329181 is a reply to message #329120] Mon, 16 June 2008 14:53 Go to previous messageGo to next message
Boris Bokowski is currently offline Boris BokowskiFriend
Messages: 272
Registered: July 2009
Senior Member
Sounds reasonable - can you please file an enhancement request in Bugzilla?

Thanks
Boris

"Stewart Francis" <stew@owww.org> wrote in message
news:g2tdel$55m$1@build.eclipse.org...
> Hi, thanks for the response. I'd like to recreate a table so that after
> the view is part of is closed and reopened, the column appearance and
> behavior is unaffected. Only being able to access the column width, I
> can't determine whether it was determined by weight, or an absolute width
> has been specified by the user.
>
> Tom Schindl wrote:
>> Hm,
>>
>> Why do you need access to the ColumnLayout? You could simply ask the
>> column for the width and calculate it your own for relative columns.
>>
>> Tom
>>
>> Stewart Francis schrieb:
>>> Hi, therre doesn't appear to be a jface newsgroup so I've posted this
>>> here. Please redirect me if there's somewhere more appropriate to post
>>> this.
>>>
>>> I'm interested in using a Memento to preserve the state of a
>>> TableColumnLayout, so that my table is recreated as it was when my view
>>> is closed and reopened. My TableColumnLayout is given ColumnWeightData
>>> for each TableColumn I add, with weight 1, and minimum width 75. If a
>>> column is resized, the ColumnWeightData is changed for ColumnPixelData
>>> internally, and a fixed width is assigned to the column. When saving
>>> the state of my view in a memento, I am unable to retrieve the
>>> ColumnLayoutData for each column - the getLayoutData(Scrollable, int)
>>> method declared on AbstractColumnData has default access. As the
>>> ColumnLayoutData is stored as widget data, I can retrieve it by
>>> 'guessing' the key, but I would much rather access it through a public
>>> API. Is there any alternative to this? I've experimented with writing
>>> a listener to record when a column is manually resized (seemed like
>>> overkill as the TableColumnLayout already does this, and deactivates
>>> listeners based on whether or not they were resized by a user or
>>> programmatically), and setting the width and minimum weight of a column
>>> to be the recorded width (column resize behavior is different to having
>>> a mixture of columns sized by weight, and fixed width).
>>>
>>> Thanks in advance,
>>>
>>> Setwart Francis
>>
Re: TableColumnLayout and Memento [message #329415 is a reply to message #329181] Mon, 23 June 2008 14:55 Go to previous message
Stewart Francis is currently offline Stewart FrancisFriend
Messages: 9
Registered: July 2009
Junior Member
Hi, apologies for the delay in response. I've investigated a little
further and have decided that Mementos are inappropriate for what I want
to achieve - saveState is only called when the workbench is closing the
view, and I'd like to save the state when the user is closing the view
also. I've looked at achieving this with DialogSettings instead of
Mementos, and obviously have the same problem regarding not being able
to access TableColumnLayout internals. However, I feel it would be more
appropriate to have a listener so DialogSettings can be updated to
reflect any changes in the way the column widths are calculated (as
there is no mechanism for getting the state immediately before the view
is closed - either by a user or by the workbench). I'd be interested to
hear your opinions on this.

Thanks,

Stew

Boris Bokowski wrote:
> Sounds reasonable - can you please file an enhancement request in Bugzilla?
>
> Thanks
> Boris
>
> "Stewart Francis" <stew@owww.org> wrote in message
> news:g2tdel$55m$1@build.eclipse.org...
>> Hi, thanks for the response. I'd like to recreate a table so that after
>> the view is part of is closed and reopened, the column appearance and
>> behavior is unaffected. Only being able to access the column width, I
>> can't determine whether it was determined by weight, or an absolute width
>> has been specified by the user.
>>
>> Tom Schindl wrote:
>>> Hm,
>>>
>>> Why do you need access to the ColumnLayout? You could simply ask the
>>> column for the width and calculate it your own for relative columns.
>>>
>>> Tom
>>>
>>> Stewart Francis schrieb:
>>>> Hi, therre doesn't appear to be a jface newsgroup so I've posted this
>>>> here. Please redirect me if there's somewhere more appropriate to post
>>>> this.
>>>>
>>>> I'm interested in using a Memento to preserve the state of a
>>>> TableColumnLayout, so that my table is recreated as it was when my view
>>>> is closed and reopened. My TableColumnLayout is given ColumnWeightData
>>>> for each TableColumn I add, with weight 1, and minimum width 75. If a
>>>> column is resized, the ColumnWeightData is changed for ColumnPixelData
>>>> internally, and a fixed width is assigned to the column. When saving
>>>> the state of my view in a memento, I am unable to retrieve the
>>>> ColumnLayoutData for each column - the getLayoutData(Scrollable, int)
>>>> method declared on AbstractColumnData has default access. As the
>>>> ColumnLayoutData is stored as widget data, I can retrieve it by
>>>> 'guessing' the key, but I would much rather access it through a public
>>>> API. Is there any alternative to this? I've experimented with writing
>>>> a listener to record when a column is manually resized (seemed like
>>>> overkill as the TableColumnLayout already does this, and deactivates
>>>> listeners based on whether or not they were resized by a user or
>>>> programmatically), and setting the width and minimum weight of a column
>>>> to be the recorded width (column resize behavior is different to having
>>>> a mixture of columns sized by weight, and fixed width).
>>>>
>>>> Thanks in advance,
>>>>
>>>> Setwart Francis
>
Previous Topic:Possible to build an update site from 3.2 for 3.4?
Next Topic:Slippery Breakpoint, Stops then Continues by Itself
Goto Forum:
  


Current Time: Sat Jul 27 19:24:31 GMT 2024

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

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

Back to the top