KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > console > actions > CloseConsoleAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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 package org.eclipse.ui.console.actions;
12
13 import org.eclipse.jface.action.Action;
14 import org.eclipse.ui.console.ConsolePlugin;
15 import org.eclipse.ui.console.IConsole;
16 import org.eclipse.ui.internal.console.ConsoleMessages;
17 import org.eclipse.ui.internal.console.ConsolePluginImages;
18 import org.eclipse.ui.internal.console.IInternalConsoleConstants;
19
20 /**
21  * Removes a console from the console manager.
22  * <p>
23  * Clients may instantiate this class; this class is not intended to
24  * be subclassed.
25  * </p>
26  * @since 3.1
27  */

28 public class CloseConsoleAction extends Action {
29     
30     private IConsole fConsole;
31     
32     public CloseConsoleAction(IConsole console) {
33         super(ConsoleMessages.CloseConsoleAction_0, ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLOSE));
34         setToolTipText(ConsoleMessages.CloseConsoleAction_1);
35         fConsole = console;
36     }
37
38     public void run() {
39         ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[]{fConsole});
40     }
41 }
42
Popular Tags