blob: 23fb38b801294049e749369a5c6ac33546f2db32 [file] [log] [blame]
/*******************************************************************************
* 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;
/**
* This action is used to remove a list of selected elements from the graph viewer
* @author Zoltan Ujhelyi
*
*/
public class RemoveSelectedElementsAction extends VisualiseSelectedElementAction {
/**
* Stores the string ID of the Action
*/
public static final String ID = "org.eclipse.viatra2.visualisation.removeSelectedElements";
/**
*
*/
public RemoveSelectedElementsAction() {
super();
setId(ID);
setText("Remove Selected Elements to the Graph View");
}
/**
* @param part
*/
public RemoveSelectedElementsAction(IWorkbenchPart part) {
super();
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.visualisation.actions.VisualiseSelectedElementAction#loadFilterData(org.eclipse.viatra2.visualisation.view.ModelSpaceVisualisationView, java.util.List)
*/
@Override
void loadFilterData(ViatraVisualisationView view,
List<IModelElement> elements) {
if (descriptor != null)
descriptor.excludeItems(elements);
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.visualisation.actions.VisualiseSelectedElementAction#updateSelf()
*/
@Override
public void updateSelf() {
if (getSelectedObjects().size()<1) setEnabled(false);
else setEnabled(true);
}
}