Skip to main content
summaryrefslogtreecommitdiffstats
blob: 1a1ea26a0f369fcdac2ada2c6b851330803b67a2 (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
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
package org.eclipse.compare.internal;

import java.util.ResourceBundle;
import org.eclipse.jface.action.Action;
import org.eclipse.compare.CompareEditorInput;


public class NavigationAction extends Action {
	
	private boolean fNext;
	private CompareEditorInput fCompareEditorInput;

	public NavigationAction(ResourceBundle bundle, boolean next) {
		Utilities.initAction(this, bundle, next ? "action.Next." : "action.Previous."); //$NON-NLS-2$ //$NON-NLS-1$
		fNext= next;
	}

	public void run() {
		if (fCompareEditorInput != null) {
			Object adapter= fCompareEditorInput.getAdapter(CompareNavigator.class);
			if (adapter instanceof CompareNavigator)
				((CompareNavigator)adapter).selectChange(fNext);
		}
	}
	
	public void setCompareEditorInput(CompareEditorInput input) {
		fCompareEditorInput= input;
	}
}

Back to the top