You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by marianciu <ma...@rocketmail.com> on 2013/04/10 09:17:54 UTC

Re: center the text of header columns of tableView

Hi

I would like using your solutions to set text in center in table header, but
I've received exception:

An error occurred at line number 89 in file
/E:/esculapus/target/classes/pl/marianciu/esculapus/view/prime/basic.bxml:
org.apache.pivot.serialization.SerializationException: "dataRenderer" is not
a valid property of element <TableViewHeader>.
	at
org.apache.pivot.beans.BXMLSerializer.processStartElement(BXMLSerializer.java:792)
	at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:443)
	at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:630)
	at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:585)
	at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:546)
	at
pl.marianciu.esculapus.view.login.LoginView$1.buttonPressed(LoginView.java:44)
	at
org.apache.pivot.wtk.Button$ButtonPressListenerList.buttonPressed(Button.java:194)
	at org.apache.pivot.wtk.Button.press(Button.java:412)
	at org.apache.pivot.wtk.PushButton.press(PushButton.java:70)
	at
org.apache.pivot.wtk.skin.PushButtonSkin.mouseClick(PushButtonSkin.java:77)
	at
org.apache.pivot.wtk.skin.terra.TerraPushButtonSkin.mouseClick(TerraPushButtonSkin.java:586)
	at
org.apache.pivot.wtk.Component$ComponentMouseButtonListenerList.mouseClick(Component.java:503)
	at org.apache.pivot.wtk.Component.mouseClick(Component.java:2817)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:815)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:800)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:800)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:800)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:800)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:800)
	at org.apache.pivot.wtk.Container.mouseUp(Container.java:800)
	at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.processMouseEvent(ApplicationContext.java:998)
	at java.awt.Component.processEvent(Component.java:6270)
	at
org.apache.pivot.wtk.ApplicationContext$DisplayHost.processEvent(ApplicationContext.java:792)
	at java.awt.Component.dispatchEventImpl(Component.java:4861)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4687)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)
	at java.awt.EventQueue.access$200(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:688)
	at java.awt.EventQueue$3.run(EventQueue.java:686)
	at java.security.AccessController.doPrivileged(Native Method)
	at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:702)
	at java.awt.EventQueue$4.run(EventQueue.java:700)
	at java.security.AccessController.doPrivileged(Native Method)
	at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)
	at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

I don't know what I do wrong. In example above this solution is proposed.

Br
Marcin


Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>

 
Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>


Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>


Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>


Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>


Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>


Greg Brown wrote
> This is done (in trunk).
> 
> On Aug 5, 2010, at 8:12 AM, Noel Grandin wrote:
> 
>> 
>> In theory, it should be easy enough for a developer to replace the header
>> renderer with something that does whatever
>> they want, displaying different stuff for each header.
>> 
>> But in practice, the most common usage is to override just one or two
>> columns with something special, so I would say
>> that, yes, we should make the header-renderer a per-column thing.
>> 
>> -- Noel
>> 
>> Greg Brown wrote:
>>> The reason it is done automatically is because a developer may want to
>>> combine both icon-only and text headers in a table view, but
>>> TableViewHeader only supports only a single header data renderer that is
>>> common to all headers. As a result, the renderer needs to make some
>>> assumptions about how the data should be presented. 
>>> 
>>> Perhaps it would be better to allow the caller to define the header data
>>> renderer on a per-column basis, in the TableView.Column class. The
>>> header data itself lives in the column, so arguably the header data
>>> renderer should go there as well.
>>> 
>>> cc'ing the dev list for comments.
>>> 
>>> G
>>> 
>>> On Aug 5, 2010, at 2:44 AM, Olivier Dutrieux wrote:
>>> 
>>>> Thanks Greg for your answer.
>>>> 
>>>> Why it's not the developper to decide where the icon + text or text
>>>> only  or only icon will be display ? It's  will more flexible. or maybe
>>>> that could be use by defaut this actually display (only icon :
>>>> centered-aligned, icon + text or text only : left-aligned) but if the
>>>> user defined the value horizontalAlignment via the styles property that
>>>> use property value :
>>>> 
>>>> if (getStyles().get("horizontalAlignment") == null) {
>>>>   getStyles().put("horizontalAlignment", (text == null) ?
>>>> HorizontalAlignment.CENTER : HorizontalAlignment.LEFT);
>>>> }
>>>> 
>>>> Duto
>>>> 
>>>> Le 05/08/2010 01:39, Greg Brown a écrit :
>>>>> No, it's not a bug. It is done that way so headers that contain only
>>>>> an icon will be centered, but icon+text or text only will be
>>>>> left-aligned.
>>>>> 
>>>>> On Aug 4, 2010, at 4:53 PM, Duto wrote:
>>>>> 
>>>>>> I found this process too^^ :
>>>>>> 
>>>>>> src : TableViewHeaderDataRenderer
>>>>>> 
>>>>>> 76: // Left-align the content
>>>>>> 77:         getStyles().put("horizontalAlignment", (text == null) ?
>>>>>> 78:            HorizontalAlignment.CENTER :
>>>>>> HorizontalAlignment.LEFT);
>>>>>> 
>>>>>> Why It's do like that ? It's a bug or ... ?
>>>>>> 
>>>>>> Best regards
>>>>>> 
>>>>>> Duto
>>>>>> -- 
>>>>>> View this message in context:
>>>>>> http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p1023905.html
>>>>>> Sent from the Apache Pivot - Users mailing list archive at
>>>>>> Nabble.com.
>>





--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p4022563.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

RE: center the text of header columns of tableView

Posted by "Roger L. Whitcomb" <Ro...@actian.com>.
Glad I could help :)

~Roger Whitcomb

Re: center the text of header columns of tableView

Posted by marianciu <ma...@rocketmail.com>.
Great! My name of header is in centre.
I owe you one ;).

Br
Marcin



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p4022568.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: center the text of header columns of tableView

Posted by Roger Whitcomb <Ro...@rbwhitcomb.com>.
Oh yes, the headerDataRenderer is a property of TableView.Column. So just move that piece of your BXML (to right after </cellRenderer>).

HTH,
~Roger Whitcomb


On Apr 11, 2013, at 7:13 AM, marianciu <ma...@rocketmail.com> wrote:

> Hello Roger
> 
> I've used "headerDataRenderer" and obtain similar exception:
> An error occurred at line number 89 in file
> /E:/esculapus/target/classes/pl/marianciu/esculapus/view/prime/basic.bxml:
> org.apache.pivot.serialization.SerializationException: "headerDataRenderer"
> is not a valid property of element <TableViewHeader>.
>    at
> org.apache.pivot.beans.BXMLSerializer.processStartElement(BXMLSerializer.java:792)
>    at
> org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:443)
>    at
> org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:630)
> 
> my fragment bxml file:
> <Border>
> 
>    <ScrollPane horizontalScrollBarPolicy="fill">
>        <TableView bxml:id="tabelePatient">
>            <columns>
> 
> 
> 
>                <TableView.Column name="name" width="1*"
>                    headerData="Nazwa">
>                    <cellRenderer>
>                        <SimpleColumn xmlns="pl.marianciu.esculapus.helper.table.column" />
>                    </cellRenderer>
>                </TableView.Column>
>                <TableView.Column name="pesel" width="1*"
>                    headerData="PESEL">
>                    <cellRenderer>
>                        <SimpleColumn xmlns="pl.marianciu.esculapus.helper.table.column" />
>                    </cellRenderer>
>                </TableView.Column>
> 
>            </columns>
> 
>            <collections:HashMap name="Marcin Wazniak" pesel="81818101012" />
>            <collections:HashMap name="Franek Podlaha" pesel="85121903402" />
>            <collections:HashMap name="Jarek Twardy" pesel="81010903587" />
> 
>        </TableView>
>        <columnHeader>
>            <TableViewHeader tableView="$tabelePatient">
>                <headerDataRenderer>
>                    <content:TableViewHeaderDataRenderer
>                        styles="{horizontalAlignment:'center'}"
> xmlns:content="org.apache.pivot.wtk.content" />
>                </headerDataRenderer>
>            </TableViewHeader>
>        </columnHeader>
> 
>    </ScrollPane>
> </Border>
> 
> I've investigated class TableViewHeader, and don't see inside variable
> headerDataRenderer, but this variable is in TableView. Maybe this is
> problem? Or is structure in my bxml file wrong?
> 
> Br
> Marcin
> 
> 
> 
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p4022566.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 

Re: center the text of header columns of tableView

Posted by marianciu <ma...@rocketmail.com>.
Hello Roger

I've used "headerDataRenderer" and obtain similar exception:
An error occurred at line number 89 in file
/E:/esculapus/target/classes/pl/marianciu/esculapus/view/prime/basic.bxml:
org.apache.pivot.serialization.SerializationException: "headerDataRenderer"
is not a valid property of element <TableViewHeader>.
	at
org.apache.pivot.beans.BXMLSerializer.processStartElement(BXMLSerializer.java:792)
	at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:443)
	at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:630)

my fragment bxml file:
<Border>

	<ScrollPane horizontalScrollBarPolicy="fill">
		<TableView bxml:id="tabelePatient">
			<columns>



				<TableView.Column name="name" width="1*"
					headerData="Nazwa">
					<cellRenderer>
						<SimpleColumn xmlns="pl.marianciu.esculapus.helper.table.column" />
					</cellRenderer>
				</TableView.Column>
				<TableView.Column name="pesel" width="1*"
					headerData="PESEL">
					<cellRenderer>
						<SimpleColumn xmlns="pl.marianciu.esculapus.helper.table.column" />
					</cellRenderer>
				</TableView.Column>

			</columns>

			<collections:HashMap name="Marcin Wazniak" pesel="81818101012" />
			<collections:HashMap name="Franek Podlaha" pesel="85121903402" />
			<collections:HashMap name="Jarek Twardy" pesel="81010903587" />

		</TableView>
		<columnHeader>
			<TableViewHeader tableView="$tabelePatient">
				<headerDataRenderer>
					<content:TableViewHeaderDataRenderer
						styles="{horizontalAlignment:'center'}"
xmlns:content="org.apache.pivot.wtk.content" />
				</headerDataRenderer>
			</TableViewHeader>
		</columnHeader>

	</ScrollPane>
</Border>

I've investigated class TableViewHeader, and don't see inside variable
headerDataRenderer, but this variable is in TableView. Maybe this is
problem? Or is structure in my bxml file wrong?

Br
Marcin




--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/center-the-text-of-header-columns-of-tableView-tp1022087p4022566.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: center the text of header columns of tableView

Posted by Roger and Beth Whitcomb <Ro...@rbwhitcomb.com>.
Hello Marcin,
     It looks to me like you are trying to set "dataRenderer" in your 
bxml file with your custom renderer.  However, the attribute name should 
be "headerDataRenderer".  Without checking the history, my guess is this 
changed name in later versions since these postings.

HTH,
~Roger Whitcomb