blob: c08820cd672bd15800f1bc74a50e602ad7b4fbdc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
/*******************************************************************************
* Copyright (c) 2009 Atlassian and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Atlassian - initial API and implementation
* Tasktop Technologies - improvements
* Sebastien Dubois (Ericsson) - Improvements for bug 400266
******************************************************************************/
package org.eclipse.mylyn.internal.reviews.ui.compare;
import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.reviews.core.model.IFileItem;
import org.eclipse.mylyn.reviews.ui.ReviewBehavior;
import org.eclipse.osgi.util.NLS;
/**
* @author Steffen Pingel
* @author Sebastien Dubois
* @author Miles Parker
*/
public class FileItemCompareEditorInput extends ReviewItemCompareEditorInput {
private final IFileItem file;
public FileItemCompareEditorInput(CompareConfiguration configuration, IFileItem file, ReviewBehavior behavior) {
super(configuration, behavior);
this.file = file;
setTitle(NLS.bind(Messages.FileItemCompareEditorInput_Compare_X_Y_and_Z, new Object[] { file.getName(), file.getBase().getDescription(),
file.getTarget().getDescription() }));
}
@Override
protected Object prepareInput(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
FileItemNode node = new FileItemNode(behavior, file, monitor);
getCompareConfiguration().setLabelProvider(node, node.getLabelProvider());
return node;
}
}
|