protected JPopupMenu buildPopupMenu(){
  JPopupMenu ret=new JPopupMenu();
  if (getData() instanceof MutableTable) {
    if (showInsertRowPopupMenu) {
      ret.add(TableActionManager.getInsertRowAction(this));
    }
    if (showInsertColumnPopupMenu) {
      if (getSelectedColumn() >= 0) {
        ret.add(TableActionManager.getInsertColumnAction(this));
      }
    }
    if (showDeleteRowPopupMenu) {
      ret.add(TableActionManager.getDeleteRowAction(this));
    }
    if (showDeleteColumnPopupMenu) {
      if (getSelectedColumn() != 0) {
        ret.add(TableActionManager.getDeleteColumnAction(this));
      }
    }
  }
  if (showEditInPopupMenu) {
    JMenuItem editItem=getMenuEdit();
    if (editItem != null) {
      ret.add(editItem);
    }
  }
  if (showRandomizeInPopupMenu) {
    JMenuItem randomizeItem=getMenuRandomize();
    if (randomizeItem != null) {
      ret.add(randomizeItem);
    }
  }
  if (showNormalizeInPopupMenu) {
    JMenuItem normalizeItem=getMenuNormalize();
    if (normalizeItem != null) {
      ret.add(normalizeItem);
    }
  }
  if (showFillInPopupMenu) {
    JMenuItem fillItem=getMenuFill();
    if (fillItem != null) {
      ret.add(fillItem);
    }
  }
  return ret;
}

protected JPopupMenu buildPopupMenu ( ) { JPopupMenu ret = new JPopupMenu ( ) ; if ( getData ( ) instanceof MutableTable ) { if ( showInsertRowPopupMenu ) { ret . add ( TableActionManager . getInsertRowAction ( this ) ) ; } if ( showInsertColumnPopupMenu ) { if ( getSelectedColumn ( ) >= 0 ) { ret . add ( TableActionManager . getInsertColumnAction ( this ) ) ; } } if ( showDeleteRowPopupMenu ) { ret . add ( TableActionManager . getDeleteRowAction ( this ) ) ; } if ( showDeleteColumnPopupMenu ) { if ( getSelectedColumn ( ) != 0 ) { ret . add ( TableActionManager . getDeleteColumnAction ( this ) ) ; } } } if ( showEditInPopupMenu ) { JMenuItem editItem = getMenuEdit ( ) ; if ( editItem != null ) { ret . add ( editItem ) ; } } if ( showRandomizeInPopupMenu ) { JMenuItem randomizeItem = getMenuRandomize ( ) ; if ( randomizeItem != null ) { ret . add ( randomizeItem ) ; } } if ( showNormalizeInPopupMenu ) { JMenuItem normalizeItem = getMenuNormalize ( ) ; if ( normalizeItem != null ) { ret . add ( normalizeItem ) ; } } if ( showFillInPopupMenu ) { JMenuItem fillItem = getMenuFill ( ) ; if ( fillItem != null ) { ret . add ( fillItem ) ; } } return ret ; }
build the context menu for the table .
