]>
Commit | Line | Data |
---|---|---|
1b2798f6 EK |
1 | /******************************************************************************* |
2 | * Copyright (c) 2000, 2011 IBM Corporation and others. | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * IBM Corporation - initial API and implementation | |
10 | *******************************************************************************/ | |
11 | package org.eclipse.jdt.internal.ui.compare; | |
12 | ||
13 | import org.eclipse.jface.dialogs.MessageDialog; | |
14 | import org.eclipse.jface.viewers.ISelection; | |
15 | ||
16 | import org.eclipse.jdt.core.IMember; | |
17 | ||
18 | ||
19 | /** | |
20 | * Provides "Replace from local history" for Java elements. | |
21 | */ | |
22 | class JavaCompareWithEditionActionImpl extends JavaHistoryActionImpl { | |
23 | ||
24 | static boolean USE_MODAL_COMPARE = false; | |
25 | ||
26 | JavaCompareWithEditionActionImpl() { | |
27 | super(false); | |
28 | } | |
29 | ||
30 | @Override | |
31 | public void run(ISelection selection) { | |
32 | ||
33 | IMember input= getEditionElement(selection); | |
34 | if (input == null) { | |
35 | MessageDialog.openInformation(getShell(), CompareMessages.CompareWithHistory_title, CompareMessages.CompareWithHistory_invalidSelectionMessage); | |
36 | return; | |
37 | } | |
38 | ||
39 | JavaElementHistoryPageSource pageSource = JavaElementHistoryPageSource.getInstance(); | |
40 | pageSource.generated_8275858697855360124(input, this); | |
41 | } | |
42 | } | |
43 |