@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 ); }
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; }
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)); ttl = new Text(composite, SWT.BORDER); ttl.setEnabled(false); ttl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
this.setLayout( formLayout ); Button button = new Button( this, SWT.PUSH ); PropsUI.getInstance().setLook( button ); button.setText( "..." ); FormData fdButton = new FormData(); fdButton.top = new FormAttachment( 0, 0 ); fdButton.right = new FormAttachment( 100, 0 ); fdButton.height = 25; fdButton.width = 30; wText = new Text( this, flags ); controlDecoration = new ControlDecoration( wText, SWT.CENTER | SWT.RIGHT, this ); Image image = GUIResource.getInstance().getImageVariable(); wText.addKeyListener( controlSpaceKeyAdapter ); FormData fdText = new FormData(); fdText.top = new FormAttachment( 0, 0 ); fdText.left = new FormAttachment( 0, 0 ); fdText.right = new FormAttachment( button, -image.getBounds().width ); wText.setLayoutData( fdText );
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 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; }
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)); ttl = new Text(ttlComposite, SWT.BORDER); ttl.setEnabled(false); ttl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
FormData fdSash = new FormData(); fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner fdSash.top = new FormAttachment( 0, 0 ); fdSash.right = new FormAttachment( 100, 0 ); fdSash.bottom = new FormAttachment( 100, 0 ); sash.setLayoutData( fdSash ); logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY ); spoon.props.setLook( logDisplayText ); logDisplayText.setVisible( true ); FormData fdText = new FormData(); fdText.left = new FormAttachment( 0, 0 ); fdText.top = new FormAttachment( 0, 0 ); fdText.right = new FormAttachment( 100, 0 ); fdText.bottom = new FormAttachment( 100, 0 ); logDisplayText.setLayoutData( fdText );
schemaText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); props.setLook( schemaText ); FormData fdSchemaText = new FormData(); fdSchemaText.left = new FormAttachment( schemaLabel, Const.MARGIN ); schemaText.setLayoutData( fdSchemaText ); Label tableLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); props.setLook( tableLabel ); tableLabel.setText( "Table " ); FormData fdTableLabel = new FormData(); tableLabel.setLayoutData( fdTableLabel ); tableText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); tableText.setLayoutData( fdTableText ); Label connectionLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); props.setLook( connectionLabel ); connectionLabel.setText( "Connection " ); connectionLabel.setLayoutData( fdConnectionLabel ); connectionText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT ); connectionText.setLayoutData( fdConnectionText );
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); }
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 button = new Button(composite_1, SWT.NONE); button.addMouseListener(new MouseAdapter() { @Override button.setText(RedisClient.i18nFile.getText(I18nFile.OK)); button_1.setText(RedisClient.i18nFile.getText(I18nFile.CANCEL)); super.createContents();
FormData fdSash = new FormData(); fdSash.left = new FormAttachment( 0, 0 ); // First one in the left top corner fdSash.top = new FormAttachment( 0, 0 ); fdSash.right = new FormAttachment( 100, 0 ); fdSash.bottom = new FormAttachment( 100, 0 ); sash.setLayoutData( fdSash ); logDisplayText = new Text( sash, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY ); spoon.props.setLook( logDisplayText ); logDisplayText.setVisible( true ); FormData fdText = new FormData(); fdText.left = new FormAttachment( 0, 0 ); fdText.top = new FormAttachment( 0, 0 ); fdText.right = new FormAttachment( 100, 0 ); fdText.bottom = new FormAttachment( 100, 0 ); logDisplayText.setLayoutData( fdText );
composite.setLayout( compLayout ); wlServername = new Label( composite, SWT.RIGHT ); wlServername.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageInformix.Servername.Label" ) ); props.setLook( wlServername ); fdlServername = new FormData(); fdlServername.top = new FormAttachment( 0, 0 ); fdlServername.left = new FormAttachment( 0, 0 ); fdlServername.right = new FormAttachment( middle, 0 ); wlServername.setLayoutData( fdlServername ); wServername = new Text( composite, SWT.SINGLE | SWT.BORDER ); props.setLook( wServername ); fdServername = new FormData(); fdServername.top = new FormAttachment( 0, 0 ); fdServername.left = new FormAttachment( middle, margin ); fdServername.right = new FormAttachment( 100, 0 ); wServername.setLayoutData( fdServername ); wServername.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent arg0 ) {
private void initPaging(TabFolder tabFolder) { TabItem tbtmPaging = new TabItem(tabFolder, SWT.NONE); tbtmPaging.setText(RedisClient.i18nFile.getText(I18nFile.PAGING)); Composite composite = new Composite(tabFolder, SWT.NONE); tbtmPaging.setControl(composite); composite.setLayout(new GridLayout(2, false)); Label lblPaging = new Label(composite, SWT.NONE); lblPaging.setText(RedisClient.i18nFile.getText(I18nFile.PAGESIZE)); size = new Text(composite, SWT.BORDER); size.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); size.setText(String.valueOf(ConfigFile.getPagesize())); size.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { size.setData(true); } }); size.setData(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(container==null?"": container); text_2.selectAll(); composite_1.setLayout(new FillLayout(SWT.HORIZONTAL)); Button button = new Button(composite_1, SWT.NONE); button.addMouseListener(new MouseAdapter() { @Override button.setText(RedisClient.i18nFile.getText(I18nFile.OK)); Button button_1 = new Button(composite_1, SWT.NONE); button_1.addMouseListener(new MouseAdapter() { @Override button_1.setText(RedisClient.i18nFile.getText(I18nFile.CANCEL));
wText = new Text( this, flags ); FormData fdText = new FormData(); fdText.top = new FormAttachment( 0, 0 ); fdText.left = new FormAttachment( 0, 0 ); fdText.right = new FormAttachment( 100, -warningImage.getBounds().width ); wText.setLayoutData( fdText );
composite.setLayout( compLayout ); wlTNS = new Label( composite, SWT.RIGHT ); wlTNS.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageOCI.TNS.Label" ) ); props.setLook( wlTNS ); fdlTNS = new FormData(); fdlTNS.left = new FormAttachment( 0, 0 ); fdlTNS.right = new FormAttachment( middle, 0 ); wlTNS.setLayoutData( fdlTNS ); wTNS = new Text( composite, SWT.SINGLE | SWT.BORDER ); props.setLook( wTNS ); fdTNS = new FormData(); fdTNS.left = new FormAttachment( middle, margin ); fdTNS.right = new FormAttachment( 100, 0 ); wTNS.setLayoutData( fdTNS ); wTNS.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent arg0 ) {
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; }
composite_5.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 1, 1)); label = new Label(composite_5, SWT.NONE); label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1)); label.setText(RedisClient.i18nFile.getText(I18nFile.CHANNEL)); final Text channel = new Text(composite_5, SWT.BORDER); channel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); channel.setBounds(0, 0, 73, 21); channel.addControlListener(new ControlAdapter() { composite_6.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); label1 = new Label(composite_6, SWT.NONE); label1.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1)); label1.setText(RedisClient.i18nFile.getText(I18nFile.MESSAGE)); final Text message = new Text(composite_6, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL | SWT.MULTI); message.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); message.setBounds(0, 0, 73, 21); sashForm_2.setWeights(new int[] {1, 2});