@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; }
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; }
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 );
/** * @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 ); }
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; }
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 ); }
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 ); }
/** * @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 ); }
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 ); }
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(); } } ); }
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 ); }
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 ); }
/** * @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 ); }
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 ); }
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; }
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 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 ); }
/** * @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 ); }
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 ); }
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() {