Esempio n. 1
0
 public static DBeaverUI getInstance() {
   if (instance == null) {
     instance = new DBeaverUI();
     instance.initialize();
   }
   return instance;
 }
Esempio n. 2
0
 @Override
 public DBAAuthInfo promptUserCredentials(String prompt, String userName, String userPassword) {
   // Ask user
   final Shell shell = DBeaverUI.getActiveWorkbenchShell();
   final BaseAuthDialog authDialog = new BaseAuthDialog(shell, prompt);
   authDialog.setUserName(userName);
   authDialog.setUserPassword(userPassword);
   final RunnableWithResult<Boolean> binder =
       new RunnableWithResult<Boolean>() {
         @Override
         public void run() {
           result = (authDialog.open() == IDialogConstants.OK_ID);
         }
       };
   UIUtils.runInUI(shell, binder);
   if (binder.getResult() != null && binder.getResult()) {
     return authDialog.getAuthInfo();
   } else {
     return null;
   }
 }
Esempio n. 3
0
 static void disposeUI() {
   if (instance != null) {
     instance.dispose();
   }
 }