public void widgetSelected( SelectionEvent arg0 ) { showLogTypeOptions( wLogTypeList.getSelectionIndex() ); } } );
public void widgetSelected( SelectionEvent arg0 ) { showLogTypeOptions( wLogTypeList.getSelectionIndex() ); } } );
@Override public void widgetSelected( SelectionEvent selectionEvent ) { updateFields( definitions.get( wInputList.getSelectionIndex() ), input, wMainPath, wlInputStep, wInputStep, wbInputStep, wlOutputStep, wOutputStep, wbOutputStep, wlDescription, wDescription, wFieldMappings, wRenameOutput ); } } );
@Override public void focusLost( FocusEvent event ) { definitions.get( wInputList.getSelectionIndex() ).setInputStepname( wInputStep.getText() ); String label = !Utils.isEmpty( wInputStep.getText() ) ? wInputStep.getText() : tabTitle + ( wInputList.getSelectionIndex() > 0 ? String.valueOf( wInputList.getSelectionIndex() + 1 ) : "" ); wInputList.setItem( wInputList.getSelectionIndex(), label ); } } );
@Override public void widgetSelected( SelectionEvent event ) { definitions.get( wInputList.getSelectionIndex() ) .setMainDataPath( !definitions.get( wInputList.getSelectionIndex() ).isMainDataPath() ); }
@Override public void widgetSelected( SelectionEvent event ) { definitions.get( wInputList.getSelectionIndex() ).setRenamingOnOutput( !definitions.get( wInputList.getSelectionIndex() ).isRenamingOnOutput() ); } } );
@Override public void focusLost( FocusEvent event ) { definitions.get( wInputList.getSelectionIndex() ).setDescription( wDescription.getText() ); } } );
@Override public void widgetSelected( SelectionEvent event ) { String stepName = selectTransformationStepname( input, input ); if ( stepName != null ) { wInputStep.setText( stepName ); definitions.get( wInputList.getSelectionIndex() ).setInputStepname( stepName ); } } } );
public void widgetSelected( SelectionEvent e ) { // Clear the validation rules for a certain field... // int index = wValidationsList.getSelectionIndex(); if ( index >= 0 ) { selectionList.remove( index ); selectedField = null; wValidationsList.remove( index ); enableFields(); if ( selectionList.size() > 0 ) { wValidationsList.select( selectionList.size() - 1 ); } } } } );
@Override public void widgetSelected( SelectionEvent event ) { String stepName = selectTransformationStepname( !input, input ); if ( stepName != null ) { wOutputStep.setText( stepName ); definitions.get( wInputList.getSelectionIndex() ).setOutputStepname( stepName ); try { enableMappingButton( wbEnterMapping, input, wInputStep.getText(), wOutputStep.getText() ); } catch ( KettleException e ) { // Show the missing/wrong stepname error new ErrorDialog( shell, "Error", "Unexpected error", e ); } } } } );
private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } stepname = wStepname.getText(); // return value input.setFilenameField( wFilenameField.getText() ); if ( wTypes.getSelectionIndex() >= 0 ) { input.setFileType( wTypes.getSelectionIndex() ); } else { input.setFileType( ResultFile.FILE_TYPE_GENERAL ); } dispose(); } }
void refreshObject() { int index = list.getSelectionIndex(); if ( index == -1 ) { return; } if ( check.getSelection() ) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); PrintStream s = new PrintStream( stream ); errors[index].printStackTrace( s ); text.setText( stream.toString() ); text.setVisible( true ); canvas.setVisible( false ); } else { canvas.setVisible( true ); text.setVisible( false ); canvas.redraw(); } }
private boolean findSource() { // Guess, user selects an entry in the list on the right. // Find a comparable entry in the source list... boolean found = false; int targetIndex = wTarget.getSelectionIndex(); // Skip everything after the bracket... String targetString = wTarget.getItem( targetIndex ).toUpperCase(); int length = targetString.length(); boolean first = true; while ( !found && ( length >= 2 || first ) ) { first = false; for ( int i = 0; i < wSource.getItemCount() && !found; i++ ) { if ( wSource.getItem( i ).toUpperCase().indexOf( targetString.substring( 0, length ) ) >= 0 ) { wSource.setSelection( i ); found = true; } } length--; } return found; }
@Override public void mouseUp( MouseEvent mouseEvent ) { MappingIODefinition definition = new MappingIODefinition(); definition.setMainDataPath( true ); definitions.add( definition ); wInputList.add( tabTitle + ( definitions.size() > 1 ? String.valueOf( definitions.size() ) : "" ) ); wInputList.select( definitions.size() - 1 ); updateFields( definitions.get( wInputList.getSelectionIndex() ), input, wMainPath, wlInputStep, wInputStep, wbInputStep, wlOutputStep, wOutputStep, wbOutputStep, wlDescription, wDescription, wFieldMappings, wRenameOutput ); wlNoItems.setVisible( false ); wFieldsComposite.setVisible( true ); wRemoveButton.setEnabled( true ); } } );
@Override public void focusLost( FocusEvent event ) { definitions.get( wInputList.getSelectionIndex() ).setOutputStepname( wOutputStep.getText() ); try { enableMappingButton( wbEnterMapping, input, wInputStep.getText(), wOutputStep.getText() ); } catch ( KettleException e ) { // Show the missing/wrong step name error // Listener ok = new Listener() { @Override public void handleEvent( final Event event ) { /* do nothing for now */ } }; Map<String, Listener> listenerMap = new LinkedHashMap<>(); listenerMap.put( BaseMessages.getString( "System.Button.OK" ), ok ); new WarningDialog( shell, "Error", e.getMessage(), listenerMap ).open(); // //new ErrorDialog( shell, "Error", "Unexpected error", e ); } } } );
private void show() { if ( rowDatas.size() == 0 ) { return; } int nr = wStepList.getSelectionIndex(); java.util.List<Object[]> buffer = rowDatas.get( nr ); RowMetaInterface rowMeta = rowMetas.get( nr ); String name = stepNames.get( nr ); if ( rowMeta != null && buffer != null && buffer.size() > 0 ) { PreviewRowsDialog prd = new PreviewRowsDialog( shell, Variables.getADefaultVariableSpace(), SWT.NONE, name, rowMeta, buffer ); prd.open(); } else { MessageBox mb = new MessageBox( shell, SWT.ICON_INFORMATION | SWT.OK ); mb.setText( BaseMessages.getString( PKG, "EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Title" ) ); mb.setMessage( BaseMessages.getString( PKG, "EnterPreviewRowsDialog.Dialog.NoPreviewRowsFound.Message" ) ); mb.open(); } } }
private boolean findTarget() { int sourceIndex = wSource.getSelectionIndex(); GuessPair p = findTargetPair( sourceIndex ); if ( p.getFound() ) { wTarget.setSelection( p.getTargetIndex() ); } return p.getFound(); }
public void modifyText( ModifyEvent event ) { // See if there is a selected Validation // if ( wValidationsList != null && wValidationsList.getItemCount() > 0 && wValidationsList.getSelection().length == 1 ) { int index = wValidationsList.getSelectionIndex(); String description = wValidationsList.getItem( index ); Validation validation = Validation.findValidation( selectionList, description ); String newDescription = wDescription.getText(); validation.setName( newDescription ); wValidationsList.setItem( index, newDescription ); wValidationsList.select( index ); } } } );
private void ok() { stepname = wStepname.getText(); // return value input.getParameterFieldMap().clear(); for ( int i = 0; i < wFields.nrNonEmpty(); i++ ) { TableItem item = wFields.getNonEmpty( i ); String name = item.getText( 1 ); String field = item.getText( 2 ); if ( !Utils.isEmpty( name ) && !Utils.isEmpty( field ) ) { input.getParameterFieldMap().put( name, field ); } } input.setInputFileField( wInput.getText() ); input.setOutputFileField( wOutput.getText() ); input.setOutputProcessorType( ProcessorType.values()[wProcessor.getSelectionIndex()] ); input.setCreateParentfolder( wParentFolder.getSelection() ); dispose(); }
public void setAccessTypes() { if ( wDBType.getSelectionCount() < 1 ) { return; } int[] acc = DatabaseMeta.getAccessTypeList( wDBType.getSelection()[0] ); wAccType.removeAll(); for ( int i = 0; i < acc.length; i++ ) { wAccType.add( DatabaseMeta.getAccessTypeDescLong( acc[i] ) ); } // If nothing is selected: select the first item (mostly the native driver) if ( wAccType.getSelectionIndex() < 0 ) { wAccType.select( 0 ); } }