def _buildLinkMenu(self, gravity): parentId = self.addMenu(_extstr(u"blogcontenteditorlinkmenumodel.Link"), gravity) #$NON-NLS-1$ url = None linkMenuBuilder = ZLinkMenuModelBuilder() if self.zXHTMLEditControlLinkContext: url = linkMenuBuilder.getLinkLocation(self.zXHTMLEditControlLinkContext) linkMenuBuilder.buildLinkMenu(self, parentId, url)
def buildCopyUrlLocationMenuItems(self, linkContext, imageContext, gravity, parentId, addSeparater): linkMenuBuilder = ZLinkMenuModelBuilder() imageMenuBuilder = ZImageMenuModelBuilder() linkLocation = linkMenuBuilder.getLinkLocation(linkContext) imageLocation = imageMenuBuilder.getImageLocation(imageContext) if not linkLocation and not imageLocation: return if addSeparater: self.addSeparator(gravity) gravity = gravity + 1 if linkLocation: linkMenuBuilder.buildCopyLinkLocationMenuItem(self, gravity, parentId) if imageLocation: imageMenuBuilder.buildCopyImageLocationMenuItem(self, gravity, parentId)
def _buildRemoveElemMenuItem(self, gravity): if self.zXHTMLEditControlLinkContext: linkMenuBuilder = ZLinkMenuModelBuilder() linkLocation = linkMenuBuilder.getLinkLocation(self.zXHTMLEditControlLinkContext) if linkLocation: linkMenuBuilder.buildRemoveLinkMenuItem(self, gravity, None)