/** * 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 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(); } } ); }
@Override protected Control addAdditionalComponentIfNeed( int middle, int margin, Composite wFileComp, Composite topComp ) { // Run this as a command instead? wlFileIsCommand = new Label( wFileComp, SWT.RIGHT ); wlFileIsCommand .setText( BaseMessages.getString( textFileOutputLegacyMetaClass, "TextFileOutputLegacyDialog.FileIsCommand.Label" ) ); props.setLook( wlFileIsCommand ); fdlFileIsCommand = new FormData(); fdlFileIsCommand.left = new FormAttachment( 0, 0 ); fdlFileIsCommand.top = new FormAttachment( topComp, margin ); fdlFileIsCommand.right = new FormAttachment( middle, -margin ); wlFileIsCommand.setLayoutData( fdlFileIsCommand ); wFileIsCommand = new Button( wFileComp, SWT.CHECK ); props.setLook( wFileIsCommand ); fdFileIsCommand = new FormData(); fdFileIsCommand.left = new FormAttachment( middle, 0 ); fdFileIsCommand.top = new FormAttachment( topComp, margin ); fdFileIsCommand.right = new FormAttachment( 100, 0 ); wFileIsCommand.setLayoutData( fdFileIsCommand ); wFileIsCommand.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { input.setChanged(); enableParentFolder(); } } ); return wlFileIsCommand; }
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(); } } );
Label lIcon = new Label( shell, SWT.RIGHT ); lIcon.setLayoutData( new FormDataBuilder().right().result() ); lIcon.setImage( JobDialog.getImage( shell, JobDialog.getPlugin( getEntry() ) ) ); wCancel = new Button( shell, SWT.PUSH ); wCancel.setText( systemMessages.getString( "Button.Cancel" ) ); wCancel.setLayoutData( new FormDataBuilder().bottom().right().width( BUTTON_WIDTH ).result() ); wOK = new Button( shell, SWT.PUSH ); wOK.setText( systemMessages.getString( "Button.OK" ) ); wOK.setLayoutData( new FormDataBuilder().bottom().right( wCancel, -ConstUI.SMALL_MARGIN ).width( BUTTON_WIDTH ) .result() ); wCancel.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) { cancel(); wOK.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) { ok();
public CheckBox( Composite composite ) { super( composite, SWT.NONE ); WidgetUtils.setFormLayout( this, 0 ); button = new Button( this, SWT.CHECK ); button.setLayoutData( new FormDataBuilder().left().result() ); label = new Label( this, SWT.LEFT ); label.setLayoutData( new FormDataBuilder().left( button, ConstUI.SMALL_MARGIN ).result() ); }
protected Button buildGetFieldsButton( final Composite parent, final SelectionAdapter listener ) { // get fields button wGet = new Button( parent, SWT.PUSH ); updateGetFieldsButtonStatus(); wGet.setText( BaseMessages.getString( PKG, "CommonStepDialog.Button.GetFields" ) ); //$NON-NLS-1$ props.setLook( wGet ); wGet.setLayoutData( new FormDataBuilder().right( 100, 0 ).bottom( 100, 0 ).result() ); wGet.addSelectionListener( listener ); return wGet; }
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 );
check = new Button( parent, SWT.CHECK ); check.setText( "Stack" ); check.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) { toggleStackTrace(); start = new Button( parent, SWT.PUSH ); start.setText( "Snap" ); start.addListener( SWT.Selection, new Listener() { public void handleEvent( Event event ) { refreshAll(); stop = new Button( parent, SWT.PUSH ); stop.setText( "Diff" ); stop.addListener( SWT.Selection, new Listener() { public void handleEvent( Event event ) { refreshDifference(); label = new Label( parent, SWT.BORDER ); label.setText( "0 object(s)" ); parent.addListener( SWT.Resize, new Listener() { public void handleEvent( Event e ) {
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)); }
private Control addFieldSelection( Control lastControl ) { UpInsRows, lsMod, props ); Button wGetFields = new Button( shell, SWT.PUSH ); wGetFields.setText( BaseMessages.getString( PKG, "IngresVectorWiseLoaderDialog.GetFields.Button" ) ); FormData fdGetFields = new FormData(); fdGetFields.top = new FormAttachment( wlFields, margin ); Button wDoMapping = new Button( shell, SWT.PUSH ); wDoMapping.setText( BaseMessages.getString( PKG, "IngresVectorWiseLoaderDialog.DoMapping.Button" ) ); FormData fdDoMapping = new FormData(); wDoMapping.setLayoutData( fdDoMapping ); wGetFields.addListener( SWT.Selection, new Listener() { public void handleEvent( Event e ) { get(); wDoMapping.addListener( SWT.Selection, new Listener() { public void handleEvent( Event arg0 ) { generateMappings();
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));
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(); } } ); }