Skip to main content
summaryrefslogtreecommitdiffstats
blob: 87db063ac52b37072e5bc21b1b6644d4223de8a4 (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
47
48
49
50
51
52
53
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
package org.eclipse.compare.internal;

import java.util.ResourceBundle;

import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.Separator;

import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.EditorActionBarContributor;

import org.eclipse.compare.CompareConfiguration;


public class CompareEditorContributor extends EditorActionBarContributor {
	
	private IEditorPart fActiveEditorPart= null;

	private IgnoreWhiteSpaceAction fIgnoreWhitespace;
	//private ShowPseudoConflicts fShowPseudoConflicts;


	public CompareEditorContributor() {
		ResourceBundle bundle= CompareUIPlugin.getResourceBundle();
		fIgnoreWhitespace= new IgnoreWhiteSpaceAction(bundle, null);
		//fShowPseudoConflicts= new ShowPseudoConflicts(bundle, null);
	}

	public void contributeToToolBar(IToolBarManager tbm) {
		tbm.add(new Separator());
		tbm.add(fIgnoreWhitespace);
		//tbm.add(fShowPseudoConflicts);
	}

	public void setActiveEditor(IEditorPart targetEditor) {
				
		if (fActiveEditorPart != targetEditor) {
			fActiveEditorPart= targetEditor;
				
			if (targetEditor instanceof CompareEditor) {
				CompareEditor editor= (CompareEditor) targetEditor;
				editor.setActionBars(getActionBars());
			
				CompareConfiguration cc= editor.getCompareConfiguration();
				fIgnoreWhitespace.setCompareConfiguration(cc);
				//fShowPseudoConflicts.setCompareConfiguration(cc);
			}
		}
	}
}

Back to the top