下面列出了怎么用org.eclipse.ui.forms.widgets.ColumnLayout的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* Returns the height hint for the given control.
*
* @param hHint
* the width hint
* @param c
* the control
*
* @return the height hint
*/
public static int getHeightHint( int hHint, Control c )
{
if ( c instanceof Composite )
{
Layout layout = ( (Composite) c ).getLayout( );
if ( layout instanceof ColumnLayout )
return hHint;
}
return SWT.DEFAULT;
}
public StickerComposite(Composite parent, int style, FormToolkit toolkit){
super(parent, style);
setLayoutData(new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP, 1, 1));
ColumnLayout cwl = new ColumnLayout();
cwl.maxNumColumns = 4;
cwl.horizontalSpacing = 1;
cwl.bottomMargin = 10;
cwl.topMargin = 0;
cwl.rightMargin = 1;
cwl.leftMargin = 1;
setLayout(cwl);
setBackground(parent.getBackground());
this.toolkit = toolkit;
this.setVisible(false);
}
public Tableau(Composite parent, int minColumns, int maxColumns){
super(parent, SWT.BORDER);
ColumnLayout cl = new ColumnLayout();
cl.maxNumColumns = maxColumns;
cl.minNumColumns = minColumns;
setLayout(cl);
}