@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 ); } } );
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 ); } } } );
@Override public void handleReplace(int index, Object oldElement, Object newElement) { list.setItem(index, (String) newElement); } });
@Override protected void listSetItem(int index, String string) { list.setItem(index, string); }
@Override protected void listSetItem(int index, String string) { list.setItem(index, string); }
protected void listSetItem(int index, String string) { list.setItem(index, string); }
/** * Updates the value at the specified row. */ private void updateRow(int row, E value) { list.setItem(row, itemFormat.format(value)); }
/** * Updates the value at the specified row. */ private void updateRow(int row, Object value) { list.setItem(row, labelProvider.getText(value)); }
/** * Updates the value at the specified row. */ private void updateRow(int row, E value) { list.setItem(row, itemFormat.format(value)); }
/** * Sets the text of the item in the receiver's list at the given * zero-relative index to the string argument. This is equivalent * to <code>remove</code>'ing the old item at the index, and then * <code>add</code>'ing the new item at that index. * * @param index the index for the item * @param string the new text for the item * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setItem (int index, String string) { checkWidget(); list.setItem (index, string); } /**
/** * Sets the text of the item in the receiver's list at the given * zero-relative index to the string argument. This is equivalent * to <code>remove</code>'ing the old item at the index, and then * <code>add</code>'ing the new item at that index. * * @param index the index for the item * @param string the new text for the item * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setItem (int index, String string) { checkWidget(); list.setItem (index, string); } /**
/** * Sets the text of the item in the receiver's list at the given * zero-relative index to the string argument. This is equivalent * to <code>remove</code>'ing the old item at the index, and then * <code>add</code>'ing the new item at that index. * * @param index the index for the item * @param string the new text for the item * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setItem (int index, String string) { checkWidget(); list.setItem (index, string); } /**
/** * Sets the text of the item in the receiver's list at the given * zero-relative index to the string argument. This is equivalent * to <code>remove</code>'ing the old item at the index, and then * <code>add</code>'ing the new item at that index. * * @param index the index for the item * @param string the new text for the item * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setItem (int index, String string) { checkWidget(); list.setItem (index, string); } /**
/** * Sets the text of the item in the receiver's list at the given * zero-relative index to the string argument. This is equivalent * to <code>remove</code>'ing the old item at the index, and then * <code>add</code>'ing the new item at that index. * * @param index the index for the item * @param string the new text for the item * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception org.eclipse.swt.SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setItem (int index, String string) { checkWidget(); list.setItem (index, string); } /**
/** * Sets the text of the item in the receiver's list at the given * zero-relative index to the string argument. This is equivalent * to <code>remove</code>'ing the old item at the index, and then * <code>add</code>'ing the new item at that index. * * @param index the index for the item * @param string the new text for the item * * @exception IllegalArgumentException <ul> * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li> * <li>ERROR_NULL_ARGUMENT - if the string is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setItem (int index, String string) { checkWidget(); list.setItem (index, string); } /**
public static void setItem(Control ccombo, Object value, int index){ String str = value == null ? "" : String.valueOf(value); if(ccombo instanceof CCombo){ ((CCombo) ccombo).setItem(index, str); }else if(ccombo instanceof Combo){ ((Combo) ccombo).setItem(index, str); }else if(ccombo instanceof org.eclipse.swt.widgets.List){ ((org.eclipse.swt.widgets.List) ccombo).setItem(index, str); } }
private void moveUpRule () { int n = lbRules.getSelectionIndex(); if ( n < 1 ) return; saveRuleData(ruleIndex); ruleIndex = -1; // Move in the rules array Rule tmp = rules.get(n); rules.set(n, rules.get(n-1)); rules.set(n-1, tmp); // Refresh the list box lbRules.setItem(n, rules.get(n).getRuleName()); lbRules.setItem(n-1, rules.get(n-1).getRuleName()); lbRules.select(n-1); updateRule(); updateRuleButtons(); }
public void handleEvent(Event event) { DeviceEntry entry = (DeviceEntry) deviceModel.elementAt(lsDevices.getSelectionIndex()); for (int i = 0; i < deviceModel.size(); i++) { DeviceEntry tmp = (DeviceEntry) deviceModel.elementAt(i); if (tmp == entry) { tmp.setDefaultDevice(true); lsDevices.setItem(i, tmp.getName() + " (default)"); } else { tmp.setDefaultDevice(false); lsDevices.setItem(i, tmp.getName()); } Config.changeDeviceEntry(tmp); } btDefault.setEnabled(false); } };
private void moveDownRule () { int n = lbRules.getSelectionIndex(); if ( n < 0 ) return; saveRuleData(ruleIndex); ruleIndex = -1; // Move in the rules array Rule tmp = rules.get(n); rules.set(n, rules.get(n+1)); rules.set(n+1, tmp); // Refresh the list box lbRules.setItem(n, rules.get(n).getRuleName()); lbRules.setItem(n+1, rules.get(n+1).getRuleName()); lbRules.select(n+1); updateRule(); updateRuleButtons(); }
private void renameRule () { try { int n = lbRules.getSelectionIndex(); if ( n == -1 ) return; Rule rule = rules.get(n); String name = rule.getRuleName(); InputDialog dlg = new InputDialog(shell, Res.getString("Editor.renameRule"), //$NON-NLS-1$ Res.getString("Editor.newRuleName"), name, null, 0, -1, -1); //$NON-NLS-1$ if ( (name = dlg.showDialog()) == null ) return; rule.setRuleName(name); lbRules.setItem(n, name); } catch ( Throwable e ) { Dialogs.showError(shell, e.getMessage(), null); } }