blob: 8b380906e57b6fe90ac7519a8eaf39aa91cd5e69 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2007 Boeing.
* 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:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.blam.operation;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.skynet.core.artifact.ChangeArtifactType;
import org.eclipse.osee.framework.skynet.core.attribute.Attribute;
import org.eclipse.osee.framework.skynet.core.relation.RelationLink;
import org.eclipse.osee.framework.ui.skynet.blam.VariableMap;
/**
* Changes the descriptor type of an artifact to the provided descriptor.
*
* @author Jeff C. Phillips
*/
public class ChangeArtifactTypeBlam extends AbstractBlam {
private List<Attribute<?>> attributesToPurge;
private List<RelationLink> relationsToDelete;
/* (non-Javadoc)
* @see org.eclipse.osee.framework.ui.skynet.blam.operation.AbstractBlam#getName()
*/
@Override
public String getName() {
return "Change Artifact Type";
}
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception {
ChangeArtifactType.changeArtifactType(variableMap.getArtifacts("artifacts"),
variableMap.getArtifactType("New Artifact Type"));
}
/*
* (non-Javadoc)
*
* @see org.eclipse.osee.framework.ui.skynet.blam.operation.BlamOperation#getXWidgetXml()
*/
@Override
public String getXWidgetsXml() {
return "<xWidgets><XWidget xwidgetType=\"XListDropViewer\" displayName=\"artifacts\" />" +
//
"<XWidget xwidgetType=\"XArtifactTypeListViewer\" displayName=\"New Artifact Type\" /></xWidgets>";
}
public Collection<String> getCategories() {
return Arrays.asList("Define");
}
}