private void getFieldsList() { try { String selectedField = wUpsertField.getText(); wUpsertField.removeAll(); wUpsertField.setItems( getModuleFields() ); if ( !Utils.isEmpty( selectedField ) ) { wUpsertField.setText( selectedField ); } } catch ( Exception e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "SalesforceUpsertDialog.ErrorRetrieveModules.DialogTitle" ), BaseMessages.getString( PKG, "SalesforceUpsertDialog.ErrorRetrieveData.ErrorRetrieveModules" ), e ); } }
protected CCombo addStandardSelect( String labelMessageKey, Control prevControl, String[] choices ) { int vertPad = verticalPadding; Label label = addStandardLabel( labelMessageKey, prevControl ); verticalPadding = vertPad; CCombo combo = new CCombo( shell, SWT.BORDER ); combo.setItems( choices ); combo.addModifyListener( lsMod ); combo.setLayoutData( standardInputSpacing( prevControl, label ) ); return combo; }
public void select( int index ) { wCombo.select( index ); }
/** * Selects the database with the specified name in the Combo Box component. * * @param wConnection the Combo Box component * @param name the name of the database to select */ public void selectDatabase( CCombo wConnection, String name ) { int idx = wConnection.indexOf( name ); if ( idx >= 0 ) { wConnection.select( idx ); } }
public void setTimeUnit( TimeUnit tu ) { for ( int i = 0; i < wTimeUnit.getItemCount(); i++ ) { if ( tu.toString().equals( wTimeUnit.getItem( i ) ) ) { wTimeUnit.select( i ); break; } } }
ComboVar widget = (ComboVar) combo; if ( lsFocusInTabItem != null ) { widget.getCComboWidget().addListener( SWT.FocusIn, lsFocusInTabItem ); } else { widget.setItems( opt ); ((FormData) widget.getCComboWidget().getLayoutData()).bottom = new FormAttachment( 100, 0 ); widget.layout(); } else { combo = new CCombo( table, colinfo.isReadOnly() ? SWT.READ_ONLY : SWT.NONE ); CCombo widget = (CCombo) combo; props.setLook( widget, Props.WIDGET_STYLE_TABLE ); widget.addTraverseListener( lsTraverse ); widget.addModifyListener( lsModCombo ); widget.addFocusListener( lsFocusCombo ); widget.setItems( opt ); widget.setVisibleItemCount( opt.length ); widget.setText( row.getText( colnr ) ); if ( lsMod != null ) { widget.addModifyListener( lsMod ); widget.addModifyListener( lsUndo ); widget.setToolTipText( colinfo.getToolTip() == null ? "" : colinfo.getToolTip() ); widget.setVisible( true ); widget.addKeyListener( lsKeyCombo ); if ( colinfo.getSelectionAdapter() != null ) { widget.addSelectionListener( columns[colnr - 1].getSelectionAdapter() );
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(); availableVFSSchemes.forEach( scheme -> wLocation.add( scheme.schemeName ) ); wLocation.addListener( SWT.Selection, event -> { this.selectedVFSScheme = availableVFSSchemes.get( wLocation.getSelectionIndex() ); this.wPath.setText( "" ); } ); if ( !availableVFSSchemes.isEmpty() ) { wLocation.select( 0 ); this.selectedVFSScheme = availableVFSSchemes.get( wLocation.getSelectionIndex() ); wLocation.addModifyListener( lsMod ); wLocation.setLayoutData( new FormDataBuilder().left( 0, 0 ).top( wlLocation, FIELD_LABEL_SEP ).width( FIELD_SMALL ).result() );
optionLabel.setLayoutData( urlLabelData ); CCombo schemaCombo = new CCombo( runConfigurationDialog.getGroup(), SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER ); for ( String schema : schemas ) { schemaCombo.add( schema ); schemaCombo.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { String schema = schemaCombo.getText(); schemaCombo.select( selected ); props.setLook( schemaCombo ); schemaCombo.setLayoutData( protocolData );
wlEngine.setLayoutData( fdlEngine ); wEngine = new CCombo( wSettings, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER ); wEngine.setItems( executionConfigurationManager.getTypes() ); wEngine.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent selectionEvent ) { String engine = wEngine.getText(); wEngine.select( 0 ); props.setLook( wEngine ); FormData fdEngine = new FormData(); fdEngine.left = new FormAttachment( 0, 0 ); fdEngine.top = new FormAttachment( wlEngine, 5 ); wEngine.setLayoutData( fdEngine );
wText.setToolTipText( toolTipText ); wTimeUnit = new CCombo( this, SWT.SINGLE | SWT.DROP_DOWN | SWT.BORDER | SWT.LEFT ); FormData fdCombo = new FormData(); fdCombo.left = new FormAttachment( threeQuarters, margin ); fdCombo.right = new FormAttachment( 100, 0 ); wTimeUnit.setEditable( false ); wTimeUnit.setLayoutData( fdCombo ); wTimeUnit.setItems( getTimeUnits() ); wTimeUnit.setToolTipText( toolTipText );
wlSubjectMessage.setLayoutData( fdlFields ); wSubject = new CCombo( shell, SWT.LEFT | SWT.READ_ONLY | SWT.BORDER ); wSubject.setItems( subjects ); wSubject.setText( selectedSubject ); props.setLook( wSubject ); FormData fdlSubject = new FormData(); wSubject.setLayoutData( fdlSubject ); wSubject.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent arg0 ) {
private CCombo createLineCombo( 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 ); CCombo control = new CCombo( shell, 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 fillStoredData() { if ( stepname != null ) { textStepName.setText( stepname ); } int index = addConnectionLine.indexOf( meta.getDatabaseMeta() != null ? meta.getDatabaseMeta().getName() : "" ); if ( index >= 0 ) { addConnectionLine.select( index ); } if ( meta.getModelName() != null ) { comboModelName.add( meta.getModelName() ); comboModelName.select( 0 ); } textCommitBatchSize.setText( String.valueOf( meta.getCommitBatchSize() ) ); comboIDFieldName.setText( meta.getIdFieldName() ); }
/** * @return the text in the Text widget */ public String getText() { return wCombo.getText(); }
addConnectionLine.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { doSelectConnection( false ); labelCubeName.setLayoutData( fd ); comboCubeName = new CCombo( shell, SWT.BORDER ); comboCubeName.addModifyListener( lsMod ); props.setLook( comboCubeName ); comboCubeName.addFocusListener( new FocusListener() { fd.right = new FormAttachment( 100, 0 ); fd.top = new FormAttachment( addConnectionLine, margin ); comboCubeName.setLayoutData( fd );
private void loadComboOptions() { try { String fieldvalue = null; if ( inputFieldControl.getText() != null ) { fieldvalue = inputFieldControl.getText(); } RowMetaInterface r = transMeta.getPrevStepFields( stepname ); if ( r != null ) { inputFieldControl.setItems( r.getFieldNames() ); } if ( fieldvalue != null ) { inputFieldControl.setText( fieldvalue ); } } catch ( KettleException ke ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "NumberRange.TypeLongDesc" ), "Can't get fields", ke ); } }
private void setPingType() { wlTimeOut.setEnabled( wPingType.getSelectionIndex() == jobEntry.isystemPing || wPingType.getSelectionIndex() == jobEntry.ibothPings ); wTimeOut.setEnabled( wPingType.getSelectionIndex() == jobEntry.isystemPing || wPingType.getSelectionIndex() == jobEntry.ibothPings ); wlNbrPackets.setEnabled( wPingType.getSelectionIndex() == jobEntry.iclassicPing || wPingType.getSelectionIndex() == jobEntry.ibothPings ); wNbrPackets.setEnabled( wPingType.getSelectionIndex() == jobEntry.iclassicPing || wPingType.getSelectionIndex() == jobEntry.ibothPings ); }
public void chooseListMails() { boolean ok = ( wProtocol.getText().equals( MailConnectionMeta.PROTOCOL_STRING_POP3 ) && wListmails.getSelectionIndex() == 1 ); wlFirstmails.setEnabled( ok ); wFirstmails.setEnabled( ok ); }
/** * Copy information from the meta-data input to the dialog fields. */ public void getData() { wFieldname.setText( fieldName == null ? "" : fieldName ); }