bos隐藏kdtable表格右上角的三个小图标后表格前后有一行空行,隐藏该空行

来源:互联网 发布:外围体育关注软件 编辑:程序博客网 时间:2024/05/17 21:59

    /**
     *
     * 描述:隐藏分录表上增删插按钮
     * @param  <参数描述>
     * @return  <返回值描述>
     *
     * @author:yell
     * 创建时间:2009-5-5 <p>
     *
     * @see  <相关的类>
     */
    private void hidePanelButtons(KDTable table){
        // 隐藏分录上的增删改按钮
        Component c = table.getParent().getParent();
        if (c instanceof DetailPanel) {
            DetailPanel panel = (DetailPanel) c;
            // 获取btn
            Component[] components = panel.getComponents();
            int t=0;
            for (int i = 0; i < components.length; i++) {
                Component component = components[i];

                if (component instanceof KDPanel) {
                    KDPanel kdPanel = (KDPanel) component;
                    if ("controlPanel".equals(kdPanel.getName())) {
                        panel.remove(kdPanel);
                        t=kdPanel.getHeight();
                        System.out.println("hight="+t);
                        // DEBUG
                        System.out.println("[DEBUG]:(public) remove the '"
                                + component.getName() + "' panel");
                    }else{
                        kdPanel.setLocation(kdPanel.getLocation().x,kdPanel.getLocation().y-t);
                        kdPanel.getParent().add(kdPanel, new KDLayout.Constraints(kdPanel.getX(),kdPanel.getY(),kdPanel.getWidth(),kdPanel.getHeight(), 15));
                    }
                }
            }
        }
    }

原创粉丝点击