Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 56238ae92bb12927a3f20a781b74e6bd1d555630 (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
/*******************************************************************************
 * Copyright (c) 2007, 2018 Borland Software Corporation 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:
 *     Borland Software Corporation - initial API and implementation
 *     Christopher Gerking - bug 428620
 *     Ed Willink - bug 533155
 *******************************************************************************/
package org.eclipse.m2m.internal.qvt.oml.runtime.ui.trace.editor;

import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.m2m.internal.qvt.oml.runtime.ui.trace.common.TraceActionBarContributor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.EditorActionBarContributor;

/**
 * @author aigdalov
 */
public class TraceEditorActionBarContributor extends EditorActionBarContributor {
	private final TraceActionBarContributor myTraceActionBarContributor = new TraceActionBarContributor();

	@Override
	public void contributeToToolBar(IToolBarManager toolBarManager) {
		myTraceActionBarContributor.contributeToToolBar(toolBarManager);
	}

	@Override
	public void setActiveEditor(IEditorPart targetEditor) {
		if (targetEditor instanceof TraceEditorPart) {
			TraceEditorPart traceEditorPart = (TraceEditorPart) targetEditor;
			TreeViewer viewer = traceEditorPart.getViewer();
			myTraceActionBarContributor.setViewer(viewer);
		}
	}
}

Back to the top