KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > ide > dialogs > WelcomeEditorActionContributor


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.internal.ide.dialogs;
13
14 import org.eclipse.ui.IActionBars;
15 import org.eclipse.ui.IEditorPart;
16 import org.eclipse.ui.actions.ActionFactory;
17 import org.eclipse.ui.part.EditorActionBarContributor;
18
19 /**
20  * Manages the installation and deinstallation of global actions for
21  * the welcome editor.
22  */

23 public class WelcomeEditorActionContributor extends EditorActionBarContributor {
24     /**
25      * The <code>WelcomeEditorActionContributor</code> implementation of this
26      * <code>IEditorActionBarContributor</code> method installs the global
27      * action handler for the given editor.
28      */

29     public void setActiveEditor(IEditorPart part) {
30         IActionBars actionBars = getActionBars();
31         if (actionBars != null) {
32             actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(),
33                     ((WelcomeEditor) part).getCopyAction());
34         }
35     }
36 }
37
Popular Tags