@Override public IViewerObservableValue observeDelayed(int delay, Viewer viewer) { return ViewersObservables.observeDelayedValue(delay, observe(viewer)); } }
@Override public Object getParent ( final Object element ) { return super.getParent ( element ); } }
/** * Returns an observable value that tracks the current selection of the * given selection provider. If the selection provider provides selections * of type {@link IStructuredSelection}, the observable value will be the * first element of the structured selection as returned by * {@link IStructuredSelection#getFirstElement()}. * * @param selectionProvider * @return the observable value tracking the (single) selection of the given * selection provider */ public static IObservableValue observeSingleSelection( ISelectionProvider selectionProvider) { checkNull(selectionProvider); return ViewerProperties.singleSelection().observe(selectionProvider); }
/** * Returns an observable value that tracks the input of the given viewer. * <p> * The returned observer is blind to changes in the viewer's input unless * its {@link IObservableValue#setValue(Object)} method is called directly. * * @param viewer * the viewer to observe * @return an observable value tracking the input of the given viewer * @since 1.2 */ public static IObservableValue observeInput(Viewer viewer) { checkNull(viewer); return ViewerProperties.input().observe(viewer); }
/** * Returns an observable set that tracks the checked elements of the given * <code>ICheckable</code>. * * @param checkable * {@link ICheckable} containing the checked elements to track * @param elementType * element type of the returned set * @return an observable set tracking the checked elements of the given * checkable. * @since 1.2 */ public static IObservableSet observeCheckedElements(ICheckable checkable, Object elementType) { checkNull(checkable); return ViewerProperties.checkedElements(elementType).observe(checkable); }
/** * Binds the viewer to the specified input, using the specified label * property to generate labels. * * @param viewer * the viewer to set up * @param input * the input to set on the viewer * @param labelProperty * the property to use for labels */ public static void bind(StructuredViewer viewer, IObservableList input, IValueProperty labelProperty) { bind(viewer, input, new IValueProperty[] { labelProperty }); }
/** * Returns an observable list that tracks the current selection of the given * viewer. Assumes that the viewer provides selections of type * {@link IStructuredSelection}. Note that the observable list will not * honor the full contract of <code>java.util.List</code> in that it may * delete or reorder elements based on what the viewer returns from * {@link ISelectionProvider#getSelection()} after having called * {@link ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)} * based on the requested change to the observable list. The affected * methods are <code>add</code>, <code>addAll</code>, and <code>set</code>. * * @param viewer * @return the observable value tracking the (multi) selection of the given * selection provider * * @since 1.2 */ public static IViewerObservableList observeMultiSelection(Viewer viewer) { checkNull(viewer); return ViewerProperties.multipleSelection().observe(viewer); }
@Override protected IObservablesListener createCollectionChangeListener( Object parentElement) { return new SetChangeListener(parentElement); }
@Override public void handleMove(int oldIndex, int newIndex, Object element) { viewerUpdater.move(element, oldIndex, newIndex); } });
/** * Constructs an ObservableSetContentProvider with the given viewer updater. * Must be called from the display thread. * * @param viewerUpdater * the viewer updater to use when elements are added or removed * from the input observable set. * @since 1.3 */ public ObservableSetContentProvider(IViewerUpdater viewerUpdater) { impl = new Impl(viewerUpdater); }
@Override public void handleAdd(int index, Object element) { viewerUpdater.insert(element, index); }
@Override protected IObservablesListener createCollectionChangeListener( Object parentElement) { return new ListChangeListener(parentElement); }
@Override public void handleReplace(int index, Object oldElement, Object newElement) { viewerUpdater.replace(oldElement, newElement, index); }
/** * Constructs an ObservableListContentProvider with the given viewer * updater. Must be called from the display thread. * * @param viewerUpdater * the viewer updater to use when elements are added, removed, * moved or replaced in the input observable list. * @since 1.3 */ public ObservableListContentProvider(IViewerUpdater viewerUpdater) { impl = new Impl(viewerUpdater); }
@Override public String getText(Object element) { return getColumnText(element, 0); }
@Override public void handleRemove(int index, Object element) { viewerUpdater.remove(element, index); }
@Override public Object getParent ( final Object element ) { return super.getParent ( element ); } }
/** * Returns an observable value that tracks the current selection of the * given viewer. If the viewer provides selections of type * {@link IStructuredSelection}, the observable value will be the first * element of the structured selection as returned by * {@link IStructuredSelection#getFirstElement()}. * * @param viewer * the viewer * @return the observable value tracking the (single) selection of the given * viewer * @since 1.2 */ public static IViewerObservableValue observeSingleSelection(Viewer viewer) { checkNull(viewer); return ViewerProperties.singleSelection().observe(viewer); }
/** * Returns an observable set that tracks the checked elements of the given * viewer. Assumes that the viewer implements {@link ICheckable}. * * @param viewer * {@link CheckboxTreeViewer} containing the checked elements to * track. * @param elementType * element type of the returned set * @return an observable set that tracks the checked elements of the given * viewer. * @since 1.2 */ public static IViewerObservableSet observeCheckedElements( CheckboxTreeViewer viewer, Object elementType) { checkNull(viewer); return ViewerProperties.checkedElements(elementType).observe(viewer); }
@Override public Object getParent ( final Object element ) { return super.getParent ( element ); } }