Have icon for "reset" entry in reflog
[egit/eclipse.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / search / CommitMatch.java
blob6af4bf2c4b83bb2ed8e12f10951411c6a9cd16c0
1 /*******************************************************************************
2 * Copyright (c) 2011 GitHub Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License 2.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-2.0/
8 * SPDX-License-Identifier: EPL-2.0
10 * Contributors:
11 * Kevin Sawicki (GitHub Inc.) - initial API and implementation
12 *******************************************************************************/
13 package org.eclipse.egit.ui.internal.search;
15 import org.eclipse.egit.ui.internal.commit.RepositoryCommit;
16 import org.eclipse.jface.resource.ImageDescriptor;
17 import org.eclipse.search.ui.text.Match;
18 import org.eclipse.ui.model.IWorkbenchAdapter;
20 /**
21 * Commit match class.
23 public class CommitMatch extends Match implements IWorkbenchAdapter {
25 private RepositoryCommit commit;
27 /**
28 * @param commit
30 public CommitMatch(RepositoryCommit commit) {
31 this(commit, 0, 0);
34 /**
35 * @param commit
36 * @param offset
37 * @param length
39 public CommitMatch(RepositoryCommit commit, int offset, int length) {
40 super(commit, offset, length);
41 this.commit = commit;
44 /**
45 * Get repository commit
47 * @return commit
49 public RepositoryCommit getCommit() {
50 return this.commit;
53 @Override
54 public Object[] getChildren(Object o) {
55 return new Object[0];
58 @Override
59 public ImageDescriptor getImageDescriptor(Object object) {
60 return this.commit.getImageDescriptor(object);
63 @Override
64 public String getLabel(Object o) {
65 return this.commit.getLabel(o);
68 @Override
69 public Object getParent(Object o) {
70 return null;