def getToolTipText(self, item, jfaceTooltip): if hasattr(item, "getToolTipText") and item.getToolTipText(): return item.getToolTipText() elif jfaceTooltip and not self.isCustomTooltip(jfaceTooltip): event = self.makeToolTipEvent(item) if util.callPrivateMethod(jfaceTooltip, "shouldCreateToolTip", [ event ]): return util.callPrivateMethod(jfaceTooltip, "getText", [ event ])
def getCustomTooltipDescription(self, tooltip, widget): event = self.makeToolTipEvent(widget) if util.callPrivateMethod(tooltip, "shouldCreateToolTip", [ event ]): shell = Shell() result = util.callPrivateMethod(tooltip, "createToolTipContentArea", [ event, shell ], [ Event, Composite ]) desc = self.getDescription(result) result.dispose() shell.dispose() return desc else: return ""
def decorationVisible(self, deco): if hasattr(deco, "isVisible"): # added in 3.6 return deco.isVisible() else: # Workaround for reflection bug in Jython 2.5.1 # args = (None,) if sys.version_info[:3] <= (2, 5, 1) else () # Jython 2.5.2 doesn't work anyway so we don't include this fix for now return util.callPrivateMethod(deco, "shouldShowDecoration")
def getCheckBoxCoordinates(self, row, col, painter, bounds): cell = self.widget.getCellByPosition(col, row) configRegistry = self.widget.getConfigRegistry() image = util.callPrivateMethod(painter, "getImage", [ cell, configRegistry ], [ ILayerCell, IConfigRegistry ]) imageBounds = image.getBounds() imageWidth = util.getInt(imageBounds.width) imageHeight = util.getInt(imageBounds.height) cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry) x = bounds.x + CellStyleUtil.getHorizontalAlignmentPadding(cellStyle, bounds, imageWidth) + imageWidth / 2 y = bounds.y + CellStyleUtil.getVerticalAlignmentPadding(cellStyle, bounds, imageHeight) + imageHeight / 2 return x, y
def getTooltipText(self, tooltip, cell): event = self.makeToolTipEvent(cell) if util.callPrivateMethod(tooltip, "shouldCreateToolTip", [ event ]): return util.callPrivateMethod(tooltip, "getText", [ event ])
def decorationVisible(self, deco): if hasattr(deco, "isVisible"): # added in 3.6 return deco.isVisible() else: return util.callPrivateMethod(deco, "shouldShowDecoration")