1 /*******************************************************************************
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * See LICENSE for the full license text, also available.
7 *******************************************************************************/
8 package org
.eclipse
.egit
.ui
.internal
.fetch
;
10 import org
.eclipse
.jface
.viewers
.IStructuredContentProvider
;
11 import org
.eclipse
.jface
.viewers
.Viewer
;
12 import org
.spearce
.jgit
.transport
.FetchResult
;
13 import org
.spearce
.jgit
.transport
.TrackingRefUpdate
;
16 * Content provided for fetch result table viewer.
18 * Input of this provided must be {@link FetchResult} instance, while returned
19 * elements are instances of {@link TrackingRefUpdate}. Input may be null (no
23 * @see TrackingRefUpdate
25 class TrackingRefUpdateContentProvider
implements IStructuredContentProvider
{
26 public Object
[] getElements(final Object inputElement
) {
27 if (inputElement
== null)
28 return new TrackingRefUpdate
[0];
30 final FetchResult result
= (FetchResult
) inputElement
;
31 return result
.getTrackingRefUpdates().toArray(new TrackingRefUpdate
[0]);
34 public void dispose() {
38 public void inputChanged(Viewer viewer
, Object oldInput
, Object newInput
) {