/** * Removes the element at the given index from the given observable list. * Clients may extend but must call the super implementation. * * @param observableList * @param index * @return a status */ protected IStatus doRemove(IObservableList observableList, int index) { try { observableList.remove(index); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; }
/** * Removes the element at the given index from the given observable list. * Clients may extend but must call the super implementation. * * @param observableList * @param index * @return a status */ protected IStatus doRemove(IObservableList<? super D> observableList, int index) { try { observableList.remove(index); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; }
/** * Adds the given element at the given index to the given observable list. * Clients may extend but must call the super implementation. * * @param observableList * @param element * @param index * @return a status */ protected IStatus doAdd(IObservableList<? super D> observableList, D element, int index) { try { observableList.add(index, element); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; }
/** * Replaces the element in the observable list located at the given index to * with the given element. * * @param observableList * @param index * @param element * @return a status * @since 1.2 */ protected IStatus doReplace(IObservableList observableList, int index, Object element) { try { observableList.set(index, element); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; } }
/** * Adds the given element at the given index to the given observable list. * Clients may extend but must call the super implementation. * * @param observableList * @param element * @param index * @return a status */ protected IStatus doAdd(IObservableList observableList, Object element, int index) { try { observableList.add(index, element); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; }
/** * Moves the element in the observable list located at the given old index * to the given new index. * * @param observableList * @param oldIndex * @param newIndex * @return a status * @since 1.2 */ protected IStatus doMove(IObservableList<? super D> observableList, int oldIndex, int newIndex) { try { observableList.move(oldIndex, newIndex); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; }
/** * Moves the element in the observable list located at the given old index * to the given new index. * * @param observableList * @param oldIndex * @param newIndex * @return a status * @since 1.2 */ protected IStatus doMove(IObservableList observableList, int oldIndex, int newIndex) { try { observableList.move(oldIndex, newIndex); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; }
/** * Replaces the element in the observable list located at the given index to * with the given element. * * @param observableList * @param index * @param element * @return a status * @since 1.2 */ protected IStatus doReplace(IObservableList<? super D> observableList, int index, D element) { try { observableList.set(index, element); } catch (Exception ex) { return logErrorWhileSettingValue(ex); } return Status.OK_STATUS; } }