/******************************************************************************* | |
* 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 AddSelectedSubtreeAction extends | |
VisualiseSelectedElementAction { | |
/** | |
* Stores the string ID of the Action | |
*/ | |
public static final String ID = "org.eclipse.viatra2.visualisation.addSelectedElementAction"; | |
/** | |
* | |
*/ | |
public AddSelectedSubtreeAction() { | |
super(); | |
setId(ID); | |
setText("Add Selected Subtree to the Graph View"); | |
} | |
/** | |
* @param part | |
*/ | |
public AddSelectedSubtreeAction(IWorkbenchPart part) { | |
this(); | |
} | |
@Override | |
void loadFilterData(ViatraVisualisationView view, | |
List<IModelElement> elements) { | |
descriptor.includeItem(elements.get(0)); | |
} | |
} |