/** * Creates a FormData object specifying placement below anchorControl, with pixelsBetweeenAnchor space between * anchor and the control. */ public static FormData formDataBelow( Control anchorControl, int width, int pixelsBetweenAnchor ) { FormData fdMessageField = new FormData(); fdMessageField.left = new FormAttachment( 0, 0 ); fdMessageField.top = new FormAttachment( anchorControl, pixelsBetweenAnchor ); fdMessageField.right = new FormAttachment( 0, width ); return fdMessageField; }
private void setFdlDesc( int leftOffsetHasIcon, int topOffsetHasIcon, int leftOffsetNoIcon, int topOffsetNoIcon ) { if ( hasIcon ) { fdlDesc.left = new FormAttachment( wIcon, leftOffsetHasIcon ); fdlDesc.top = new FormAttachment( 0, topOffsetHasIcon ); } else { fdlDesc.left = new FormAttachment( 0, leftOffsetNoIcon ); fdlDesc.top = new FormAttachment( 0, topOffsetNoIcon ); } }
public FD( Control control ) { this.control = control; fd = new FormData(); }
private Group createGroup( Composite parentTab, Control top, String label ) { Group group = new Group( parentTab, SWT.SHADOW_NONE ); props.setLook( group ); group.setText( label ); FormLayout groupLayout = new FormLayout(); groupLayout.marginWidth = 10; groupLayout.marginHeight = 10; group.setLayout( groupLayout ); FormData fdGroup = new FormData(); fdGroup.left = new FormAttachment( 0, Const.MARGIN ); fdGroup.top = new FormAttachment( top, Const.MARGIN ); fdGroup.right = new FormAttachment( 100, -Const.MARGIN ); group.setLayoutData( fdGroup ); return group; }
/** * Convenience method to create FormData for labels. * * @param topControl * the control which is above the current label, or null if none above. * @return layoutData. */ public FormData createLabelLayoutData( final Control topControl ) { FormData formData = new FormData(); formData.left = new FormAttachment( 0, 0 ); formData.right = new FormAttachment( this.middle, -this.margin ); if ( topControl != null ) { formData.top = new FormAttachment( topControl, this.margin ); } else { formData.top = new FormAttachment( 0, this.margin ); } return formData; }
public FD top( Control control, int offset ) { fd.top = new FormAttachment( control, offset ); return this; }
/** * Convenience method to create FormData for Controls beside a label. * * @param topControl * the control which is above the current label, or null if none above. * @return layoutData. */ public FormData createControlLayoutData( final Control topControl ) { FormData formData = new FormData(); formData.left = new FormAttachment( this.middle, 0 ); if ( topControl != null ) { formData.top = new FormAttachment( topControl, this.margin ); } else { formData.top = new FormAttachment( 0, this.margin ); } formData.right = new FormAttachment( this.rightOffset, 0 ); return formData; }
public FD right( int numerator, int offset ) { fd.right = new FormAttachment( numerator, offset ); return this; }
/** * Creats a default FormData object with the top / bottom / and left set (this is done to cut down on repetative code * lines. * * @param button the button to which this form data will be applied * @param width the width of the button * @param margin the margin between buttons * @param lastControl the last control above the buttons * @return the newly created FormData object */ private static FormData createDefaultFormData( Button button, int width, int margin, Control lastControl ) { FormData formData = new FormData(); if ( lastControl != null ) { formData.top = new FormAttachment( lastControl, margin * 3 ); } else { formData.bottom = new FormAttachment( 100, 0 ); } formData.right = new FormAttachment( button, width + margin ); return formData; }
public FormDataBuilder left( int p1, int p2 ) { fd.left = new FormAttachment( p1, p2 ); return this; }
private void addWidgetAfter( Control widget, Control widgetAbove, Control widgetLeft ) { props.setLook( widget ); FormData fData = new FormData(); fData.left = new FormAttachment( widgetLeft, Const.MARGIN ); fData.top = new FormAttachment( widgetAbove, Const.MARGIN ); fData.right = new FormAttachment( 100, -Const.MARGIN ); widget.setLayoutData( fData ); }
public FD left( Control control, int offset ) { fd.left = new FormAttachment( control, offset ); return this; }
public FormDataBuilder top( int p1, int p2 ) { fd.top = new FormAttachment( p1, p2 ); return this; }
public FormDataBuilder bottom( int p1, int p2 ) { fd.bottom = new FormAttachment( p1, p2 ); return this; }
public FD top( int numerator, int offset ) { fd.top = new FormAttachment( numerator, offset ); return this; }
public FD bottom( int numerator, int offset ) { fd.bottom = new FormAttachment( numerator, offset ); return this; }
public FD left( int numerator, int offset ) { fd.left = new FormAttachment( numerator, offset ); return this; }
public FD right( Control control, int offset ) { fd.right = new FormAttachment( control, offset ); return this; }
public FormDataBuilder right( int p1, int p2 ) { fd.right = new FormAttachment( p1, p2 ); return this; }
public FD bottom( Control control, int offset ) { fd.bottom = new FormAttachment( control, offset ); return this; }