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; }
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(); } } );
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(); } } );
public void widgetSelected( SelectionEvent arg0 ) { int[] idx = wList.getSelectionIndices(); reload(); wList.setSelection( idx ); refreshGrid(); } } );
public void widgetSelected( SelectionEvent event ) { // If there are multiple selections here AND there are multiple selections in the data list, we only take the // first data item in the selection... // if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) { dataList.setSelection( dataList.getSelectionIndices()[0] ); } updateGraph(); } } );
public void widgetSelected( SelectionEvent event ) { // If there are multiple selections here AND there are multiple selections in the data list, we only take the // first data item in the selection... // if ( dataList.getSelectionCount() > 1 && stepsList.getSelectionCount() > 1 ) { dataList.setSelection( dataList.getSelectionIndices()[0] ); } updateGraph(); } } );
if ( index >= 0 ) { lastFoundKey = key; wTodo.setSelection( index ); showKeySelection( wTodo.getSelection()[0] ); return;
private boolean findTarget() { int sourceIndex = wSource.getSelectionIndex(); GuessPair p = findTargetPair( sourceIndex ); if ( p.getFound() ) { wTarget.setSelection( p.getTargetIndex() ); } return p.getFound(); }
wTodo.setSelection( todoIndex ); showKeySelection( wTodo.getSelection()[0] ); } else {
wTypes.setSelection( types );
private void reloadThemeSelectionList() { themeSelectionList.removeAll(); fillThemeSelectionList(); themeSelectionList.setSelection(new String[]{"Default"}); updateDetails(null); container.pack(); } }
if (colorThemeManager.getTheme(activeThemeName) == null) activeThemeName = "Default"; themeSelectionList.setSelection(new String[] {activeThemeName}); updateDetails(colorThemeManager.getTheme(activeThemeName));
@Override protected void listSetSelection(int[] ixs) { list.setSelection(ixs); }
@Override protected void listSetSelection(int[] ixs) { list.setSelection(ixs); }
@Override void doSetIntValue(Object source, int value) { if (value == -1) ((List) source).deselectAll(); else ((List) source).setSelection(value); }
@Override public void mouseMove(MouseEvent e){ int item_height = list.getItemHeight(); int y = e.y; int item_index = y/item_height; if ( list.getSelectionIndex() != item_index ){ list.setSelection( item_index ); } } });
private void setData () { chkSegmentSource.setSelection(params.getSegmentSource()); edSourceSRX.setText(params.getSourceSrxPath()); chkSegmentTarget.setSelection(params.getSegmentTarget()); edTargetSRX.setText(params.getTargetSrxPath()); chkCopySource.setSelection(params.getCopySource()); chkCheckSegments.setSelection(params.getCheckSegments()); chkForceSegmentedOutput.setSelection(params.getForcesegmentedOutput()); chkRenumberCodes.setSelection(params.getRenumberCodes()); listBehaviorForSegmented.setSelection(params.getSegmentationStrategy().ordinal()); updateSourceDisplay(); updateTargetDisplay(); updateOptionsDisplay(); }
public void setData (QualityCheckSession session) { this.session = session; for ( RawDocument rd : session.getDocuments() ) { lbDocs.add(formatDocument(rd)); } if ( lbDocs.getItemCount() > 0 ) { lbDocs.setSelection(0); } chkAutoRefresh.setSelection(session.getAutoRefresh()); edSourceLocale.setText(session.getSourceLocale().toString()); edTargetLocale.setText(session.getTargetLocale().toString()); updateFileButtons(); }
private void removeDocument () { int n = lbDocs.getSelectionIndex(); if ( n < 0 ) return; lbDocs.remove(n); if ( n >= lbDocs.getItemCount() ) n = lbDocs.getItemCount()-1; lbDocs.setSelection(n); updateFileButtons(); }
public void handleSetSelection( List list, JsonObject properties ) { JsonValue value = properties.get( PROP_SELECTION ); if( value != null ) { JsonArray arrayValue = value.asArray(); int[] selection = new int[ arrayValue.size() ]; for( int i = 0; i < selection.length; i++ ) { selection[ i ] = arrayValue.get( i ).asInt(); } list.setSelection( selection ); } }