예제 #1
0
 /** Initializes the dialog with values from the preferences */
 public void initFromPreferences() {
   // Copy current JOSM preferences to update API url with the one used in this wizard
   Preferences copyPref = CustomConfigurator.clonePreferences(Main.pref);
   copyPref.put("osm-server-url", apiUrl);
   pnlFullyAutomaticAuthorisationUI.initFromPreferences(copyPref);
   pnlSemiAutomaticAuthorisationUI.initFromPreferences(copyPref);
   pnlManualAuthorisationUI.initFromPreferences(copyPref);
 }
예제 #2
0
  /**
   * Builds the row with the action buttons
   *
   * @return panel with buttons
   */
  protected JPanel buildButtonRow() {
    JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));

    AcceptAccessTokenAction actAcceptAccessToken = new AcceptAccessTokenAction();
    pnlFullyAutomaticAuthorisationUI.addPropertyChangeListener(actAcceptAccessToken);
    pnlSemiAutomaticAuthorisationUI.addPropertyChangeListener(actAcceptAccessToken);
    pnlManualAuthorisationUI.addPropertyChangeListener(actAcceptAccessToken);

    pnl.add(new SideButton(actAcceptAccessToken));
    pnl.add(new SideButton(new CancelAction()));
    pnl.add(
        new SideButton(
            new ContextSensitiveHelpAction(HelpUtil.ht("/Dialog/OAuthAuthorisationWizard"))));

    return pnl;
  }
예제 #3
0
 /**
  * Refreshes the view of the authorisation panel, depending on the authorisation procedure
  * currently selected
  */
 protected void refreshAuthorisationProcedurePanel() {
   AuthorizationProcedure procedure =
       (AuthorizationProcedure) cbAuthorisationProcedure.getSelectedItem();
   switch (procedure) {
     case FULLY_AUTOMATIC:
       spAuthorisationProcedureUI.getViewport().setView(pnlFullyAutomaticAuthorisationUI);
       pnlFullyAutomaticAuthorisationUI.revalidate();
       break;
     case SEMI_AUTOMATIC:
       spAuthorisationProcedureUI.getViewport().setView(pnlSemiAutomaticAuthorisationUI);
       pnlSemiAutomaticAuthorisationUI.revalidate();
       break;
     case MANUALLY:
       spAuthorisationProcedureUI.getViewport().setView(pnlManualAuthorisationUI);
       pnlManualAuthorisationUI.revalidate();
       break;
   }
   validate();
   repaint();
 }