Class AbstractAuthorizationUI

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
Direct Known Subclasses:
FullyAutomaticAuthorizationUI, ManualAuthorizationUI

This is the abstract base class for the three authorisation UIs.
Since:
2746
See Also:
  • Field Details

  • Constructor Details

    • AbstractAuthorizationUI

      protected AbstractAuthorizationUI(String apiUrl, OAuthVersion oAuthVersion)
      Constructs a new AbstractAuthorizationUI for the given API URL.
      Parameters:
      apiUrl - The OSM API URL (may be null)
      oAuthVersion - The oauth version to use
      Since:
      18991
  • Method Details

    • fireAccessTokenChanged

      protected void fireAccessTokenChanged(IOAuthToken oldValue, IOAuthToken newValue)
    • 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
    • getAdvancedPropertiesPanel

      Replies the panel for entering advanced OAuth parameters (see OAuthParameters)
      Returns:
      the panel for entering advanced OAuth parameters
      See Also:
    • getOAuthParameters

      Replies the current set of advanced OAuth parameters in this UI
      Returns:
      the current set of advanced OAuth parameters in this UI
    • getAccessToken

      Replies the retrieved Access Token. null, if no Access Token was retrieved.
      Returns:
      the retrieved Access Token
    • setAccessToken

      protected void setAccessToken(IOAuthToken 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
    • getOAuthVersion

      Get the OAuth version for this AuthorizationUI
      Returns:
      The OAuth version
      Since:
      18991
    • 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