As Greg mentioned, it would be much easier for us to look into if you
put all of your code into a zip file and attach it. Then we can
download and run it locally to see what is going on.
Please keep the example code simple, and just include your custom
component and the things required to show the problem.
Are you sure that the GridViewFilter has a height that is > 0?
In your first email you have this method which returns a preferred height of 0
@Override
public int getPreferredHeight(int width) {
return 0;
}
Place an extra debugging statement to show the actual size of the
GridViewFilter when it is painted.
@Override
public void paint(Graphics2D graphics) {
System.out.println("paint");
int width = getWidth();
int height = getHeight();
...
<print the width and height here>
}
On 7 September 2011 16:52, prophe <[email protected]> wrote:
> Ok, I've tried this code:
>
> <Window title="Table Views" maximized="true"
> xmlns:bxml="http://pivot.apache.org/bxml"
> xmlns:collections="org.apache.pivot.collections"
> xmlns="org.apache.pivot.wtk"
> xmlns:content="org.apache.pivot.wtk.content"
> xmlns:grid="com.cargosoft.tutorials.wtk.grid">
> <StackPane>
> <BoxPane styles="{spacing:0, fill:true}">
> <grid:GridViewFilter />
> </BoxPane>
> </StackPane>
> </Window>
>
> and I see my custom component rendered
>
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316194/t.png
>
> But I want to display this custom component in the header of table, but I
> can't... It doesn't display... I want to display my component something like
> this (look inside columnHeader tag):
>
> <Window title="Table Views" maximized="true"
> xmlns:bxml="http://pivot.apache.org/bxml"
> xmlns:collections="org.apache.pivot.collections"
> xmlns="org.apache.pivot.wtk"
> xmlns:content="org.apache.pivot.wtk.content"
> xmlns:grid="com.cargosoft.tutorials.wtk.grid">
> <StackPane>
> <Border styles="{color:7}">
> <ScrollPane>
> <TableView bxml:id="tableView">
> <columns>
> <TableView.Column
> name="nation" width="180"
> headerData="Nation" />
> <TableView.Column name="gold"
> width="60"
> headerData="Gold" />
> <TableView.Column
> name="silver" width="60"
> headerData="Silver" />
> <TableView.Column
> name="bronze" width="60"
> headerData="Bronze" />
> <TableView.Column name="total"
> width="60"
> headerData="Total" />
> </columns>
>
>
> <collections:HashMap nation="China"
> gold="51"
> silver="21" bronze="28"
> total="100" />
> <collections:HashMap nation="United
> States"
> gold="36" silver="38"
> bronze="36" total="110" />
>
> </TableView>
>
> <columnHeader>
> <BoxPane orientation="vertical"
> styles="{fill:true}">
> <TableViewHeader
> tableView="$tableView" />
> <grid:GridViewFilter />
> </BoxPane>
> </columnHeader>
> </ScrollPane>
> </Border>
> </StackPane>
>
> But I see only this (and no my custom component in the header):
>
> http://apache-pivot-users.399431.n3.nabble.com/file/n3316194/te.png
>
> Why pivot doesn't render my custom component? Code off component you can
> find above at the first message...
>
> -----
> Thank you!
> --
> View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/Custom-TableViewFilter-tp3304078p3316194.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
>