def METHOD_NAME(self, position, link, cursor, methods = None):
    """Build the panel's context menu dynamically.
    Implements the template method pattern to allow
    subclasses to override each step.
    If methods passes a list of methods these will be
    called instead to construct the menu, making it
    possible to change order or add methods not
    available in the base class."""
    self._position = position
    self._link = link
    self._cursor = cursor
    self._menu.clear()
    if not methods:
        # Actions affecting the current link(selection)
        self.addCopyImageAction()
        self.addCursorLinkActions()
        # Actions affecting the currently opened documents
        self.addShowActions()
        self.addOpenCloseActions()
        self.addReloadAction()
        # Actions affecting the viewer's state
        self.addZoomActions()
        self.addSynchronizeAction()
        self.addShowToolbarAction()
        self.addExtensionMenu()
    else:
        for m in methods:
            m()
    # The help action is added always
    self.addHelpAction()
    # show it!
    if self._menu.actions():
        self._menu.exec_(position)
    # TODO: Can this really be removed?
    # it had to be commented out because in the documents submenu
    # there popped up issues with deleted objects (the menu was already
    # deleted when the signal was emitted)