'Render subform row actions into the row
@param subform: the subform row
@param formname: the form name
@param index: the row index
@param item: the row data
@param readonly: this is a read-row
@param editable: this row is editable
@param deletable: this row is deletable'

@staticmethod
def actions(subform, formname, index, item=None, readonly=True, editable=True, deletable=True):

    T = current.T
    action_id = ('%s-%s' % (formname, index))
    def action(title, name, throbber=False):
        btn = DIV(_id=('%s-%s' % (name, action_id)), _class=('inline-%s' % name))
        if throbber:
            return DIV(btn, DIV(_class='inline-throbber    hide', _id=('throbber-%s' % action_id)))
        else:
            return DIV(btn)
    _class = 'subform-action'
    append = subform.append
    if readonly:
        if editable:
            append(TD(action(T('Edit    this    entry'), 'edt'), _class=_class))
        else:
            append(TD(_class=_class))
        if deletable:
            append(TD(action(T('Remove    this    entry'), 'rmv'), _class=_class))
        else:
            append(TD(_class=_class))
    elif ((index != 'none') or item):
        append(TD(action(T('Update    this    entry'), 'rdy', throbber=True), _class=_class))
        append(TD(action(T('Cancel    editing'), 'cnc'), _class=_class))
    else:
        append(TD(action(T('Discard    this    entry'), 'dsc'), _class=_class))
        append(TD(action(T('Add    this    entry'), 'add', throbber=True), _class=_class))
