blob: 2e0f5bd46f026a55ee06e270fa224b3f9a65afa8 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2005 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.core.tools;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.TreeViewer;
/**
* @since 3.0
*/
public class CollapseAllAction extends Action implements IAction {
private static final String label = "Collapse All"; //$NON-NLS-1$
private static final String imageName = "collapseall.gif"; //$NON-NLS-1$
private TreeViewer viewer;
public CollapseAllAction(TreeViewer viewer) {
super(label);
this.setToolTipText(label);
this.viewer = viewer;
this.setImageDescriptor(CoreToolsPlugin.createImageDescriptor(imageName));
}
@Override
public void run() {
viewer.collapseAll();
}
}