blob: 6ad7ad4de594182713067311c2c44e61aae71326 [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 AddSelectedElementsAction extends VisualiseSelectedElementAction {
/**
* Stores the string ID of the Action
*/
public static final String ID = "org.eclipse.viatra2.visualisation.addSelectedElements";
/**
*
*/
public AddSelectedElementsAction() {
super();
setId(ID);
setText("Add Selected Elements to the Graph View");
}
/**
* @param part
*/
public AddSelectedElementsAction(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) {
descriptor.includeItems(elements);
}
/* (non-Javadoc)
* @see org.eclipse.viatra2.visualisation.actions.VisualiseSelectedElementAction#updateSelf()
*/
@Override
public void updateSelf() {
if (getSelectedObjects().size()<1) setEnabled(false);
else setEnabled(true);
}
}