在GWT页面底部的TabLayoutPanel [英] TabLayoutPanel at the bottom of the page in GWT

查看:131
本文介绍了在GWT页面底部的TabLayoutPanel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能在GWT页面的最底部有一个TabLayoutPanel,不幸的是,在线文档很少。



  public class BottomLabLayoutPanel扩展TabLayoutPanel 
{
public BottomLabLayoutPanel(double barHeight,Unit barUnit)
{
super(barHeight,barUnit);

LayoutPanel面板=(LayoutPanel)getWidget();
if(panel.getWidgetCount()> = 2)
{
Widget w1 = panel.getWidget(0);
Widget w2 = panel.getWidget(1);
Element e1 = w1.getElement()。getParentElement();
Element e2 = w2.getElement()。getParentElement();
if(e1!= null)
e1.setClassName(BottomTabLayoutPanel TabPanel);
if(e2!= null)
e2.setClassName(BottomTabLayoutPanel ContentPanel);





在CSS中:

  .BottomTabLayoutPanel.TabPanel 
{
top:auto!important;
bottom:0px!important;
}

.BottomTabLayoutPanel.ContentPanel
{
top:0px!important;
margin-bottom:35px!important;
}


I would like to know if It is possible to have a TabLayoutPanel at the very bottom of a page in GWT, unfortunately there is a so little documentation online.

解决方案

Not very elegant, but it works:

public class BottomLabLayoutPanel extends TabLayoutPanel
{
    public BottomLabLayoutPanel(double barHeight, Unit barUnit)
    {
        super(barHeight, barUnit);

        LayoutPanel panel = (LayoutPanel)getWidget();
        if (panel.getWidgetCount() >= 2)
        {
            Widget w1 = panel.getWidget(0);
            Widget w2 = panel.getWidget(1);
            Element e1 = w1.getElement().getParentElement();
            Element e2 = w2.getElement().getParentElement();
            if (e1 != null)
                e1.setClassName("BottomTabLayoutPanel TabPanel");
            if (e2 != null)
                e2.setClassName("BottomTabLayoutPanel ContentPanel");
        }
    }
}

In CSS:

.BottomTabLayoutPanel.TabPanel
{
    top: auto !important;
    bottom: 0px !important;
}

.BottomTabLayoutPanel.ContentPanel
{
    top: 0px !important;
    margin-bottom: 35px !important;
}

这篇关于在GWT页面底部的TabLayoutPanel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆