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.TreeExpandAllCommand;
19 * Command handler for the TreeExpandAllCommand.
21 * Will search over the whole tree structure in the associated TreeLayer to
22 * identify expandable nodes and expand them one after the other.
27 * @see TreeExpandAllCommand
30 public class TreeExpandAllCommandHandler implements
31 ILayerCommandHandler<TreeExpandAllCommand> {
34 * The TreeLayer to which this command handler is connected.
36 private final TreeLayer2 treeLayer;
41 * The TreeLayer to which this command handler should be
44 public TreeExpandAllCommandHandler(TreeLayer2 treeLayer) {
45 this.treeLayer = treeLayer;
49 public boolean doCommand(ILayer targetLayer, TreeExpandAllCommand command) {
50 this.treeLayer.expandAll();
55 public Class<TreeExpandAllCommand> getCommandClass() {
56 return TreeExpandAllCommand.class;