/** * This creates the command that creates the child and adds it under the * single selected object, specified in collection. */ @Override protected Command createActionCommand(EditingDomain editingDomain, Collection<?> collection) { if (collection.size() == 1) { return CreateChildCommand.create(editingDomain, collection.iterator().next(), newChildDescriptor, collection); } else { return UnexecutableCommand.INSTANCE; } } }