01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.tests.macro;
11:
12: import org.eclipse.swt.widgets.Widget;
13: import org.eclipse.ui.IEditorPart;
14: import org.eclipse.ui.IWorkbenchPage;
15:
16: public class EditorCommandTarget extends CommandTarget {
17: /**
18: * @param widget
19: * @param context
20: */
21: public EditorCommandTarget(Widget widget, IEditorPart editor) {
22: super (widget, editor);
23: }
24:
25: public IEditorPart getEditor() {
26: return (IEditorPart) getContext();
27: }
28:
29: /* (non-Javadoc)
30: * @see org.eclipse.ui.macro.CommandTarget#ensureVisible()
31: */
32: public void ensureVisible() {
33: IEditorPart editor = getEditor();
34: IWorkbenchPage page = editor.getEditorSite().getPage();
35: page.activate(editor);
36: }
37: }
|