Refine search
@Override protected Control createMessageArea( Composite composite ) { GridLayout gridLayout = (GridLayout) composite.getLayout(); gridLayout.numColumns = 1; composite.setLayout( gridLayout ); if ( this.message != null ) { this.messageLabel = new Label( composite, this.getMessageLabelStyle() ); this.messageLabel.setText( this.message ); } if ( this.details != null ) { this.detailsText = new Text( composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL ); this.detailsText.pack(); this.detailsText.setText( this.details ); GridData gridData = new GridData( ); gridData.widthHint = 1024; gridData.heightHint = 300; this.detailsText.setLayoutData( gridData ); this.detailsText.setSelection( this.details.length() ); } return composite; }
public void modifyText( ModifyEvent e ) { if ( searchText.getText() != null && searchText.getText().length() > 0 ) { btnNext.setEnabled( true ); } else { btnNext.setEnabled( false ); } } } );
/** * Add a modify listener to the text widget * * @param modifyListener */ public void addModifyListener( ModifyListener modifyListener ) { wText.addModifyListener( modifyListener ); }
Display display = parent.getDisplay(); final Font largeFont = GUIResource.getInstance().getFontBold(); final Color gray = GUIResource.getInstance().getColorDemoGray(); new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN | SWT.APPLICATION_MODAL | SWT.SHEET ); wDesc = new Text( shell, SWT.MULTI | SWT.LEFT | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL ); wDesc.setText( exMsgFunction.apply( text.toString() ) ); } else { text.append( message ); wDesc.setText( exMsgFunction.apply( text.toString() ) ); wDesc.setBackground( gray ); fdDesc = new FormData(); fdDesc.left = new FormAttachment( 0, 0 ); wDesc.setLayoutData( fdDesc ); wDesc.setEditable( false ); wDesc.addSelectionListener( lsDef ); if ( !display.readAndDispatch() ) { display.sleep();
public int open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX ); props.setLook( shell ); formLayout.marginHeight = 15; shell.setLayout( formLayout ); Image image = display.getSystemImage( SWT.ICON_WARNING ); wcMessage.setLayout( new GridLayout() ); Text wlMessage = new Text( wcMessage, SWT.MULTI | SWT.WRAP ); props.setLook( wlMessage ); wlMessage.setText( BaseMessages.getString( PKG, "RunConfigurationDeleteDialog.Label.Confirmation" ) ); GridData gdlLocal = new GridData( GridData.FILL_HORIZONTAL ); gdlLocal.widthHint = 300; wlMessage.setLayoutData( gdlLocal ); wcMessage.setLayoutData( fdcMessage ); if ( !display.readAndDispatch() ) { display.sleep();
public void open() { display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); formLayout.marginHeight = Const.FORM_MARGIN; shell.setText( BaseMessages.getString( PKG, "RepositoryImportDialog.Title" ) ); shell.setImage( GUIResource.getInstance().getImageSpoon() ); shell.setLayout( formLayout ); wLabel = new Label( shell, SWT.LEFT ); props.setLook( wLabel ); wClose = new Button( shell, SWT.PUSH ); wClose.setText( BaseMessages.getString( PKG, "System.Button.Close" ) ); wLogging = new Text( shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL ); props.setLook( wLabel ); fdLogging.right = new FormAttachment( 100, 0 ); fdLogging.bottom = new FormAttachment( wClose, -Const.MARGIN ); wLogging.setLayoutData( fdLogging ); display.asyncExec( new Runnable() { public void run() {
private Text createLine( ModifyListener lsMod, String lableText, Control prevControl ) { // Value line Label lable = new Label( shell, SWT.RIGHT ); lable.setText( lableText ); props.setLook( lable ); FormData lableFormData = new FormData(); lableFormData.left = new FormAttachment( 0, 0 ); lableFormData.right = new FormAttachment( props.getMiddlePct(), -Const.MARGIN ); // In case it is the first control if ( prevControl != null ) { lableFormData.top = new FormAttachment( prevControl, Const.MARGIN ); } else { lableFormData.top = new FormAttachment( 0, Const.MARGIN ); } lable.setLayoutData( lableFormData ); Text control = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( control ); control.addModifyListener( lsMod ); FormData widgetFormData = new FormData(); widgetFormData.left = new FormAttachment( props.getMiddlePct(), 0 ); // In case it is the first control if ( prevControl != null ) { widgetFormData.top = new FormAttachment( prevControl, Const.MARGIN ); } else { widgetFormData.top = new FormAttachment( 0, Const.MARGIN ); } widgetFormData.right = new FormAttachment( 100, 0 ); control.setLayoutData( widgetFormData ); return control; }
private void setTabFlags( Button wMainPath, Label wlInputStep, Text wInputStep, Button wbInputStep, Label wlOutputStep, Text wOutputStep, Button wbOutputStep, Label wlDescription, Text wDescription ) { boolean mainPath = wMainPath.getSelection(); wlInputStep.setEnabled( !mainPath ); wInputStep.setEnabled( !mainPath ); wbInputStep.setEnabled( !mainPath ); wlOutputStep.setEnabled( !mainPath ); wOutputStep.setEnabled( !mainPath ); wbOutputStep.setEnabled( !mainPath ); wlDescription.setEnabled( !mainPath ); wDescription.setEnabled( !mainPath ); }
wlTransname = new Label( composite, SWT.RIGHT ); wlTransname.setText( BaseMessages.getString( PKG, "CopyTableWizardPage3.Dialog.JobName.Label" ) ); props.setLook( wlTransname ); fdlTransname = new FormData(); fdlTransname.left = new FormAttachment( 0, 0 ); fdlTransname.right = new FormAttachment( middle, -margin ); fdlTransname.top = new FormAttachment( 0, margin ); wlTransname.setLayoutData( fdlTransname ); wTransname = new Text( composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wTransname ); wTransname.addModifyListener( lsMod ); wTransname.setLayoutData( fdTransname ); wbDirectory = new Button( composite, SWT.PUSH ); wbDirectory.setText( BaseMessages.getString( PKG, "CopyTableWizardPage3.Dialog.DirectoryButton.Label" ) ); props.setLook( wbDirectory ); wbDirectory.setLayoutData( fdbDirectory ); wDirectory = new Text( composite, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wDirectory ); wDirectory.setEditable( false ); wDirectory.setLayoutData( fdDirectory );
shell.setText(RedisClient.i18nFile.getText(I18nFile.UPDATEFAVORITE)); shell.setLayout(new GridLayout(1, false)); composite.setLayout(new GridLayout(2, false)); Label lblNewKey = new Label(composite, SWT.NONE); lblNewKey.setText(RedisClient.i18nFile.getText(I18nFile.NAME)); final Text text_2 = new Text(composite, SWT.BORDER); text_2.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); text_2.setText(oldFavorite.getName()); text_2.selectAll(); text_2.setFocus(); Label lblFavorite = new Label(composite, SWT.NONE); lblFavorite.setText(RedisClient.i18nFile.getText(I18nFile.FAVORITE)); text = new Text(composite, SWT.BORDER); text.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); text.setEditable(false); text.setText(oldFavorite.getFavorite()); button.setText(RedisClient.i18nFile.getText(I18nFile.OK)); Button button_1 = new Button(composite_1, SWT.NONE);
private void initNamespace(TabFolder tabFolder) { TabItem tbtmNamespace = new TabItem(tabFolder, SWT.NONE); tbtmNamespace.setText(RedisClient.i18nFile.getText(I18nFile.NAMESPACE)); Composite composite = new Composite(tabFolder, SWT.NONE); tbtmNamespace.setControl(composite); composite.setLayout(new GridLayout(2, false)); Label lblSeparator = new Label(composite, SWT.NONE); lblSeparator.setText(RedisClient.i18nFile.getText(I18nFile.SEPARATOR)); separator = new Text(composite, SWT.BORDER); separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); separator.setText(ConfigFile.getSeparator()); separator.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { separator.setData(true); } }); separator.setData(false); }
private void buildHeader() { buildPreHeader(); // Step icon final Label wicon = new Label( shell, SWT.RIGHT ); wicon.setImage( getImage() ); wicon.setLayoutData( new FormDataBuilder().top( 0, -BaseDialog.LABEL_SPACING ).right( 100, 0 ).result() ); props.setLook( wicon ); // Step name label wlStepname = new Label( shell, SWT.RIGHT ); wlStepname.setText( BaseMessages.getString( PKG, "CommonStepDialog.Stepname.Label" ) ); //$NON-NLS-1$ props.setLook( wlStepname ); fdlStepname = new FormDataBuilder().left( 0, 0 ).top( 0, -BaseDialog.LABEL_SPACING ).result(); wlStepname.setLayoutData( fdlStepname ); // Step name field wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wStepname.setText( stepname ); props.setLook( wStepname ); wStepname.addModifyListener( lsMod ); wStepname.addSelectionListener( lsDef ); fdStepname = new FormDataBuilder().width( BaseDialog.MEDIUM_FIELD ).left( 0, 0 ).top( wlStepname, BaseDialog.LABEL_SPACING ).result(); wStepname.setLayoutData( fdStepname ); // horizontal separator between step name and tabs headerSpacer = new Label( shell, SWT.HORIZONTAL | SWT.SEPARATOR ); props.setLook( headerSpacer ); headerSpacer.setLayoutData( new FormDataBuilder().left().right( 100, 0 ).top( wStepname, BaseDialog.MARGIN_SIZE ).width( SHELL_WIDTH - 2 * ( BaseDialog.MARGIN_SIZE ) ).result() ); buildPostHeader(); }
protected Composite initDataTabItem(){ dataTabItem = new TabItem(tabFolder, SWT.NONE); dataTabItem.setText(RedisClient.i18nFile.getText(dataTitle)); Composite dataComposite = new Composite(tabFolder, SWT.NONE); dataTabItem.setControl(dataComposite); dataComposite.setLayout(new GridLayout(4, true)); label = new Label(dataComposite, SWT.NONE); label.setText(RedisClient.i18nFile.getText(I18nFile.SERVER)); Label label_1 = new Label(dataComposite, SWT.NONE); label_1.setText(server); label_2 = new Label(dataComposite, SWT.NONE); label_2.setText(RedisClient.i18nFile.getText(I18nFile.DATABASE)); Label label_3 = new Label(dataComposite, SWT.NONE); label_3.setText(String.valueOf(db)); lblKey = new Label(dataComposite, SWT.NONE); lblKey.setText(RedisClient.i18nFile.getText(I18nFile.KEY)); inputKey = new Text(dataComposite, SWT.BORDER); inputKey.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1)); inputKey.setText(key); inputKey.selectAll(); inputKey.setFocus(); return dataComposite; }
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 ); }
@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() {
private void setWarningText( String message, int maxTextWidth ) { description = new Text( shell, SWT.MULTI | SWT.LEFT | SWT.WRAP | SWT.NO_FOCUS | SWT.HIDE_SELECTION ); description.setText( message ); description.setEditable( false ); FormData fdlDesc = new FormData(); fdlDesc.left = new FormAttachment( warningIcon, margin ); // Text should be right of the icon and at the top fdlDesc.top = new FormAttachment( 0, 0 ); fdlDesc.width = maxTextWidth; description.setLayoutData( fdlDesc ); props.setLook( description ); }
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; }