def tableSetup(self):
        self.blockSelectEvent = 1
        self.blockViewModelObject = 0
        self.tag_has = defaultdict(list) # temporary until Tk 8.6
        # relationship set based on linkrole parameter, to determine applicable linkroles
        relationshipSet = self.modelXbrl.relationshipSet(self.arcrole, self.linkrole, self.linkqname, self.arcqname)
        if not relationshipSet:
            self.modelXbrl.modelManager.addToLog(_("no relationships for {0}").format(self.arcrole))
            return False
        
        factConcepts = set(fact.concept for fact in self.modelXbrl.factsInInstance).append(fact)
        
        definedLinkroles = []
        for linkrole in set(rel.linkrole 
                            for rel in relationshipSet.modelRelationships
                            if rel.fromModelObject in factConcepts or rel.toModelObject in factConcepts):
            modelRoleTypes = self.modelXbrl.roleTypes.get(linkrole)
            if modelRoleTypes:
                roledefinition = modelRoleTypes[0].definition
                if not roledefinition:
                    roledefinition = linkrole
            else:
                roledefinition = linkrole
            definedLinkroles.append((roledefinition,linkrole))
        definedLinkroles.sort()
        if not definedLinkroles:
            return False
        self.linkrole = definedLinkroles[0][1]
        self.linkroleSetup()
        return True
dataset/ETHPy150Open Arelle/Arelle/arelle/ViewWinFactGrid.py/ViewFactsGrid.tableSetup/original