private void setCloseButton() { closeButton = new Button( shell, SWT.PUSH ); closeButton.setText( BaseMessages.getString( PKG, "System.Button.Close" ) ); FormData fdbutton = new FormData(); fdbutton.right = new FormAttachment( 100, 0 ); //Button should below the link and separated by 30 fdbutton.top = new FormAttachment( link, padding ); fdbutton.height = padding; closeButton.setLayoutData( fdbutton ); props.setLook( closeButton ); // Add listeners closeButton.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) { close(); } } ); }
/** * 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(); } } ); }
private void buildWidget() { wCheckBox = new Button( parentComposite, SWT.CHECK ); wCheckBox.setText( buttonName ); props.setLook( wCheckBox ); FormData fdUseSSL = new FormData(); fdUseSSL.top = new FormAttachment( parentComposite, 0 ); fdUseSSL.left = new FormAttachment( 0, 0 ); wCheckBox.setLayoutData( fdUseSSL ); wCheckBox.addSelectionListener( new SelectionListener() { Label wlSSLProperties = new Label( parentComposite, SWT.LEFT ); wlSSLProperties.setText( tableName ); props.setLook( wlSSLProperties ); FormData fdlSSLProperties = new FormData(); fdlSSLProperties.top = new FormAttachment( wCheckBox, 10 ); fdlSSLProperties.left = new FormAttachment( 0, 0 ); wlSSLProperties.setLayoutData( fdlSSLProperties );
public Composite getComposite( Composite parent, ImportRuleInterface importRule ) { rule = (DatabaseConfigurationImportRule) importRule; databaseMeta = rule.getDatabaseMeta(); PropsUI props = PropsUI.getInstance(); composite = new Composite( parent, SWT.NONE ); props.setLook( composite ); composite.setLayout( new FillLayout() ); label = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); props.setLook( label ); label.setText( "Database configuration : (not configured)" ); button = new Button( composite, SWT.PUSH ); button.setText( "Edit..." ); button.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent event ) { editDatabase(); } } ); return composite; }
public void widgetSelected( SelectionEvent e ) { final Shell dialog = new Shell( shell, SWT.DIALOG_TRIM ); dialog.setText( BaseMessages.getString( PKG, "JobGetPOP.SelectDate" ) ); dialog.setImage( GUIResource.getInstance().getImageSpoon() ); dialog.setLayout( new GridLayout( 3, false ) ); final DateTime calendar = new DateTime( dialog, SWT.CALENDAR ); final DateTime time = new DateTime( dialog, SWT.TIME | SWT.TIME ); new Label( dialog, SWT.NONE ); new Label( dialog, SWT.NONE ); Button ok = new Button( dialog, SWT.PUSH ); ok.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); ok.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) ); ok.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { Calendar cal = Calendar.getInstance(); cal.set( Calendar.YEAR, calendar.getYear() ); cal.set( Calendar.MONTH, calendar.getMonth() ); cal.set( Calendar.DAY_OF_MONTH, calendar.getDay() ); cal.set( Calendar.HOUR_OF_DAY, time.getHours() ); cal.set( Calendar.MINUTE, time.getMinutes() ); cal.set( Calendar.SECOND, time.getSeconds() ); wReadFrom.setText( new SimpleDateFormat( JobEntryGetPOP.DATE_PATTERN ).format( cal.getTime() ) ); dialog.close(); } } ); dialog.setDefaultButton( ok ); dialog.pack(); dialog.open(); } } );
shell.setImage( GUIResource.getInstance().getImageSpoon() ); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = Const.FORM_MARGIN; formLayout.marginHeight = Const.FORM_MARGIN; wClose = new Button( shell, SWT.PUSH ); wClose.setText( BaseMessages.getString( PKG, "System.Button.Close" ) ); wClose.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) {
/** * Setting the layout of an <i>Edit</i> option button. Either a button image is set - if existing - or a text. * * @param button * The button */ private FormData layoutEditOptionButton( Button button ) { FormData fd = new FormData(); Image editButton = GUIResource.getInstance().getEditOptionButton(); if ( editButton != null ) { button.setImage( editButton ); button.setBackground( GUIResource.getInstance().getColorWhite() ); fd.width = editButton.getBounds().width + 20; fd.height = editButton.getBounds().height; } else { button.setText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Edit" ) ); } button.setToolTipText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Edit.Tooltip" ) ); return fd; }
props.setLook( composite ); FormLayout compLayout = new FormLayout(); compLayout.marginHeight = Const.FORM_MARGIN; compLayout.marginWidth = Const.FORM_MARGIN; wlPassword = new Label( composite, SWT.RIGHT ); wlPassword.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPage2.Password.Label" ) ); props.setLook( wlPassword ); fdlPassword = new FormData(); wlPassword.setLayoutData( fdlPassword ); wPassword = new Text( composite, SWT.SINGLE | SWT.BORDER ); props.setLook( wPassword ); wTest = new Button( composite, SWT.PUSH ); wTest.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPage2.TestConnection.Button" ) );
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); Label lblNewLabel = new Label(composite, SWT.WRAP); lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); lblNewLabel.setText(RedisClient.i18nFile.getText(I18nFile.DONATIONMESSAGE)); Label label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1)); label.setAlignment(SWT.CENTER); label.setImage(code); composite_1.setLayout(new FillLayout(SWT.HORIZONTAL)); Button btnOk = new Button(composite_1, SWT.NONE); btnOk.addSelectionListener(new SelectionAdapter() { @Override btnOk.setText(RedisClient.i18nFile.getText(I18nFile.OK));
protected Button createSettingsButton( Composite p, String text, String title, Control top, SelectionAdapter sa ) { Button button = new Button( p, SWT.CHECK ); button.setText( BaseMessages.getString( PKG, text ) ); button.setToolTipText( BaseMessages.getString( PKG, title ) ); props.setLook( button ); FormData fd = new FormData(); fd.left = new FormAttachment( 0, Const.MARGIN * 2 ); if ( top == null ) { fd.top = new FormAttachment( 0, 10 ); } else { fd.top = new FormAttachment( top, 5 ); } fd.right = new FormAttachment( 100, 0 ); button.setLayoutData( fd ); button.addSelectionListener( sa ); return button; }
public void widgetSelected( SelectionEvent e ) { final Shell dialog = new Shell( shell, SWT.DIALOG_TRIM ); dialog.setText( BaseMessages.getString( PKG, "MailInput.SelectDate" ) ); dialog.setImage( GUIResource.getInstance().getImageSpoon() ); dialog.setLayout( new GridLayout( 3, false ) ); final DateTime calendar = new DateTime( dialog, SWT.CALENDAR ); final DateTime time = new DateTime( dialog, SWT.TIME | SWT.TIME ); new Label( dialog, SWT.NONE ); new Label( dialog, SWT.NONE ); Button ok = new Button( dialog, SWT.PUSH ); ok.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); ok.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) ); ok.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { Calendar cal = Calendar.getInstance(); cal.set( Calendar.YEAR, calendar.getYear() ); cal.set( Calendar.MONTH, calendar.getMonth() ); cal.set( Calendar.DAY_OF_MONTH, calendar.getDay() ); cal.set( Calendar.HOUR_OF_DAY, time.getHours() ); cal.set( Calendar.MINUTE, time.getMinutes() ); cal.set( Calendar.SECOND, time.getSeconds() ); wReadFrom.setText( new SimpleDateFormat( MailInputMeta.DATE_PATTERN ).format( cal.getTime() ) ); dialog.close(); } } ); dialog.setDefaultButton( ok ); dialog.pack(); dialog.open(); } } );
/** * 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(); } } ); }
protected void initContents() { Composite composite_1 = new Composite(shell, SWT.NONE); composite_1.setLayout(new FillLayout(SWT.HORIZONTAL)); composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1)); btnOk = new Button(composite_1, SWT.NONE); btnOk.addSelectionListener(okSelection); btnOk.setText(RedisClient.i18nFile.getText(I18nFile.OK)); Button btnCancel = new Button(composite_1, SWT.NONE); btnCancel.addSelectionListener(cancelSelection); btnCancel.setText(RedisClient.i18nFile.getText(I18nFile.CANCEL)); }
/** * Setting the layout of a <i>Reset</i> option button. Either a button image is set - if existing - or a text. * * @param button * The button */ private FormData layoutResetOptionButton( Button button ) { FormData fd = new FormData(); Image editButton = GUIResource.getInstance().getResetOptionButton(); if ( editButton != null ) { button.setImage( editButton ); button.setBackground( GUIResource.getInstance().getColorWhite() ); fd.width = editButton.getBounds().width + 20; fd.height = editButton.getBounds().height; } else { button.setText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Reset" ) ); } button.setToolTipText( BaseMessages.getString( PKG, "EnterOptionsDialog.Button.Reset.Tooltip" ) ); return fd; }
protected void optionsSectionControls() { wClearLog = new Button( gDetails, SWT.CHECK ); wClearLog.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.ClearLog.Label" ) ); wClearLog.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.ClearLog.Tooltip" ) ); props.setLook( wClearLog ); FormData fdClearLog = new FormData(); fdClearLog.top = new FormAttachment( 0, 10 ); fdClearLog.left = new FormAttachment( 0, 10 ); wClearLog.setLayoutData( fdClearLog ); wSafeMode = new Button( gDetails, SWT.CHECK ); wSafeMode.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.SafeMode.Label" ) ); FormData fdSafeMode = new FormData(); fdSafeMode.top = new FormAttachment( wClearLog, 7 ); wGatherMetrics = new Button( gDetails, SWT.CHECK ); wGatherMetrics.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.GatherMetrics.Label" ) ); props.setLook( wGatherMetrics ); FormData fdGatherMetrics = new FormData(); wGatherMetrics.setLayoutData( fdGatherMetrics ); wlLogLevel = new Label( gDetails, SWT.NONE ); props.setLook( wlLogLevel ); wlLogLevel.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.LogLevel.Label" ) ); wlLogLevel.setLayoutData( fdlLogLevel );
composite.setLayout(new GridLayout(2, false)); btnExpire = new Button(composite, SWT.CHECK); btnExpire.setText(RedisClient.i18nFile.getText(I18nFile.EXPIRE)); labelTTL = new Label(composite, SWT.NONE); labelTTL.setEnabled(false); labelTTL.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); labelTTL.setText(RedisClient.i18nFile.getText(I18nFile.TTLS));
private static Button newButton( final Composite parent ) { Button button = new Button( parent, SWT.PUSH ); button.setImage( GUIResource.getInstance().getImageHelpWeb() ); button.setText( BaseMessages.getString( PKG, "System.Button.Help" ) ); button.setToolTipText( BaseMessages.getString( PKG, "System.Tooltip.Help" ) ); FormData fdButton = new FormData(); fdButton.left = new FormAttachment( 0, 0 ); fdButton.bottom = new FormAttachment( 100, 0 ); button.setLayoutData( fdButton ); return button; }
@Override public void widgetSelected( SelectionEvent e ) { final Shell dialog = new Shell( shell, SWT.DIALOG_TRIM ); dialog.setText( BaseMessages.getString( PKG, "SalesforceInputDialog.SelectDate" ) ); dialog.setImage( GUIResource.getInstance().getImageSpoon() ); dialog.setLayout( new GridLayout( 3, false ) ); new Label( dialog, SWT.NONE ); new Label( dialog, SWT.NONE ); Button ok = new Button( dialog, SWT.PUSH ); ok.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); ok.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) ); ok.addSelectionListener( new SelectionAdapter() {
/** * 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(); } } ); }