01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 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.console.actions;
11:
12: import org.eclipse.jface.action.Action;
13: import org.eclipse.ui.console.ConsolePlugin;
14: import org.eclipse.ui.console.IConsole;
15: import org.eclipse.ui.internal.console.ConsoleMessages;
16: import org.eclipse.ui.internal.console.ConsolePluginImages;
17: import org.eclipse.ui.internal.console.IInternalConsoleConstants;
18:
19: /**
20: * Removes a console from the console manager.
21: * <p>
22: * Clients may instantiate this class; this class is not intended to
23: * be subclassed.
24: * </p>
25: * @since 3.1
26: */
27: public class CloseConsoleAction extends Action {
28:
29: private IConsole fConsole;
30:
31: public CloseConsoleAction(IConsole console) {
32: super (
33: ConsoleMessages.CloseConsoleAction_0,
34: ConsolePluginImages
35: .getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLOSE));
36: setToolTipText(ConsoleMessages.CloseConsoleAction_1);
37: fConsole = console;
38: }
39:
40: public void run() {
41: ConsolePlugin.getDefault().getConsoleManager().removeConsoles(
42: new IConsole[] { fConsole });
43: }
44: }
|