org.eclipse.swt.widgets.Label.setLayoutData()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(14.4k)|赞(0)|评价(0)|浏览(271)

本文整理了Java中org.eclipse.swt.widgets.Label.setLayoutData()方法的一些代码示例,展示了Label.setLayoutData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.setLayoutData()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:setLayoutData

Label.setLayoutData介绍

暂无

代码示例

代码示例来源:origin: caoxinyu/RedisClient

@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() {

代码示例来源:origin: pentaho/pentaho-kettle

@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;
}

代码示例来源:origin: caoxinyu/RedisClient

ttlComposite.setLayout(new GridLayout(2, false));
btnExpire = new Button(ttlComposite, SWT.CHECK);
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));

代码示例来源:origin: pentaho/pentaho-kettle

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() );
}

代码示例来源:origin: pentaho/pentaho-kettle

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() );

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @param factory
 *          factory to use.
 */
protected void buildLogFileLine( final PluginWidgetFactory factory ) {
 final Control topControl = this.wFastLoadPath;
 this.wlLogFile = factory.createRightLabel( BaseMessages.getString( PKG, "TeraFastDialog.LogFile.Label" ) );
 this.props.setLook( this.wlLogFile );
 this.wlLogFile.setLayoutData( factory.createLabelLayoutData( topControl ) );
 this.wbLogFile = factory.createPushButton( BaseMessages.getString( PKG, "TeraFastDialog.Browse.Button" ) );
 this.props.setLook( this.wbLogFile );
 FormData formData = factory.createControlLayoutData( topControl );
 formData.left = null;
 this.wbLogFile.setLayoutData( formData );
 this.wLogFile = factory.createSingleTextVarLeft();
 this.props.setLook( this.wLogFile );
 formData = factory.createControlLayoutData( topControl );
 formData.right = new FormAttachment( this.wbLogFile, -factory.getMargin() );
 this.wLogFile.setLayoutData( formData );
}

代码示例来源:origin: pentaho/pentaho-kettle

props.setLook( composite );
FormLayout compLayout = new FormLayout();
compLayout.marginHeight = Const.FORM_MARGIN;
compLayout.marginWidth = Const.FORM_MARGIN;
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 );
fdServername = new FormData();
fdServername.top = new FormAttachment( 0, 0 );
fdServername.left = new FormAttachment( middle, margin );

代码示例来源:origin: pentaho/pentaho-kettle

@Override
protected Control buildBody() {
 final Label message = new Label( shell, SWT.WRAP | SWT.LEFT );
 message.setText( BaseMessages.getString( PKG, "System.GetFields.NewFieldsFound.Message", numFields ) );
 props.setLook( message );
 message.setLayoutData( new FormDataBuilder().top().left().right( 100, 0 ).result() );
 final Button newFieldsOnly = new Button( shell, SWT.RADIO );
 newFieldsOnly.setSelection( true );
 props.setLook( newFieldsOnly );
 newFieldsOnly.setText( BaseMessages.getString( PKG, "System.GetFields.AddNewOnly.Label" ) );
 newFieldsOnly.setLayoutData( new FormDataBuilder().top( message, MARGIN_SIZE ).left().result() );
 final Button clearAndAddAll = new Button( shell, SWT.RADIO );
 props.setLook( clearAndAddAll );
 clearAndAddAll.setText( BaseMessages.getString( PKG, "System.GetFields.ClearAndAddAll.Label" ) );
 clearAndAddAll.setLayoutData( new FormDataBuilder().top( newFieldsOnly, ELEMENT_SPACING ).left().result() );

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @param factory
 *          factory to use.
 */
protected void buildControlFileLine( final PluginWidgetFactory factory ) {
 final Control topControl = this.wUseControlFile;
 this.wlControlFile =
  factory.createRightLabel( BaseMessages.getString( PKG, "TeraFastDialog.ControlFile.Label" ) );
 this.props.setLook( this.wlControlFile );
 this.wlControlFile.setLayoutData( factory.createLabelLayoutData( topControl ) );
 this.wbControlFile = factory.createPushButton( BaseMessages.getString( PKG, "TeraFastDialog.Browse.Button" ) );
 this.props.setLook( this.wbControlFile );
 FormData formData = factory.createControlLayoutData( topControl );
 formData.left = null;
 this.wbControlFile.setLayoutData( formData );
 this.wControlFile = factory.createSingleTextVarLeft();
 this.props.setLook( this.wControlFile );
 formData = factory.createControlLayoutData( topControl );
 formData.right = new FormAttachment( this.wbControlFile, -factory.getMargin() );
 this.wControlFile.setLayoutData( formData );
}

代码示例来源:origin: pentaho/pentaho-kettle

props.setLook( composite );
FormLayout compLayout = new FormLayout();
compLayout.marginHeight = Const.FORM_MARGIN;
compLayout.marginWidth = Const.FORM_MARGIN;
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 );

代码示例来源:origin: pentaho/pentaho-kettle

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();
}

代码示例来源:origin: pentaho/pentaho-kettle

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;
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @param factory
 *          factory to use.
 */
protected void buildDataFileLine( final PluginWidgetFactory factory ) {
 final Control topControl = this.wbTruncateTable;
 this.wlDataFile = factory.createRightLabel( BaseMessages.getString( PKG, "TeraFastDialog.DataFile.Label" ) );
 this.props.setLook( this.wlDataFile );
 this.wlDataFile.setLayoutData( factory.createLabelLayoutData( topControl ) );
 this.wbDataFile = factory.createPushButton( BaseMessages.getString( PKG, "TeraFastDialog.Browse.Button" ) );
 this.props.setLook( this.wbDataFile );
 FormData formData = factory.createControlLayoutData( topControl );
 formData.left = null;
 this.wbDataFile.setLayoutData( formData );
 this.wDataFile = factory.createSingleTextVarLeft();
 this.props.setLook( this.wDataFile );
 formData = factory.createControlLayoutData( topControl );
 formData.right = new FormAttachment( this.wbDataFile, -factory.getMargin() );
 this.wDataFile.setLayoutData( formData );
}

代码示例来源:origin: pentaho/pentaho-kettle

props.setLook( composite );
FormLayout compLayout = new FormLayout();
compLayout.marginHeight = Const.FORM_MARGIN;
compLayout.marginWidth = Const.FORM_MARGIN;
composite.setLayout( compLayout );
wlDSN = new Label( composite, SWT.RIGHT );
wlDSN.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageODBC.DSN.Label" ) );
props.setLook( wlDSN );
fdlDSN = new FormData();
fdlDSN.left = new FormAttachment( 0, 0 );
fdlDSN.right = new FormAttachment( middle, 0 );
wlDSN.setLayoutData( fdlDSN );
wDSN = new Text( composite, SWT.SINGLE | SWT.BORDER );
props.setLook( wDSN );
fdDSN = new FormData();
fdDSN.left = new FormAttachment( middle, margin );
fdDSN.right = new FormAttachment( 100, 0 );
wDSN.setLayoutData( fdDSN );

代码示例来源:origin: pentaho/pentaho-kettle

protected void addFileWidgets() {
 Label wlLocation = new Label( this, SWT.RIGHT );
 wlLocation.setText( BaseMessages.getString( PKG, "VfsFileChooserControls.Location.Label" ) );
 wlLocation.setLayoutData( new FormDataBuilder( ).left( 0, 0 ).top( 0, 0 ).result() );
 wLocation = new CCombo( this, SWT.BORDER | SWT.READ_ONLY );
 List<VFSScheme> availableVFSSchemes = getAvailableVFSSchemes();
  new FormDataBuilder().left( 0, 0 ).top( wlLocation, FIELD_LABEL_SEP ).width( FIELD_SMALL ).result() );
 Label wlPath = new Label( this, SWT.RIGHT );
 wlPath.setText( BaseMessages.getString( PKG, "VfsFileChooserControls.Filename.Label" ) );
 wlPath.setLayoutData( new FormDataBuilder().left( 0, 0 ).top( wLocation, FIELDS_SEP ).result() );
 wPath = new TextVar( space, this, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
 wPath.addModifyListener( lsMod );
 wPath.setLayoutData( new FormDataBuilder().left( 0, 0 ).top( wlPath, FIELD_LABEL_SEP ).width( FIELD_LARGE + VAR_EXTRA_WIDTH ).result() );
 wbBrowse = new Button( this, SWT.PUSH );
 wbBrowse.setText( BaseMessages.getString( PKG, "System.Button.Browse" ) );
 wbBrowse.addListener( SWT.Selection, event -> browseForFileInputPath() );
 int bOffset = ( wbBrowse.computeSize( SWT.DEFAULT, SWT.DEFAULT, false ).y

代码示例来源:origin: pentaho/pentaho-kettle

@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;
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @param factory
 *          factory to use.
 */
protected void buildFastloadLine( final PluginWidgetFactory factory ) {
 final Control topControl = this.wVariableSubstitution;
 this.wlFastLoadPath =
  factory.createRightLabel( BaseMessages.getString( PKG, "TeraFastDialog.FastloadPath.Label" ) );
 this.props.setLook( this.wlFastLoadPath );
 this.wlFastLoadPath.setLayoutData( factory.createLabelLayoutData( topControl ) );
 this.wbFastLoadPath = factory.createPushButton( BaseMessages.getString( PKG, "TeraFastDialog.Browse.Button" ) );
 this.props.setLook( this.wbFastLoadPath );
 FormData formData = factory.createControlLayoutData( topControl );
 formData.left = null;
 this.wbFastLoadPath.setLayoutData( formData );
 this.wFastLoadPath = factory.createSingleTextVarLeft();
 this.props.setLook( this.wFastLoadPath );
 formData = factory.createControlLayoutData( topControl );
 formData.right = new FormAttachment( this.wbFastLoadPath, -factory.getMargin() );
 this.wFastLoadPath.setLayoutData( formData );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

代码示例来源:origin: pentaho/pentaho-kettle

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 );
}

相关文章