@Override protected void initData(Composite dataComposite) { Label label = new Label(dataComposite, SWT.NONE); label.setText(RedisClient.i18nFile.getText(I18nFile.VALUE)); label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true, 1, 1)); text_value = new Text(dataComposite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI); text_value.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1)); } public Text getText() {
@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(); } } );
private void layoutComposite() { FormLayout flAuthComp = new FormLayout(); this.setLayout( flAuthComp ); wAuthGroup.setText( authGroupLabel ); FormLayout flAuthGroup = new FormLayout(); flAuthGroup.marginHeight = 15; flAuthGroup.marginWidth = 15; wlUsername = new Label( wAuthGroup, SWT.LEFT ); props.setLook( wlUsername ); wlUsername.setText( usernameLabel ); wlUsername.setLayoutData( new FormDataBuilder().left().top().result() ); wlPassword = new Label( wAuthGroup, SWT.LEFT ); props.setLook( wlPassword ); wlPassword.setText( passwordLabel ); wlPassword.setLayoutData( new FormDataBuilder().left().top( wUsername, ConstUI.MEDUIM_MARGIN ).result() );
public LabelText( Composite composite, int textStyle, String labelText, String toolTipText, int middle, int margin ) { super( composite, SWT.NONE ); props.setLook( this ); FormLayout formLayout = new FormLayout(); formLayout.marginWidth = 0; formLayout.marginHeight = 0; this.setLayout( formLayout ); wText = new Text( this, textStyle ); FormData fdText = new FormData(); fdText.left = new FormAttachment( middle, margin ); fdText.right = new FormAttachment( 100, 0 ); wText.setLayoutData( fdText ); wText.setToolTipText( toolTipText ); wLabel = new Label( this, SWT.RIGHT ); props.setLook( wLabel ); wLabel.setText( labelText ); FormData fdLabel = new FormData(); fdLabel.left = new FormAttachment( 0, 0 ); fdLabel.right = new FormAttachment( middle, 0 ); fdLabel.top = new FormAttachment( wText, 0, SWT.CENTER ); wLabel.setLayoutData( fdLabel ); wLabel.setToolTipText( toolTipText ); }
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 Label addStandardLabel( String messageString, Control previousControl ) { Label label = new Label( shell, SWT.RIGHT ); label.setText( messageString ); label.setLayoutData( standardLabelSpacing( previousControl, label ) ); props.setLook( label ); return label; }
protected void initObjectTabItem() { RedisObject object = service.getObjectInfo(id, db, key); objectTabItem = new TabItem(tabFolder, SWT.NONE); objectTabItem.setText(RedisClient.i18nFile.getText(I18nFile.OBJECT)); Composite objectComposite = new Composite(tabFolder, SWT.NONE); objectTabItem.setControl(objectComposite); objectComposite.setLayout(new GridLayout(4, true)); label1 = new Label(objectComposite, SWT.NONE); label1.setText(RedisClient.i18nFile.getText(I18nFile.REFCOUNT)); Label label_1 = new Label(objectComposite, SWT.NONE); label_1.setText(object.getRefCount().toString()); label2 = new Label(objectComposite, SWT.NONE); label2.setText(RedisClient.i18nFile.getText(I18nFile.ENCODING)); Label label_2 = new Label(objectComposite, SWT.NONE); label_2.setText(object.getEncoding()); }
private void setWarningIcon( Display display ) { warningIcon = new Label( shell, SWT.NONE ); Image image = display.getSystemImage( SWT.ICON_WARNING ); warningIcon.setImage( image ); props.setLook( warningIcon ); FormData fdIcon = new FormData(); fdIcon.left = new FormAttachment( 0, 0 ); fdIcon.top = new FormAttachment( 0, 0 ); fdIcon.right = new FormAttachment( 0, image.getBounds().width ); fdIcon.bottom = new FormAttachment( 0, image.getBounds().height ); //icon should be at the top left corner warningIcon.setLayoutData( fdIcon ); }
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));
new Label( dialogto, SWT.NONE ); new Label( dialogto, SWT.NONE ); Button okto = new Button( dialogto, SWT.PUSH ); okto.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); okto.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, false, false ) ); okto.addSelectionListener( new SelectionAdapter() {
private Label addStandardLabel( String messageString, Control previousControl ) { Label label = new Label( shell, SWT.RIGHT ); label.setText( messageString ); label.setLayoutData( standardLabelSpacing( previousControl ) ); props.setLook( label ); return label; }
public Composite getComposite( Composite parent, ImportRuleInterface importRule ) { PropsUI props = PropsUI.getInstance(); composite = new Composite( parent, SWT.NONE ); props.setLook( composite ); composite.setLayout( new FillLayout() ); Label label = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); props.setLook( label ); label.setText( "Minimum length: " ); text = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); props.setLook( text ); return composite; }
private void placeControl( Shell pShell, String text, Control control, Control under ) { int middle = props.getMiddlePct(); int margin = Const.MARGIN; Label label = new Label( pShell, SWT.RIGHT ); label.setText( text ); props.setLook( label ); FormData formDataLabel = new FormData(); formDataLabel.left = new FormAttachment( 0, 0 ); if ( under != null ) { formDataLabel.top = new FormAttachment( under, margin ); } else { formDataLabel.top = new FormAttachment( 0, 0 ); } formDataLabel.right = new FormAttachment( middle, 0 ); label.setLayoutData( formDataLabel ); props.setLook( control ); FormData formDataControl = new FormData(); formDataControl.left = new FormAttachment( middle, 0 ); if ( under != null ) { formDataControl.top = new FormAttachment( under, margin ); } else { formDataControl.top = new FormAttachment( 0, 0 ); } formDataControl.right = new FormAttachment( 100, 0 ); control.setLayoutData( formDataControl ); }
ttlComposite.setLayout(new GridLayout(2, false)); btnExpire = new Button(ttlComposite, SWT.CHECK); btnExpire.setText(RedisClient.i18nFile.getText(I18nFile.EXPIRE)); labelTTL = new Label(ttlComposite, SWT.NONE); labelTTL.setEnabled(false); labelTTL.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); labelTTL.setText(RedisClient.i18nFile.getText(I18nFile.TTLS));
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(); } } );
@Override protected Control buildBody() { final Label message = new Label( shell, SWT.WRAP | SWT.LEFT ); message.setText( this.message ); props.setLook( message ); message.setLayoutData( new FormDataBuilder().top().left().right( 100, 0 ).result() ); return message; } }