Codota Logo
FormAttachment.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.eclipse.swt.layout.FormAttachment
constructor

Best Java code snippets using org.eclipse.swt.layout.FormAttachment.<init> (Showing top 20 results out of 693)

Refine searchRefine arrow

  • FormLayout.<init>
  • FormData.<init>
  • BaseMessages.getString
  • Label.<init>
  • Label.setLayoutData
  • Label.setText
  • Common ways to obtain FormAttachment
private void myMethod () {
FormAttachment f =
  • Codota IconControl control;new FormAttachment(control, offset)
  • Codota Iconnew FormAttachment(0)
  • Codota Iconnew FormAttachment(100, -50)
  • Smart code suggestions by Codota
}
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: pentaho/pentaho-kettle

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;
}
origin: pentaho/pentaho-kettle

fileNameSupplier = repository == null ? this::promptForLocalFile : this::promptForRepositoryFile;
FormLayout formLayout = new FormLayout();
formLayout.marginWidth = 0;
formLayout.marginHeight = 0;
FormData fdFileName = new FormData();
fdFileName.left = new FormAttachment( 0, 0 );
fdFileName.top = new FormAttachment( 0, 0 );
fdFileName.width = 275;
wFileName.setLayoutData( fdFileName );
wBrowse.setText( BaseMessages.getString( PKG, "VFSFileSelection.Dialog.Browse" ) );
FormData fdBrowse = new FormData();
fdBrowse.left = new FormAttachment( wFileName, 5 );
fdBrowse.top = new FormAttachment( wFileName, 0, SWT.TOP );
wBrowse.setLayoutData( fdBrowse );
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

private Group createGroup( Composite parentTab, Control top, String label ) {
 Group group = new Group( parentTab, SWT.SHADOW_NONE );
 props.setLook( group );
 group.setText( label );
 FormLayout groupLayout = new FormLayout();
 groupLayout.marginWidth = 10;
 groupLayout.marginHeight = 10;
 group.setLayout( groupLayout );
 FormData fdGroup = new FormData();
 fdGroup.left = new FormAttachment( 0, Const.MARGIN );
 fdGroup.top = new FormAttachment( top, Const.MARGIN );
 fdGroup.right = new FormAttachment( 100, -Const.MARGIN );
 group.setLayoutData( fdGroup );
 return group;
}
origin: pentaho/pentaho-kettle

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 );
}
origin: pentaho/pentaho-kettle

private void buildSetupTab() {
 wSetupTab = new CTabItem( wTabFolder, SWT.NONE );
 wSetupTab.setText( BaseMessages.getString( PKG, "BaseStreamingDialog.SetupTab" ) );
 wSetupComp = new Composite( wTabFolder, SWT.NONE );
 props.setLook( wSetupComp );
 FormLayout setupLayout = new FormLayout();
 setupLayout.marginHeight = 15;
 setupLayout.marginWidth = 15;
 wSetupComp.setLayout( setupLayout );
 buildSetup( wSetupComp );
 FormData fdSetupComp = new FormData();
 fdSetupComp.left = new FormAttachment( 0, 0 );
 fdSetupComp.top = new FormAttachment( 0, 0 );
 fdSetupComp.right = new FormAttachment( 100, 0 );
 fdSetupComp.bottom = new FormAttachment( 100, 0 );
 wSetupComp.setLayoutData( fdSetupComp );
 wSetupComp.layout();
 wSetupTab.setControl( wSetupComp );
}
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

private void addTree() {
 mainComposite = new Composite( sashform, SWT.BORDER );
 mainComposite.setLayout( new FormLayout() );
 props.setLook( mainComposite, Props.WIDGET_STYLE_TOOLBAR );
 tabFolder = new CTabFolder( mainComposite, SWT.HORIZONTAL );
 props.setLook( tabFolder, Props.WIDGET_STYLE_TAB );
 FormData fdTab = new FormData();
 fdTab.left = new FormAttachment( 0 );
 fdTab.top = new FormAttachment( mainComposite, 0 );
 fdTab.right = new FormAttachment( 100 );
 fdTab.bottom = new FormAttachment( 100 );
 tabFolder.setLayoutData( fdTab );
 addViewTab( tabFolder );
 addDesignTab( tabFolder );
 tabFolder.setSelection( view );
 coreStepToolTipMap = new Hashtable<>();
 coreJobToolTipMap = new Hashtable<>();
 addDefaultKeyListeners( tabFolder );
 addDefaultKeyListeners( mainComposite );
}
origin: pentaho/pentaho-kettle

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();
  }
 } );
}
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 );
}
origin: pentaho/pentaho-kettle

private void buildProperiesTab() {
 CTabItem wPropertiesTab = new CTabItem( wTabFolder, SWT.NONE );
 wPropertiesTab.setText( BaseMessages.getString( PKG, "JmsProducerDialog.Properties.Tab" ) );
 Composite wPropertiesComp = new Composite( wTabFolder, SWT.NONE );
 props.setLook( wPropertiesComp );
 FormLayout fieldsLayout = new FormLayout();
 fieldsLayout.marginHeight = 15;
 fieldsLayout.marginWidth = 15;
 wPropertiesComp.setLayout( fieldsLayout );
 FormData propertiesFormData = new FormData();
 propertiesFormData.left = new FormAttachment( 0, 0 );
 propertiesFormData.top = new FormAttachment( wPropertiesComp, 0 );
 propertiesFormData.right = new FormAttachment( 100, 0 );
 propertiesFormData.bottom = new FormAttachment( 100, 0 );
 wPropertiesComp.setLayoutData( propertiesFormData );
 buildPropertiesTable( wPropertiesComp );
 wPropertiesComp.layout();
 wPropertiesTab.setControl( wPropertiesComp );
}
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

public void createControl( Composite parent ) {
 // create the composite to hold the widgets
 Composite composite = new Composite( parent, SWT.NONE );
 props.setLook( composite );
 FormLayout compLayout = new FormLayout();
 compLayout.marginHeight = Const.FORM_MARGIN;
 compLayout.marginWidth = Const.FORM_MARGIN;
 composite.setLayout( compLayout );
 MouseAdapter lsMouse = new MouseAdapter() {
  public void mouseDown( MouseEvent e ) {
   int s = getSize();
   // System.out.println("size = "+s);
   setPageComplete( s > 0 );
  }
 };
 wTable = new TableDraw( composite, props, this, fields );
 wTable.setRows( rows );
 props.setLook( wTable );
 wTable.setFields( fields );
 fdTable = new FormData();
 fdTable.left = new FormAttachment( 0, 0 );
 fdTable.right = new FormAttachment( 100, 0 );
 fdTable.top = new FormAttachment( 0, 0 );
 fdTable.bottom = new FormAttachment( 100, 0 );
 wTable.setLayoutData( fdTable );
 wTable.addMouseListener( lsMouse );
 // set the composite as the control for this page
 setControl( composite );
}
origin: pentaho/pentaho-kettle

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;
}
origin: pentaho/pentaho-kettle

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;
}
origin: pentaho/pentaho-kettle

private void buildFieldsTab() {
 CTabItem wFieldsTab = new CTabItem( wTabFolder, SWT.NONE, 3 );
 wFieldsTab.setText( BaseMessages.getString( PKG, "MQTTConsumerDialog.FieldsTab" ) );
 Composite wFieldsComp = new Composite( wTabFolder, SWT.NONE );
 props.setLook( wFieldsComp );
 FormLayout fieldsLayout = new FormLayout();
 fieldsLayout.marginHeight = 15;
 fieldsLayout.marginWidth = 15;
 wFieldsComp.setLayout( fieldsLayout );
 FormData fieldsFormData = new FormData();
 fieldsFormData.left = new FormAttachment( 0, 0 );
 fieldsFormData.top = new FormAttachment( wFieldsComp, 0 );
 fieldsFormData.right = new FormAttachment( 100, 0 );
 fieldsFormData.bottom = new FormAttachment( 100, 0 );
 wFieldsComp.setLayoutData( fieldsFormData );
 buildFieldTable( wFieldsComp, wFieldsComp );
 wFieldsComp.layout();
 wFieldsTab.setControl( wFieldsComp );
}
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 void createControl( Composite parent ) {
 // create the composite to hold the widgets
 Composite composite = new Composite( parent, SWT.NONE );
 props.setLook( composite );
 FormLayout compLayout = new FormLayout();
 compLayout.marginHeight = Const.FORM_MARGIN;
 compLayout.marginWidth = Const.FORM_MARGIN;
 composite.setLayout( compLayout );
 MouseAdapter lsMouse = new MouseAdapter() {
  public void mouseDown( MouseEvent e ) {
   int s = getSize();
   // System.out.println("size = "+s);
   setPageComplete( s > 0 );
  }
 };
 wTable = new FixedTableDraw( composite, props, this, fields );
 wTable.setRows( rows );
 props.setLook( wTable );
 wTable.setFields( fields );
 fdTable = new FormData();
 fdTable.left = new FormAttachment( 0, 0 );
 fdTable.right = new FormAttachment( 100, 0 );
 fdTable.top = new FormAttachment( 0, 0 );
 fdTable.bottom = new FormAttachment( 100, 0 );
 wTable.setLayoutData( fdTable );
 wTable.addMouseListener( lsMouse );
 // set the composite as the control for this page
 setControl( composite );
}
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 );
fdServername.right = new FormAttachment( 100, 0 );
wServername.setLayoutData( fdServername );
wServername.addModifyListener( new ModifyListener() {
org.eclipse.swt.layoutFormAttachment<init>

Javadoc

Constructs a new instance of this class. Since no numerator, denominator or offset is specified, the attachment is treated as a percentage of the form. The numerator is zero, the denominator is 100 and the offset is zero.

Popular methods of FormAttachment

  • divide
  • gcd
  • minus
  • plus
  • solveX
  • solveY

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JList (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now