def handleSelectedItems(self, variables):
        ka = variables.get('selected')

        # Converts the key-array to id-set
        s = list()
        for i in range(len(ka)):
            idd = self.itemIdMapper.get(ka[i])
            if (not self.isNullSelectionAllowed()
                    and (idd is None)
                    or (idd == self.getNullSelectionItemId())):
                # skip empty selection if null selection is not allowed
                self.requestRepaint()
            elif idd is not None and self.containsId(idd):
                s.append(idd)

        if not self.isNullSelectionAllowed() and len(s) < 1:
            # empty selection not allowed, keep old value
            self.requestRepaint()
            return

        self.setValue(s, True)
Handles the selection
dataset/ETHPy150Open rwl/muntjac/muntjac/ui/tree.py/Tree.handleSelectedItems