| /******************************************************************************* |
| * Copyright (c) 2009 Zoltan Ujhelyi and Daniel Varro. |
| * 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: |
| * Zoltan Ujhelyi - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.viatra2.visualisation.modelspace.actions; |
| |
| |
| import java.util.List; |
| |
| import org.eclipse.ui.IWorkbenchPart; |
| import org.eclipse.viatra2.core.IModelElement; |
| import org.eclipse.viatra2.visualisation.view.ViatraVisualisationView; |
| |
| /** |
| * @author Zoltan Ujhelyi |
| * |
| */ |
| public class RemoveSelectedSubtreeAction extends VisualiseSelectedElementAction { |
| |
| /** |
| * Stores the string ID of the Action |
| */ |
| public static final String ID = "org.eclipse.viatra2.visualisation.removeSelectedSubtreeAction"; |
| /** |
| * |
| */ |
| public RemoveSelectedSubtreeAction() { |
| super(); |
| setId(ID); |
| setText("Remove Selected Subtree from the Graph View"); |
| } |
| |
| /** |
| * @param part |
| */ |
| public RemoveSelectedSubtreeAction(IWorkbenchPart part) { |
| this(); |
| } |
| |
| @Override |
| void loadFilterData(ViatraVisualisationView view, |
| List<IModelElement> elements) { |
| if (descriptor != null) |
| descriptor.excludeItem(elements.get(0)); |
| |
| } |
| |
| |
| } |