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.internal;
11:
12: import org.eclipse.ui.IPerspectiveDescriptor;
13: import org.eclipse.ui.IWorkbenchPage;
14: import org.eclipse.ui.IWorkbenchWindow;
15:
16: /**
17: * The <code>CloseAllPerspectivesAction</code> is used to close all of
18: * the opened perspectives in the workbench window's active page.
19: */
20: public class CloseAllPerspectivesAction extends PerspectiveAction {
21:
22: /**
23: * Create a new instance of <code>CloseAllPerspectivesAction</code>
24: *
25: * @param window the workbench window this action applies to
26: */
27: public CloseAllPerspectivesAction(IWorkbenchWindow window) {
28: super (window);
29: setText(WorkbenchMessages.CloseAllPerspectivesAction_text);
30: setActionDefinitionId("org.eclipse.ui.window.closeAllPerspectives"); //$NON-NLS-1$
31: // @issue missing action id
32: setToolTipText(WorkbenchMessages.CloseAllPerspectivesAction_toolTip);
33: window.getWorkbench().getHelpSystem().setHelp(this ,
34: IWorkbenchHelpContextIds.CLOSE_ALL_PAGES_ACTION);
35: }
36:
37: /* (non-Javadoc)
38: * Method declared on PerspectiveAction.
39: */
40: protected void run(IWorkbenchPage page, IPerspectiveDescriptor persp) {
41: page.closeAllPerspectives(true, true);
42: }
43:
44: }
|