1 /*******************************************************************************
2 * Copyright (c) 2013 Dirk Fauth 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
9 * Dirk Fauth <dirk.fauth@gmail.com> - initial API and implementation
10 *******************************************************************************/
11 package org.simantics.browsing.ui.nattable.override;
13 import org.eclipse.nebula.widgets.nattable.command.ILayerCommandHandler;
14 import org.eclipse.nebula.widgets.nattable.layer.ILayer;
15 import org.eclipse.nebula.widgets.nattable.tree.TreeLayer;
16 import org.eclipse.nebula.widgets.nattable.tree.command.TreeCollapseAllCommand;
19 * Command handler for the TreeCollapseAllCommand.
21 * Will search over the whole tree structure in the associated TreeLayer to
22 * identify collapsible nodes and collapse them one after the other.
27 * @see TreeCollapseAllCommand
29 public class TreeCollapseAllCommandHandler implements
30 ILayerCommandHandler<TreeCollapseAllCommand> {
33 * The TreeLayer to which this command handler is connected.
35 private final TreeLayer2 treeLayer;
40 * The TreeLayer to which this command handler should be
43 public TreeCollapseAllCommandHandler(TreeLayer2 treeLayer) {
44 this.treeLayer = treeLayer;
48 public boolean doCommand(ILayer targetLayer, TreeCollapseAllCommand command) {
49 this.treeLayer.collapseAll();
54 public Class<TreeCollapseAllCommand> getCommandClass() {
55 return TreeCollapseAllCommand.class;