def METHOD_NAME(self, selected=None):
    self.choices = self.getEntitiesFromContext()
    self.entityChoices.Clear()
    self.entityChoices.AppendItems([p.name for p in self.choices])
    if selected:
        idx = self.choices.index(selected)
        self.entityChoices.SetSelection(idx)
    else:
        self.entityChoices.SetSelection(0)