示例#1
0
 private void showMessageDialogWarning() {
   String title = "Warning";
   String mesg = "You have been warned.";
   MessageDialog.openWarning(getShell(), title, mesg);
   messageDlgResLabel.setText("Result: none");
   messageDlgResLabel.pack();
 }
示例#2
0
 private void showMessageDialogConfirm() {
   String title = "Confirmation";
   String mesg = "Nothing will be done. Ok?";
   boolean result = MessageDialog.openConfirm(getShell(), title, mesg);
   messageDlgResLabel.setText("Result: " + result);
   messageDlgResLabel.pack();
 }
示例#3
0
 private void showMessageDialogError() {
   String title = "Error";
   String mesg = "An everyday error occured.\n " + "Nothing to get worried.";
   MessageDialog.openError(getShell(), title, mesg);
   messageDlgResLabel.setText("Result: none");
   messageDlgResLabel.pack();
 }
示例#4
0
 private void showMessageDialogInfo() {
   String title = "Information";
   String mesg = "RAP rocks!";
   MessageDialog.openInformation(getShell(), title, mesg);
   messageDlgResLabel.setText("Result: none");
   messageDlgResLabel.pack();
 }
示例#5
0
 private void showMessageDialogQuestion() {
   String title = "Question";
   String mesg =
       "Do you like the RAP technology?\n\n"
           + "Note that you can also press <Return> here. "
           + "The correct answer is automatically selected.";
   boolean result = MessageDialog.openQuestion(getShell(), title, mesg);
   messageDlgResLabel.setText("Result: " + result);
   messageDlgResLabel.pack();
 }
示例#6
0
 private void showProgressDialog() {
   ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
   try {
     dialog.run(
         true,
         true,
         new IRunnableWithProgress() {
           public void run(final IProgressMonitor monitor)
               throws InvocationTargetException, InterruptedException {
             monitor.beginTask("Counting from one to 20...", 20);
             for (int i = 1; !monitor.isCanceled() && i <= 20; i++) {
               monitor.worked(1);
               Thread.sleep(1000);
             }
             monitor.done();
           }
         });
   } catch (Exception e) {
     MessageDialog.openError(getShell(), "Error", e.getMessage());
   }
 }