Java Code Examples for org.eclipse.swt.layout.GridData#HORIZONTAL_ALIGN_CENTER

The following examples show how to use org.eclipse.swt.layout.GridData#HORIZONTAL_ALIGN_CENTER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SootConfigManagerDialog.java    From JAADAS with GNU General Public License v3.0 6 votes vote down vote up
protected Control createSpecialButtonBar(Composite parent) {
	Composite composite= new Composite(parent, SWT.NULL);
	GridLayout layout= new GridLayout();
	layout.numColumns= 1;

	composite.setLayout(layout);
	composite.setLayoutData(new GridData(GridData.FILL_VERTICAL));

	
	applyDialogFont(composite);
	
	composite.setLayout(layout);

	GridData data =
		new GridData(
			GridData.VERTICAL_ALIGN_END | GridData.HORIZONTAL_ALIGN_CENTER);
	composite.setLayoutData(data);

	// Add the buttons to the button bar.
	createSpecialButtonsForButtonBar(composite);

	return composite;
}
 
Example 2
Source File: TeraFastAboutDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * build Ok Button.
 */
protected void buildOkButton() {
  Button ok = new Button( this.dialog, SWT.PUSH );
  ok.setText( BaseMessages.getString( PKG, "TeraFastDialog.About.Plugin.Close" ) );
  GridData grdData = new GridData( GridData.HORIZONTAL_ALIGN_CENTER );
  grdData.horizontalSpan = 2;
  grdData.verticalIndent = DEFAULT_INDENT;
  grdData.horizontalIndent = DEFAULT_INDENT;
  ok.setLayoutData( grdData );

  ok.addListener( SWT.Selection, new Listener() {
    public void handleEvent( Event arg0 ) {
      dialog.dispose();
    }
  } );
}
 
Example 3
Source File: OlapInputAboutDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * build Ok Button.
 */
protected void buildOkButton() {
  Button ok = new Button( this.dialog, SWT.PUSH );
  ok.setText( BaseMessages.getString( PKG, "OlapInputDialog.About.Plugin.Close" ) );
  GridData grdData = new GridData( GridData.HORIZONTAL_ALIGN_CENTER );
  grdData.horizontalSpan = 2;
  grdData.verticalIndent = DEFAULT_INDENT;
  grdData.horizontalIndent = DEFAULT_INDENT;
  ok.setLayoutData( grdData );

  ok.addListener( SWT.Selection, new Listener() {
    public void handleEvent( Event arg0 ) {
      dialog.dispose();
    }
  } );
}
 
Example 4
Source File: SapInputAboutDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
/**
 * build Ok Button.
 */
protected void buildOkButton() {
  Button ok = new Button( this.dialog, SWT.PUSH );
  ok.setText( BaseMessages.getString( PKG, "SapInputDialog.About.Plugin.Close" ) );
  GridData grdData = new GridData( GridData.HORIZONTAL_ALIGN_CENTER );
  grdData.horizontalSpan = 2;
  grdData.verticalIndent = DEFAULT_INDENT;
  grdData.horizontalIndent = DEFAULT_INDENT;
  ok.setLayoutData( grdData );

  ok.addListener( SWT.Selection, new Listener() {
    public void handleEvent( Event arg0 ) {
      dialog.dispose();
    }
  } );
}
 
Example 5
Source File: DoubleBufferedLabel.java    From BiglyBT with GNU General Public License v2.0 4 votes vote down vote up
public DoubleBufferedLabel(
	Composite 	parent,
	int 		style )
{
	super( parent, style | SWT.DOUBLE_BUFFERED );

	this.style = style;
			
		// only support GridLayout I'm afraid...

	GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_FILL);

	setLayoutData(gridData);

	addPaintListener(this);
}