/******************************************************************************* * Copyright (c) 2013 Obeo. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Obeo - initial API and implementation *******************************************************************************/ package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.actions; import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIMessages; import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIPlugin; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.ui.plugin.AbstractUIPlugin; /** * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a> */ public class ExpandAllModelAction extends Action { private final AbstractTreeViewer treeViewer; public ExpandAllModelAction(AbstractTreeViewer treeViewer) { this.treeViewer = treeViewer; setToolTipText(EMFCompareIDEUIMessages.getString("expand.all.tooltip")); //$NON-NLS-1$ setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EMFCompareIDEUIPlugin.PLUGIN_ID, "icons/full/toolb16/expand_all.gif")); //$NON-NLS-1$ } /** * {@inheritDoc} * * @see org.eclipse.jface.action.Action#run() */ @Override public void run() { treeViewer.expandToLevel(256); } }