SWTFactory.java 文件源码

java
阅读 33 收藏 0 点赞 0 评论 0

项目:tlaplus 作者:
/**
 * Creates a vertical spacer for separating components. If applied to a 
 * <code>GridLayout</code>, this method will automatically span all of the columns of the parent
 * to make vertical space
 * 
 * @param parent the parent composite to add this spacer to
 * @param numlines the number of vertical lines to make as space
 */
public static void createVerticalSpacer(Composite parent, int numlines) {
    Label lbl = new Label(parent, SWT.NONE);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    Layout layout = parent.getLayout();
    if(layout instanceof GridLayout) {
        gd.horizontalSpan = ((GridLayout)parent.getLayout()).numColumns;
    }
    gd.heightHint = numlines;
    lbl.setLayoutData(gd);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号