As far as I can tell, there is no official way to do this, and there
is no way to do it in CSS due to the layout being set directly on the
elements. I have developed a bit of a workaround but this could be
broken by subsequent GWT releases as they make changes to the way the
tab panel lays itself out. This is only a partial solution, but you
can take the idea and run with it. If you are dynamically adding tabs
you will need to change the float when they are created.
public TabPanelRight()
{
// INIT TABS HERE
// set the tab divs to float:right instead of float:left
for (Element el:getChildElementsWithClass(tabPanel.getElement(),
"gwt-TabLayoutPanelTab"))
el.setAttribute("style", "float:right;");
// clearing left gets overriden by the layout, there is probably a
better way to do this
tabPanel.setVisible(false);
DeferredCommand.addCommand(new Command(){
@Override
public void execute()
{
getChildElementsWithClass(tabPanel.getElement(), "gwt-
TabLayoutPanelTabs").get(0).getStyle().clearLeft();
tabPanel.setVisible(true);
}});
}
private List<Element> getChildElementsWithClass(Element parent, String
styleClass)
{
List<Element> toReturn = new ArrayList<Element>();
NodeList<Node> children = parent.getChildNodes();
for (int i = 0; i < children.getLength(); i++)
{
Node child = children.getItem(i);
if (child.getNodeType() == Node.ELEMENT_NODE)
{
for (String className:
((Element)child).getAttribute("class").split(" "))
if (className.equals(styleClass))
toReturn.add((Element)child);
toReturn.addAll(getChildElementsWithClass((Element)child,
styleClass));
}
}
return toReturn;
}
On Jul 13, 9:49 am, Trevis <[email protected]> wrote:
> I would also like to know the answer to this question. My ui drafts
> are mocked that way. I figured that by the time I got around to doing
> layout that I'd stumble into the answer. I have t dug I to it myself
> yet but I am geting close to needing to know. I'm sure that I could
> just change the standard.css file but I hope that there is an
> official way to do this.
>
> On Jul 12, 2:48 pm, Akshay Kumar <[email protected]> wrote:
>
> > Hi,
> > I assume, by rtl, you meant right-to-left. Then, no, my UI designer gave me
> > this design to have the tab-headers on the right.
> > I do not want to go back to UI-designer that its not possible, unless I have
> > tried my options.
> > thanks,
> > Tkshay
>
> > On 13 July 2010 00:19, Stefan Bachert <[email protected]> wrote:> Hi,
>
> > > Did you want to support a rtl language?
> > > When yes, try to switch to it.
> > > Some widget support it.
>
> > > Stefan Bachert
> > >http://gwtworld.de
>
> > > On 11 Jul., 13:46, Akshay Kumar <[email protected]> wrote:
> > > > I am using TabLayoutPanel (in UiBinder xml), and the tab handles
> > > > ( headers) are by default on top-left. Cant seem to figure out any api
> > > > option to align the tab-headers on the top-right. I tried TabPanel
> > > > also but without any luck.
>
> > > > something like this:
>
> > > > ____________________________[ Tab1 ]_[ Tab2 ]_[ Tab3 ]_
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |
> > > > |_________________________________________________|
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Web Toolkit" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected]<google-web-toolkit%2Bunsubs
> > > [email protected]>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.