/**
   * Returns a composite command with the given initial command and the RegionContainer specific
   * auto-size commands to propagate the auto-size to the regions.
   *
   * @param request the initial request
   * @param autoSizeCommand the initial command
   * @return a composite command with the initial command and the region container specific
   *     additional commands.
   */
  protected Command getRegionContainerAutoSizeCommand(Request request, Command autoSizeCommand) {
    IDiagramElementEditPart host = (IDiagramElementEditPart) getHost();
    TransactionalEditingDomain domain = host.getEditingDomain();
    CompositeTransactionalCommand ctc =
        new CompositeTransactionalCommand(
            domain,
            Messages.RegionContainerResizableEditPolicy_regionContainerAutoSizeCommandLabel);
    ctc.add(new CommandProxy(autoSizeCommand));
    Command regionContainerAutoSizeCommand = new ICommandProxy(ctc);

    // Propagate the auto-size request to the regions.
    Request req = new Request();
    req.setType(request.getType());
    req.getExtendedData().put(REGION_AUTO_SIZE_PROPAGATOR, host);

    Object object = request.getExtendedData().get(REGION_AUTO_SIZE_PROPAGATOR);
    for (EditPart regionPart : getRegionParts()) {
      if (object != regionPart) {
        ctc.add(new CommandProxy(regionPart.getCommand(req)));
      }
    }

    ctc.add(
        CommandFactory.createICommand(
            domain, new RegionContainerUpdateLayoutOperation((Node) host.getModel())));
    return regionContainerAutoSizeCommand;
  }