public String[] getSelection() { return wListDest.getItems(); } }
public void handleOK() { retval = wListDest.getItems(); dispose(); } }
public void widgetSelected( SelectionEvent e ) { delFromSelection( wListDest.getItems() ); } } );
public void widgetSelected( SelectionEvent e ) { addToSelection( wListSource.getItems() ); } } );
int idx = Const.indexOfString( sortedSourceList[i], wSource.getItems() ); if ( idx >= 0 ) { pList.add( findTargetPair( idx ) );
void layout() { Composite parent = canvas.getParent(); Rectangle rect = parent.getClientArea(); int width = 0; String[] items = list.getItems(); GC gc = new GC( list ); for ( int i = 0; i < objects.length; i++ ) { width = Math.max( width, gc.stringExtent( items[i] ).x ); } gc.dispose(); Point size1 = start.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Point size2 = stop.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Point size3 = check.computeSize( SWT.DEFAULT, SWT.DEFAULT ); Point size4 = label.computeSize( SWT.DEFAULT, SWT.DEFAULT ); width = Math.max( size1.x, Math.max( size2.x, Math.max( size3.x, width ) ) ); width = Math.max( 64, Math.max( size4.x, list.computeSize( width, SWT.DEFAULT ).x ) ); start.setBounds( 0, 0, width, size1.y ); stop.setBounds( 0, size1.y, width, size2.y ); check.setBounds( 0, size1.y + size2.y, width, size3.y ); label.setBounds( 0, rect.height - size4.y, width, size4.y ); int height = size1.y + size2.y + size3.y; list.setBounds( 0, height, width, rect.height - height - size4.y ); text.setBounds( width, 0, rect.width - width, rect.height ); canvas.setBounds( width, 0, rect.width - width, rect.height ); }
selectedField.setRegularExpressionNotAllowed( wRegExpDisallowed.getText() ); selectedField.setAllowedValues( wAllowedValues.getItems() );
private int getMaxItemWidth() { int result = 0; String[] items = getItems(); for( int i = 0; i < items.length; i++ ) { int itemWidth = getItemWidth( items[ i ] ); result = Math.max( result, itemWidth ); } return result; }
public String isValid(String newText) { if (newText != null && newText.trim().length() > 0 && !contains(categoryList.getItems(), newText)) return null; return "Unique name required"; } });
protected void removeSelectedWorkspaces() { // This would be a lot less code if we could use Jakarta CollectionUtils and/or ArrayUtils int[] selected = workspacesList.getSelectionIndices(); java.util.List<String> workspaces = new ArrayList<String>(Arrays.asList(workspacesList.getItems())); // Iterate bottom-up because removal changes indices in the list for (int i = selected.length-1; i >= 0; i--) { workspaces.remove(selected[i]); } String[] newItems = new String[workspaces.size()]; workspaces.toArray(newItems); workspacesList.setItems(newItems); }
private void selectFontFamilyInList( String fontFamily ) { lstFontFamily.deselectAll(); String[] items = lstFontFamily.getItems(); for( int i = 0; i < items.length; i++ ) { String item = items[ i ].toLowerCase( Locale.ENGLISH ); if( fontFamily.toLowerCase( Locale.ENGLISH ).equals( item ) ) { lstFontFamily.select( i ); } } }
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; }
private void setEntries(String items[]) { fList.remove(fList.getList().getItems()); for (int i = 0; i < items.length; i++) { if (items[i].trim().length() > 0) fList.add(items[i]); } }
public LibrarySelectionBean getBean(){ LibrarySelectionBean bean = new LibrarySelectionBean(); bean.setFileList(jarFileList.getItems()); return bean; }
private void updateJarList() { this.mJarList = createList(this.list.getItems()); this.mPropertySet.getBaseProperties().setProperty( IDriverMgmtConstants.PROP_DEFN_JARLIST, this.mJarList); isValid(); updatePropertyDescriptors(); } /*
@Override protected void doStore() { String s = createList(list.getItems()); if (s != null) { getPreferenceStore().setValue(getPreferenceName(), s); } }
protected void doStore() { String s = createList(list.getItems()); if (s != null) { getPreferenceStore().setValue(getPreferenceName(), s); } }
@Override protected void doStore() { String s = createList(list.getItems()); if (s != null) { getPreferenceStore().setValue(getPreferenceName(), s); } }
private static void writeItems( final List list ) throws IOException { JSWriter writer = JSWriter.getWriterFor( list ); String[] items = list.getItems(); if( WidgetLCAUtil.hasChanged( list, PROP_ITEMS, items, DEFAUT_ITEMS ) ) { // Convert newlines into whitespaces for( int i = 0; i < items.length; i++ ) { items[ i ] = WidgetLCAUtil.replaceNewLines( items[ i ], " " ); items[ i ] = WidgetLCAUtil.escapeText( items[ i ], false ); } writer.set( "items", new Object[]{ items } ); } }
@Override public void preserveValues( List list ) { preserveProperty( list, PROP_ITEMS, list.getItems() ); preserveProperty( list, PROP_SELECTION_INDICES, list.getSelectionIndices() ); preserveProperty( list, PROP_TOP_INDEX, list.getTopIndex() ); preserveProperty( list, PROP_FOCUS_INDEX, list.getFocusIndex() ); preserveProperty( list, PROP_ITEM_DIMENSIONS, getItemDimensions( list ) ); }