public boolean canFlipToNextPage() { boolean canFlip = wListDest.getItemCount() > 0; // System.out.println("canflip = "+canFlip); return canFlip; }
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 boolean canFlipToNextPage() { refreshFields(); if ( wFields.getItemCount() > 0 ) { wFields.select( 0 ); showInfo(); } return false; }
public boolean canFlipToNextPage() { refreshFields(); if ( wFields.getItemCount() > 0 ) { wFields.select( 0 ); showInfo(); } return false; }
public boolean canFlipToNextPage() { refreshFields(); if ( wFields.getItemCount() > 0 ) { wFields.select( 0 ); showInfo(); } return false; }
first = false; for ( int i = 0; i < wTarget.getItemCount() && !found; i++ ) { String test = wTarget.getItem( i ).toUpperCase();
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] );
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 ); } } } );
if ( wFields.getItemCount() > 0 ) { wFields.select( 0 ); showInfo();
if ( wFields.getItemCount() > 0 ) { wFields.select( 0 ); showInfo();
if ( wFields.getItemCount() > 0 ) { wFields.select( 0 ); showInfo();
@Override protected int listGetItemCount() { return list.getItemCount(); }
private void updateMoveButtons () { int n = lbRules.getSelectionIndex(); btMoveUp.setEnabled(n > 0); btMoveDown.setEnabled((n != -1) && ( n < lbRules.getItemCount()-1 )); }
private String prepareCopyString() { if (list == null || list.isDisposed()) { return ""; //$NON-NLS-1$ } StringBuilder sb = new StringBuilder(); String newLine = System.getProperty("line.separator"); //$NON-NLS-1$ for (int i = 0; i < list.getItemCount(); i++) { sb.append(list.getItem(i)); sb.append(newLine); } return sb.toString(); }
public boolean checkIfFileInTarget(IFile fileToCheck) { String[] strings = selectedListBox.getItems(); int size = selectedListBox.getItemCount(); for (int i = 0; i < size; i++) { if (strings[i].compareTo(fileToCheck.getFullPath().toString()) == 0) return true; } return false; }
boolean needsVScrollBar() { int availableHeight = getClientArea().height; int height = getItemCount() * getItemHeight(); return height > availableHeight; }
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 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(); }
/** * Notifies that the Remove button has been pressed. */ private void removePressed() { setPresentsDefaultValue(false); int index = list.getSelectionIndex(); if (index >= 0) { list.remove(index); list.select(index >= list.getItemCount() ? index - 1 : index); selectionChanged(); } }
/** * Notifies that the Remove button has been pressed. */ private void removePressed() { setPresentsDefaultValue(false); int index = list.getSelectionIndex(); if (index >= 0) { list.remove(index); list.select(index >= list.getItemCount() ? index - 1 : index); selectionChanged(); } }