You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Sandro Martini <sa...@gmail.com> on 2009/11/19 12:04:45 UTC

Align for Table Columns (and maybe also for Cells)

Hi,
is it possible to set an align mode (optional) for a Column Table ?
Default null, like currently and with standard values, maybe adding an
AUTO enum value ...
This is a very common requirements when displaying data, but maybe
there is already a solution.

Then, is some cases could be useful also to set it at cell level, but
to avoid a too heavy solution for it maybe a better approach could be
to have a custom renderer or other, right ? Or a custom subclass of
cell ..., but to set this (only when desired) at wtkx level (but by
default not used, and without throwing exceptions if possible) ?


All this in a ticket for the 1.5 ?

Thanks,
Sandro

Re: Align for Table Columns (and maybe also for Cells)

Posted by Sandro Martini <sa...@gmail.com>.
Hi Todd, what I was saying is something more (directly) visible to
users, like change the alignment in one of the columns of the Table
demo inside the Kitchen Sink (for example right align one of the first
columns that contain numbers), so anyone can see the feature, and then
go and read the documentation.

And definitely I have to study better the wtk part of Pivot :-) ...

Byeeeee

Re: Align for Table Columns (and maybe also for Cells)

Posted by Todd Volkert <tv...@gmail.com>.
The API docs should suffice (
http://incubator.apache.org/pivot/1.4/docs/api/org/apache/pivot/wtk/Renderer.html),
combined with the tutorial.  The fact that the Renderer interface extends
ConstrainedVisual and provides a getStyles() method is what enables this
functionality.  Our tutorial is actually pretty good about explaining how
styles tie in to WTKX and how to find out which styles are available for any
given component or renderer.

-T

On Thu, Nov 19, 2009 at 9:18 AM, Sandro Martini <sa...@gmail.com>wrote:

> > Yes, I do this in WTKX in many places in my existing Pivot apps -
> > <content:FooRenderer styles="{horizontalAlignment:'right'}" />
> Ok, thanks ... so probably could be a good idea to have a description
> of this, or at least a sample of it inside some tutorial or demo.
>
> Thanks for the info,
> Sandro
>

Re: Align for Table Columns (and maybe also for Cells)

Posted by Sandro Martini <sa...@gmail.com>.
> Yes, I do this in WTKX in many places in my existing Pivot apps -
> <content:FooRenderer styles="{horizontalAlignment:'right'}" />
Ok, thanks ... so probably could be a good idea to have a description
of this, or at least a sample of it inside some tutorial or demo.

Thanks for the info,
Sandro

Re: Align for Table Columns (and maybe also for Cells)

Posted by Todd Volkert <tv...@gmail.com>.
> The renderer is given the entire space of the cell and may align itself
> > however it likes - thus, it's 100% the domain of the renderer and already
> > currently supported.
> Ok, but there is a way to pass this value for example from the wtk ?
>

Yes - via whatever API the renderer exposes.


>
>
> And for columns I think this is a very common case to handle (many
> times I know before the type of data of a column, so I could set its
> alignment in the wtkx), right ?
>

Yes, I do this in WTKX in many places in my existing Pivot apps -
<content:FooRenderer styles="{horizontalAlignment:'right'}" />

Re: Align for Table Columns (and maybe also for Cells)

Posted by Greg Brown <gk...@mac.com>.
>> The renderer is given the entire space of the cell and may align itself
>> however it likes - thus, it's 100% the domain of the renderer and already
>> currently supported.
> Ok, but there is a way to pass this value for example from the wtk ?

Yes. You can specify it as a renderer style, if your column renderer supports it.

> Add a ticket for this (the column case) the 1.5 ?

It is already supported...


Re: Align for Table Columns (and maybe also for Cells)

Posted by Sandro Martini <sa...@gmail.com>.
> The renderer is given the entire space of the cell and may align itself
> however it likes - thus, it's 100% the domain of the renderer and already
> currently supported.
Ok, but there is a way to pass this value for example from the wtk ?


And for columns I think this is a very common case to handle (many
times I know before the type of data of a column, so I could set its
alignment in the wtkx), right ?

Add a ticket for this (the column case) the 1.5 ?

Bye

Re: Align for Table Columns (and maybe also for Cells)

Posted by Todd Volkert <tv...@gmail.com>.
The renderer is given the entire space of the cell and may align itself
however it likes - thus, it's 100% the domain of the renderer and already
currently supported.

-T

On Thu, Nov 19, 2009 at 6:04 AM, Sandro Martini <sa...@gmail.com>wrote:

> Hi,
> is it possible to set an align mode (optional) for a Column Table ?
> Default null, like currently and with standard values, maybe adding an
> AUTO enum value ...
> This is a very common requirements when displaying data, but maybe
> there is already a solution.
>
> Then, is some cases could be useful also to set it at cell level, but
> to avoid a too heavy solution for it maybe a better approach could be
> to have a custom renderer or other, right ? Or a custom subclass of
> cell ..., but to set this (only when desired) at wtkx level (but by
> default not used, and without throwing exceptions if possible) ?
>
>
> All this in a ticket for the 1.5 ?
>
> Thanks,
> Sandro
>