private void addList() { Composite composite = new Composite( sashform, SWT.NONE ); props.setLook( composite ); FillLayout fillLayout = new FillLayout(); fillLayout.marginWidth = Const.FORM_MARGIN; fillLayout.marginHeight = Const.FORM_MARGIN; composite.setLayout( fillLayout ); // Make a listbox wList = new List( composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL ); // Add a selection listener. wList.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent arg0 ) { refreshGrid(); } } ); }
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 ); } }
public void widgetSelected( SelectionEvent event ) { // If there are multiple selections here AND there are multiple selections in the steps list, we only take the // first step in the selection... // if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) { stepsList.setSelection( stepsList.getSelectionIndices()[0] ); } updateGraph(); } } );
/** * Remove the selected entries from the allowed entries */ protected void removeAllowedValue() { String[] selection = wAllowedValues.getSelection(); for ( String string : selection ) { wAllowedValues.remove( string ); } }
composite.setLayout( compLayout ); wSourceDB = new List( composite, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL ); props.setLook( wSourceDB ); for ( int i = 0; i < databases.size(); i++ ) { DatabaseMeta dbInfo = databases.get( i ); wSourceDB.add( dbInfo.getName() ); fdSourceDB.bottom = new FormAttachment( 100, 0 ); fdSourceDB.right = new FormAttachment( 50, 0 ); wSourceDB.setLayoutData( fdSourceDB ); wSourceDB.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { setPageComplete( false ); wTargetDB = new List( composite, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL ); props.setLook( wTargetDB ); for ( int i = 0; i < databases.size(); i++ ) { DatabaseMeta dbInfo = databases.get( i ); wTargetDB.add( dbInfo.getName() ); fdTargetDB.bottom = new FormAttachment( 100, 0 ); fdTargetDB.right = new FormAttachment( 100, 0 ); wTargetDB.setLayoutData( fdTargetDB ); wTargetDB.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { setPageComplete( false );
public void getData() { if ( !opened ) { return; } wListSource.removeAll(); wListDest.removeAll(); for ( int i = 0; i < input.length; i++ ) { Integer idx = Integer.valueOf( i ); String str = selection.get( idx ); if ( str == null ) { // Not selected: show in source! wListSource.add( input[i] ); } else { // Selected, show in destination! wListDest.add( input[i] ); } } }
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 removeRule () { int n = lbRules.getSelectionIndex(); if ( n == -1 ) return; ruleIndex = -1; rules.remove(n); lbRules.remove(n); if ( n > lbRules.getItemCount()-1 ) n = lbRules.getItemCount()-1; lbRules.select(n); updateRule(); updateRuleButtons(); }
private void applyChangedValue() { int todoIndex = wTodo.getSelectionIndex(); wTodo.remove( selectedKey ); if ( wTodo.getSelectionIndex() < 0 ) { if ( todoIndex > wTodo.getItemCount() ) { todoIndex = wTodo.getItemCount() - 1; if ( todoIndex >= 0 && todoIndex < wTodo.getItemCount() ) { wTodo.setSelection( todoIndex ); showKeySelection( wTodo.getSelection()[0] ); } else { refreshGrid();
new org.eclipse.swt.widgets.List( shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.LEFT | SWT.BORDER ); props.setLook( dataList ); dataList.setItems( dataChoices ); dataList.addSelectionListener( new SelectionAdapter() { fdDataList.top = new FormAttachment( 0, 0 ); fdDataList.bottom = new FormAttachment( 30, 0 ); dataList.setLayoutData( fdDataList ); new org.eclipse.swt.widgets.List( shell, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.LEFT | SWT.BORDER ); props.setLook( stepsList ); stepsList.setItems( steps ); stepsList.addSelectionListener( new SelectionAdapter() { fdStepsList.top = new FormAttachment( dataList, Const.MARGIN ); fdStepsList.bottom = new FormAttachment( 100, Const.MARGIN ); stepsList.setLayoutData( fdStepsList );
wlListSource.setLayoutData( fdlListSource ); wListSource = new List( composite, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL ); props.setLook( wListSource ); wListSource.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent arg0 ) { setPageComplete( canFlipToNextPage() ); fdListSource.right = new FormAttachment( 100, 0 ); fdListSource.bottom = new FormAttachment( 100, 0 ); wListSource.setLayoutData( fdListSource ); wListSource.addSelectionListener( new SelectionAdapter() { public void widgetDefaultSelected( SelectionEvent e ) { if ( canFinish() ) {
int index = wInputList.getSelectionIndex(); definitions.remove( index ); wInputList.removeAll(); for ( int i = 0; i < definitions.size(); i++ ) { String label = !Utils.isEmpty( definitions.get( i ).getInputStepname() ) ? definitions.get( i ).getInputStepname() : tabTitle + ( i > 0 ? String.valueOf( i + 1 ) : "" ); wInputList.add( label ); wInputList.select( index - 1 ); } else if ( definitions.size() > 0 ) { wInputList.select( index ); } else { index = -1; updateFields( definitions.get( wInputList.getSelectionIndex() ), input, wMainPath, wlInputStep, wInputStep, wbInputStep, wlOutputStep, wOutputStep, wbOutputStep, wlDescription, wDescription, wFieldMappings, wRenameOutput );
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; }
fdlTypes.right = new FormAttachment( middle, -margin ); wlTypes.setLayoutData( fdlTypes ); wTypes = new List( shell, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL ); wTypes.setToolTipText( BaseMessages.getString( PKG, "FilesToResultDialog.TypeOfFile.Tooltip" ) ); props.setLook( wTypes ); fdTypes = new FormData(); fdTypes.bottom = new FormAttachment( wOK, -margin * 3 ); fdTypes.right = new FormAttachment( 100, 0 ); wTypes.setLayoutData( fdTypes ); for ( int i = 0; i < ResultFile.getAllTypeDesc().length; i++ ) { wTypes.add( ResultFile.getAllTypeDesc()[i] );
fdlProcessor.right = new FormAttachment( middle, -margin ); wlProcessor.setLayoutData( fdlProcessor ); wProcessor = new List( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wProcessor ); FormData fdProcessor = new FormData(); fdProcessor.top = new FormAttachment( wFields, margin + 5 ); fdProcessor.right = new FormAttachment( 100, 0 ); wProcessor.setLayoutData( fdProcessor ); wProcessor.setItems( ProcessorType.getDescriptions() ); wProcessor.addListener( SWT.Selection, new Listener() { @Override public void handleEvent( Event e ) {
@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 ); } } );
themeSelectionList = new List(themeSelection, SWT.BORDER | SWT.V_SCROLL); themeSelectionList.setLayoutData(gridData); fillThemeSelectionList(); GridDataFactory.swtDefaults().grab(true, false).applyTo(websiteLink); themeSelectionList.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event) { updateDetails(colorThemeManager.getTheme( if (colorThemeManager.getTheme(activeThemeName) == null) activeThemeName = "Default"; themeSelectionList.setSelection(new String[] {activeThemeName}); updateDetails(colorThemeManager.getTheme(activeThemeName));
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 createControl(Composite parent) { Composite page = new Composite(parent, SWT.NONE); page.setLayout(new GridLayout(1, true)); // Add listing of issues loading office section List list = new List(page, SWT.SINGLE | SWT.BORDER); list.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); list.setForeground(ColorConstants.red); list.setItems(this.issues); // Specify the control this.setControl(page); // Page always complete as only display this.setPageComplete(true); }