Class AbstractFlowEditorGitMenuItem

  • All Implemented Interfaces:
    adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, Serializable, Comparable<adams.gui.flow.menu.AbstractFlowEditorMenuItem>
    Direct Known Subclasses:
    Add, Commit, Log, Pull, Push, ResetSession, Rollback

    public abstract class AbstractFlowEditorGitMenuItem
    extends adams.gui.flow.menu.AbstractFlowEditorMenuItem
    Ancestor for menuitems in the git sub-menu.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.eclipse.jgit.api.Git m_Git
      the current git instance to use.
      • Fields inherited from class adams.gui.flow.menu.AbstractFlowEditorMenuItem

        m_Action, m_MenuItem, m_Owner, m_SubMenu
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String getMenu()
      Returns the name of the menu to list this item under.
      protected void initialize()
      Initializes the menu item.
      protected boolean isRemoteRepo()
      Checks whether the repository has a remote URL.
      protected <T extends org.eclipse.jgit.api.TransportCommand>
      T
      setTransportConfigCallbackIfNecessary​(T cmd)
      Adds the transport config callback (with sshd factory) if necessary.
      void update​(org.eclipse.jgit.api.Git git)
      Updating the action/menuitem/submenu, based on the current status of the owner.
      • Methods inherited from class adams.gui.flow.menu.AbstractFlowEditorMenuItem

        compareTo, determineCaption, equals, getAction, getMenuItem, getMenuItems, getOwner, getSubMenu, hasAction, hasMenuItem, hasSubMenu, newAction, newMenuItem, newSubMenu, setOwner, update
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
    • Field Detail

      • m_Git

        protected org.eclipse.jgit.api.Git m_Git
        the current git instance to use.
    • Constructor Detail

      • AbstractFlowEditorGitMenuItem

        public AbstractFlowEditorGitMenuItem()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the menu item.
        Overrides:
        initialize in class adams.gui.flow.menu.AbstractFlowEditorMenuItem
      • getMenu

        public String getMenu()
        Returns the name of the menu to list this item under.
        Specified by:
        getMenu in class adams.gui.flow.menu.AbstractFlowEditorMenuItem
        Returns:
        sub-menu, so always null
      • update

        public void update​(org.eclipse.jgit.api.Git git)
        Updating the action/menuitem/submenu, based on the current status of the owner.
        Parameters:
        git - the git instance
      • setTransportConfigCallbackIfNecessary

        protected <T extends org.eclipse.jgit.api.TransportCommand> T setTransportConfigCallbackIfNecessary​(T cmd)
        Adds the transport config callback (with sshd factory) if necessary. If the remote url starts with "git@", then we assume that ssh keys are used.
        Parameters:
        cmd - the command to update
        Returns:
        the updated command
      • isRemoteRepo

        protected boolean isRemoteRepo()
        Checks whether the repository has a remote URL.
        Returns:
        true if remote URL available