PDA

View Full Version : How to get GXT TabPanel to animate like GWT TabLayoutPanel?



mgnann
8 Sep 2011, 1:10 AM
Hi,

I'm looking for a way to animate the transitions between two TabItems inside a TabPanel just like TabLayoutPanel (click here for example) (http://gwt.google.com/samples/Showcase/Showcase.html#!CwTabLayoutPanel)

Small example of how my application looks like



Viewport viewport = new Viewport();
viewport.setSize(1000, 800);

XMLGrid xmlGrid = new XMLGrid();
XMLTreeGrid xmlTree = new XMLTreeGrid();

TabPanel tabPanel = new TabPanel();
tabPanel.setSize(800, 600);

TabItem a = new TabItem("XMLGrid");
a.add(xmlGrid);

TabItem b = new TabItem("XMLTreeGrid");
b.add(xmlTree);

tabPanel.add(a);
tabPanel.add(b);

viewport.add(tabPanel);
viewport.layout();

RootPanel.get().add(viewport);


Is there anyway to achieve this scrolling animation between my XMLGrid and my XMLTreeGrid / between the two TabItem contents?

sven
8 Sep 2011, 2:27 AM
Nothing for this is directly implemented into GXT. You would require a custom CardLayout for this. I have done this for a customer of mine already and can say that the only changes required are in the CardLayout class (which you will need to use in your TabPanel than as well. However i cannot give out the code.

mgnann
8 Sep 2011, 4:08 AM
Thanks for you reply, Sven.

I will take your hints and try to implement it this weekend.

sven
8 Sep 2011, 11:49 AM
Thanks for you reply, Sven.

I will take your hints and try to implement it this weekend.

Would be create if you could post this solution on the forums so everybody could see and use it.