コード例 #1
0
ファイル: SQLQueryJob.java プロジェクト: ralic/dbeaver
 private boolean fillStatementParameters(final List<SQLQueryParameter> parameters) {
   final RunnableWithResult<Boolean> binder =
       new RunnableWithResult<Boolean>() {
         @Override
         public void run() {
           SQLQueryParameterBindDialog dialog =
               new SQLQueryParameterBindDialog(partSite, getExecutionContext(), parameters);
           result = (dialog.open() == IDialogConstants.OK_ID);
         }
       };
   UIUtils.runInUI(partSite.getShell(), binder);
   Boolean result = binder.getResult();
   return result != null && result;
 }
コード例 #2
0
ファイル: UIUtils.java プロジェクト: ralic/dbeaver
 public static boolean confirmAction(
     final Shell shell, final String title, final String question) {
   RunnableWithResult<Boolean> confirmer =
       new RunnableWithResult<Boolean>() {
         @Override
         public void run() {
           MessageBox messageBox = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO);
           messageBox.setMessage(question);
           messageBox.setText(title);
           int response = messageBox.open();
           result = (response == SWT.YES);
         }
       };
   runInUI(shell, confirmer);
   return confirmer.getResult();
 }
コード例 #3
0
ファイル: DBeaverUI.java プロジェクト: ralic/dbeaver
 @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;
   }
 }