rename org.spearce.egit -> org.eclipse.egit and bump version to 0.5.0
[egit/imyousuf.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / GitHistoryPageSource.java
blobd67535145129a67648e771d0843f054d0c587f1a
1 /*******************************************************************************
2 * Copyright (C) 2007, Robin Rosenberg <robin.rosenberg@dewire.com>
3 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
5 * All rights reserved. This program and the accompanying materials
6 * are made available under the terms of the Eclipse Public License v1.0
7 * See LICENSE for the full license text, also available.
8 *******************************************************************************/
9 package org.eclipse.egit.ui;
11 import org.eclipse.core.resources.IResource;
12 import org.eclipse.egit.core.ResourceList;
13 import org.eclipse.egit.ui.internal.history.GitHistoryPage;
14 import org.eclipse.team.ui.history.HistoryPageSource;
15 import org.eclipse.ui.part.Page;
17 /**
18 * A helper class for constructing the {@link GitHistoryPage}.
20 public class GitHistoryPageSource extends HistoryPageSource {
21 public boolean canShowHistoryFor(final Object object) {
22 return GitHistoryPage.canShowHistoryFor(object);
25 public Page createPage(final Object object) {
26 final ResourceList input;
28 if (object instanceof ResourceList)
29 input = (ResourceList) object;
30 else if (object instanceof IResource)
31 input = new ResourceList(new IResource[] { (IResource) object });
32 else
33 input = new ResourceList(new IResource[0]);
35 final GitHistoryPage pg = new GitHistoryPage();
36 pg.setInput(input);
37 return pg;