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.IViewPart;
14: import org.eclipse.ui.IWorkbenchPage;
15:
16: public class ViewCommandTarget extends CommandTarget {
17: public ViewCommandTarget(Widget widget, IViewPart view) {
18: super (widget, view);
19: }
20:
21: public IViewPart getView() {
22: return (IViewPart) getContext();
23: }
24:
25: /* (non-Javadoc)
26: * @see org.eclipse.ui.macro.CommandTarget#ensureVisible()
27: */
28: public void ensureVisible() {
29: IViewPart view = getView();
30: IWorkbenchPage page = view.getViewSite().getPage();
31: page.activate(view);
32: }
33: }
|