def shouldCheckWidget(self, widget, eventType): if not util.isVisible(widget): return False for cls, types in self.widgetEventTypes: if util.checkInstance(widget, cls) and eventType in types and not isinstance(widget.getParent(), swt.widgets.DateTime): return True return False
def makeAdapters(self, widgets): adapters = [] for widget in widgets + self.getPopupMenus(widgets): for widgetClass in self.swtbotMap.keys(): if util.checkInstance(widget, widgetClass): swtbotClass = self.findSwtbotClass(widget, widgetClass) try: adapters.append(WidgetAdapter.adapt(swtbotClass(widget))) break except RuntimeException: # Sometimes widgets are already disposed pass return adapters
def checkInstance(self, *args): return util.checkInstance(*args)
def layoutSortsChildren(self, widget): layout = widget.getLayout() return layout is not None and (util.checkInstance(layout, swt.layout.GridLayout) or \ util.checkInstance(layout, swt.layout.FillLayout) or \ util.checkInstance(layout, swt.layout.RowLayout) or \ util.checkInstance(layout, swt.custom.StackLayout))