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 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org
.eclipse
.egit
.ui
.internal
.fetch
;
11 import org
.eclipse
.jface
.viewers
.IStructuredContentProvider
;
12 import org
.eclipse
.jface
.viewers
.Viewer
;
13 import org
.spearce
.jgit
.transport
.FetchResult
;
14 import org
.spearce
.jgit
.transport
.TrackingRefUpdate
;
17 * Content provided for fetch result table viewer.
19 * Input of this provided must be {@link FetchResult} instance, while returned
20 * elements are instances of {@link TrackingRefUpdate}. Input may be null (no
24 * @see TrackingRefUpdate
26 class TrackingRefUpdateContentProvider
implements IStructuredContentProvider
{
27 public Object
[] getElements(final Object inputElement
) {
28 if (inputElement
== null)
29 return new TrackingRefUpdate
[0];
31 final FetchResult result
= (FetchResult
) inputElement
;
32 return result
.getTrackingRefUpdates().toArray(new TrackingRefUpdate
[0]);
35 public void dispose() {
39 public void inputChanged(Viewer viewer
, Object oldInput
, Object newInput
) {