private void showMessageDialogWarning() { String title = "Warning"; String mesg = "You have been warned."; MessageDialog.openWarning(getShell(), title, mesg); messageDlgResLabel.setText("Result: none"); messageDlgResLabel.pack(); }
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(); }
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(); }
private void showMessageDialogInfo() { String title = "Information"; String mesg = "RAP rocks!"; MessageDialog.openInformation(getShell(), title, mesg); messageDlgResLabel.setText("Result: none"); messageDlgResLabel.pack(); }
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(); }
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()); } }