/*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Menu,
   *      int)
   */
  public void fill(Menu parent, int index) {
    if (command == null) {
      return;
    }
    if (widget != null || parent == null) {
      return;
    }

    // Menus don't support the pulldown style
    int tmpStyle = style;
    if (tmpStyle == STYLE_PULLDOWN) tmpStyle = STYLE_PUSH;

    MenuItem item = null;
    if (index >= 0) {
      item = new MenuItem(parent, tmpStyle, index);
    } else {
      item = new MenuItem(parent, tmpStyle);
    }
    item.setData(this);

    item.addListener(SWT.Dispose, getItemListener());
    item.addListener(SWT.Selection, getItemListener());
    widget = item;

    update(null);
  }