コード例 #1
0
 public boolean connect() {
   try {
     ConnectJob connectJob = new ConnectJob();
     WizardUtils.runInWizard(
         connectJob, new DelegatingProgressMonitor(), getContainer(), getDatabindingContext());
     boolean connected = JobUtils.isOk(connectJob.getConnectionStatus());
     if (connected) {
       boolean result = pageModel.saveConnection();
       if (result) {
         SecureStoreException e = pageModel.getRecentSecureStoreException();
         if (e != null && e.getCause() instanceof StorageException) {
           result = false;
           Display.getDefault()
               .asyncExec(
                   new Runnable() {
                     @Override
                     public void run() {
                       String message =
                           "Connection is successful, but access to secure storage is denied.\n"
                               + "Please change save password/token settings and try again.\n"
                               + "Be aware, that if you select 'Cancel' at this point, you will "
                               + "be prompted for secure storage at each request for resources.";
                       MessageDialog.openWarning(
                           getWizard().getContainer().getShell(), "Warning", message);
                     }
                   });
         }
       }
       return result;
     } else {
       return false;
     }
   } catch (InterruptedException e) {
     OpenShiftCommonUIActivator.log(
         NLS.bind("Failed to authenticate user on server at {1}", pageModel.getHost()), e);
     return false;
   } catch (InvocationTargetException e) {
     OpenShiftCommonUIActivator.log(
         NLS.bind("Failed to authenticate user on server at {1}", pageModel.getHost()), e);
     return false;
   }
 }
コード例 #2
0
 public static void log(String message, Throwable t) {
   log(StatusFactory.errorStatus(PLUGIN_ID, message, t));
 }
コード例 #3
0
 public static void log(Throwable t) {
   log(null, t);
 }