blob: 31fd0a3b88ec32ba2f1b1497913187c914b367f9 [file] [log] [blame]
package org.eclipse.epf.library.configuration;
import org.eclipse.epf.library.edit.VariabilityInfo;
import org.eclipse.epf.uma.MethodConfiguration;
import org.eclipse.epf.uma.MethodElement;
import org.eclipse.epf.uma.VariabilityElement;
/**
* A configurator used by activity deep copy command to resovle and deep copy contributors and
* replacers of activity in a metohd configuration.
*
*/
public class ActivityDeepCopyConfigurator extends ConfigurationFilter{
/**
* constructor
* @param methodConfig a <code>MethodConfiguration</code>
* @param viewer a <code>Viewer</code>
*/
public ActivityDeepCopyConfigurator(MethodConfiguration methodConfig) {
super(methodConfig);
}
/**
* Constructs with null methodConfig which could be set later.
*/
public ActivityDeepCopyConfigurator() {
this(null);
}
@Override
public VariabilityInfo getVariabilityInfo(VariabilityElement ve) {
// calculate the element first
ElementRealizer realizer = new DefaultElementRealizer(methodConfig, false, true){
@Override
public boolean canShow(MethodElement element) {
return true;
}
};
return getVariabilityInfo(ve, realizer);
}
/**
* Overrides the super method for not resolving the base to include additional contributors.
*/
@Override
protected void resolveElementVariabilityList(VariabilityElement element,
VariabilityInfo info, boolean includeBase, ElementRealizer realizer) {
if (methodConfig == null) {
return;
}
//resolve to include contributors
resolveElementContributors(element,info,realizer);
}
}