Class AbstractAuthorizationUI

    • Constructor Detail

      • AbstractAuthorizationUI

        protected AbstractAuthorizationUI()
        Constructs a new AbstractAuthorizationUI without API URL.
        Since:
        10189
      • AbstractAuthorizationUI

        protected AbstractAuthorizationUI​(String apiUrl)
        Constructs a new AbstractAuthorizationUI for the given API URL.
        Parameters:
        apiUrl - The OSM API URL
        Since:
        5422
    • Method Detail

      • getApiUrl

        public String getApiUrl()
        Replies the URL of the OSM API for which this UI is currently trying to retrieve an OAuth Access Token
        Returns:
        the API URL
      • setApiUrl

        public void setApiUrl​(String apiUrl)
        Sets the URL of the OSM API for which this UI is currently trying to retrieve an OAuth Access Token
        Parameters:
        apiUrl - the api URL
      • getOAuthParameters

        public OAuthParameters getOAuthParameters()
        Replies the current set of advanced OAuth parameters in this UI
        Returns:
        the current set of advanced OAuth parameters in this UI
      • getAccessToken

        public OAuthToken getAccessToken()
        Replies the retrieved Access Token. null, if no Access Token was retrieved.
        Returns:
        the retrieved Access Token
      • setAccessToken

        protected void setAccessToken​(OAuthToken accessToken)
        Sets the current Access Token. This will fire a property change event for ACCESS_TOKEN_PROP if the access token has changed
        Parameters:
        accessToken - the new access token. null, to clear the current access token
      • hasAccessToken

        public boolean hasAccessToken()
        Replies true if this UI currently has an Access Token
        Returns:
        true if this UI currently has an Access Token
      • isSaveAccessTokenToPreferences

        public abstract boolean isSaveAccessTokenToPreferences()
        Replies whether the user has chosen to save the Access Token in the JOSM preferences or not.
        Returns:
        true if the user has chosen to save the Access Token
      • initialize

        public void initialize​(String paramApiUrl)
        Initializes the authorisation UI.
        Parameters:
        paramApiUrl - the API URL. Must not be null.
        Throws:
        IllegalArgumentException - if paramApiUrl is null