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.ui.internal.ide.dialogs;
11:
12: import org.eclipse.ui.IActionBars;
13: import org.eclipse.ui.IEditorPart;
14: import org.eclipse.ui.actions.ActionFactory;
15: import org.eclipse.ui.part.EditorActionBarContributor;
16:
17: /**
18: * Manages the installation and deinstallation of global actions for
19: * the welcome editor.
20: */
21: public class WelcomeEditorActionContributor extends
22: EditorActionBarContributor {
23: /**
24: * The <code>WelcomeEditorActionContributor</code> implementation of this
25: * <code>IEditorActionBarContributor</code> method installs the global
26: * action handler for the given editor.
27: */
28: public void setActiveEditor(IEditorPart part) {
29: IActionBars actionBars = getActionBars();
30: if (actionBars != null) {
31: actionBars.setGlobalActionHandler(ActionFactory.COPY
32: .getId(), ((WelcomeEditor) part).getCopyAction());
33: }
34: }
35: }
|