1 /*******************************************************************************
2 * Copyright (c) 2012 Original authors 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 * Original authors and others - initial API and implementation
10 ******************************************************************************/
11 package org.simantics.browsing.ui.nattable.override;
13 import org.eclipse.nebula.widgets.nattable.command.AbstractLayerCommandHandler;
14 import org.eclipse.nebula.widgets.nattable.tree.command.TreeExpandCollapseCommand;
16 public class TreeExpandCollapseCommandHandler extends
17 AbstractLayerCommandHandler<TreeExpandCollapseCommand> {
19 private final TreeLayer2 treeLayer;
21 public TreeExpandCollapseCommandHandler(TreeLayer2 treeLayer) {
22 this.treeLayer = treeLayer;
26 public Class<TreeExpandCollapseCommand> getCommandClass() {
27 return TreeExpandCollapseCommand.class;
31 protected boolean doCommand(TreeExpandCollapseCommand command) {
32 int parentIndex = command.getParentIndex();
33 this.treeLayer.expandOrCollapseIndex(parentIndex);