예제 #1
0
    def getButtonIdentifier(self):
        intFrame = SwingUtilities.getAncestorOfClass(JInternalFrame, self.widget.widget)
        if intFrame:
            return intFrame.getTitle()

        icon = SwingUtilities.getAncestorOfClass(JInternalFrame.JDesktopIcon, self.widget.widget)  # @UndefinedVariable
        if icon:
            return self.widget.widget.getLabel()
예제 #2
0
파일: util.py 프로젝트: gbtami/storytext
def hasComplexAncestors(widget):
    if any((SwingUtilities.getAncestorOfClass(widgetClass, widget) is not None
            for widgetClass in [ JTable, JScrollBar, JComboBox, JSpinner ])):
        return True
    
    # If we're in a popup menu that's attached to something with complex ancestors, that's clearly even more complex :)
    popup = SwingUtilities.getAncestorOfClass(JPopupMenu, widget)
    if popup and isinstance(popup.getInvoker(), JComboBox):
        return True
    return popup is not None and hasComplexAncestors(popup.getInvoker())
예제 #3
0
 def getContextName(self):
     if SwingUtilities.getAncestorOfClass(JInternalFrame, self.widget):
         return "Internal Frame"
     elif SwingUtilities.getAncestorOfClass(JInternalFrame.JDesktopIcon, self.widget):  # @UndefinedVariable
         return "Internal Frame Icon"