use of com.intellij.util.xml.MergedObject in project intellij-community by JetBrains.
the class AddElementInCollectionAction method createAddingAction.
@Override
protected AnAction createAddingAction(final AnActionEvent e, final String name, final Icon icon, final Type type, final DomCollectionChildDescription description) {
final DomElement parentDomElement = getParentDomElement(e);
if (parentDomElement instanceof MergedObject) {
final List<DomElement> implementations = (List<DomElement>) ((MergedObject) parentDomElement).getImplementations();
final DefaultActionGroup actionGroup = new DefaultActionGroup(name, true);
for (DomElement implementation : implementations) {
final XmlFile xmlFile = DomUtil.getFile(implementation);
actionGroup.add(new MyDefaultAddAction(implementation, xmlFile.getName(), xmlFile.getIcon(0), e, type, description));
}
return actionGroup;
}
return new MyDefaultAddAction(parentDomElement, name, icon, e, type, description);
}
Aggregations