コード例 #1
0
    @Override
    protected void uploadKey(final File sskKey) {
      FeatureUsageTracker.getInstance()
          .triggerFeatureUsed(CloudFeaturesProvider.UPLOAD_SSH_KEY_FEATURE_ID);
      try {
        myServerConfigurable.apply();
      } catch (ConfigurationException e) {
        Messages.showErrorDialog("Cannot upload SSH key: " + e.getMessage(), e.getTitle());
        return;
      }

      RemoteServer<C> server =
          new RemoteServerImpl<C>(
              "<temp server to upload ssh key>", myServerType, myServerConfiguration);

      CloudConnectionTask task =
          new CloudConnectionTask(null, "Uploading SSH key", server) {

            @Override
            protected Object run(CloudServerRuntimeInstance serverRuntime)
                throws ServerRuntimeException {
              ((SshKeyAwareServerRuntime) serverRuntime).addSshKey(sskKey);
              return null;
            }
          };
      task.performSync();
      task.showMessageDialog(myLabel, "SSH key was uploaded", "Public SSH Key");
    }
コード例 #2
0
 private boolean commitStepData(final ModuleWizardStep step) {
   try {
     if (!step.validate()) {
       return false;
     }
   } catch (ConfigurationException e) {
     Messages.showErrorDialog(myCurrentProject, e.getMessage(), e.getTitle());
     return false;
   }
   step.updateDataModel();
   return true;
 }