1 /*******************************************************************************
2 * Copyright (c) 2013 Kalray
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Xavier Raynaud - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.ui
.views
.filter
;
15 import org
.eclipse
.jface
.viewers
.ISelection
;
16 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
17 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
18 import org
.eclipse
.tracecompass
.tmf
.core
.filter
.model
.ITmfFilterTreeNode
;
21 * Handler for cut command in filter view
22 * @author Xavier Raynaud <xavier.raynaud@kalray.eu>
25 public class CutHandler
extends CopyHandler
{
28 protected ISelection
getSelection(FilterView tcv
) {
29 ISelection sel
= super.getSelection(tcv
);
30 if (sel
instanceof IStructuredSelection
) {
31 IStructuredSelection selection
= (IStructuredSelection
) sel
;
32 Object o
= selection
.getFirstElement();
33 if (o
instanceof ITmfFilterTreeNode
) {
34 ITmfFilterTreeNode node
= (ITmfFilterTreeNode
) o
;
37 return new StructuredSelection(node
);