Java by API/org.eclipse.jface.dialogs/MessageDialog — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 17:43, 31 мая 2010
Содержание
- 1 MessageDialog: openConfirm(Shell arg0, String title, String message)
- 2 MessageDialog: openError(Shell arg0, String title, String message)
- 3 MessageDialog: openInformation(Shell arg0, String title, String message)
- 4 MessageDialog.openQuestion(Shell arg0, String title, String message)
- 5 MessageDialog.openWarning(Shell arg0, String title, String message)
MessageDialog: openConfirm(Shell arg0, String title, String message)
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass extends ApplicationWindow {
public MainClass() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Send Message");
shell.setSize(500, 400);
boolean b = MessageDialog.openConfirm(shell, "Confirm", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openError(shell, "Error", "info");
System.out.println("Returned void");
MessageDialog.openInformation(shell, "Information", "info");
System.out.println("Returned void");
b = MessageDialog.openQuestion(shell, "Question", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openWarning(shell, "Warning", "info");
System.out.println("Returned void");
}
public static void main(String[] args) {
new MainClass().run();
}
}
MessageDialog: openError(Shell arg0, String title, String message)
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass extends ApplicationWindow {
public MainClass() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Send Message");
shell.setSize(500, 400);
boolean b = MessageDialog.openConfirm(shell, "Confirm", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openError(shell, "Error", "info");
System.out.println("Returned void");
MessageDialog.openInformation(shell, "Information", "info");
System.out.println("Returned void");
b = MessageDialog.openQuestion(shell, "Question", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openWarning(shell, "Warning", "info");
System.out.println("Returned void");
}
public static void main(String[] args) {
new MainClass().run();
}
}
MessageDialog: openInformation(Shell arg0, String title, String message)
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass extends ApplicationWindow {
public MainClass() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Send Message");
shell.setSize(500, 400);
boolean b = MessageDialog.openConfirm(shell, "Confirm", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openError(shell, "Error", "info");
System.out.println("Returned void");
MessageDialog.openInformation(shell, "Information", "info");
System.out.println("Returned void");
b = MessageDialog.openQuestion(shell, "Question", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openWarning(shell, "Warning", "info");
System.out.println("Returned void");
}
public static void main(String[] args) {
new MainClass().run();
}
}
MessageDialog.openQuestion(Shell arg0, String title, String message)
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass extends ApplicationWindow {
public MainClass() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Send Message");
shell.setSize(500, 400);
boolean b = MessageDialog.openConfirm(shell, "Confirm", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openError(shell, "Error", "info");
System.out.println("Returned void");
MessageDialog.openInformation(shell, "Information", "info");
System.out.println("Returned void");
b = MessageDialog.openQuestion(shell, "Question", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openWarning(shell, "Warning", "info");
System.out.println("Returned void");
}
public static void main(String[] args) {
new MainClass().run();
}
}
MessageDialog.openWarning(Shell arg0, String title, String message)
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class MainClass extends ApplicationWindow {
public MainClass() {
super(null);
}
public void run() {
setBlockOnOpen(true);
open();
Display.getCurrent().dispose();
}
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Send Message");
shell.setSize(500, 400);
boolean b = MessageDialog.openConfirm(shell, "Confirm", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openError(shell, "Error", "info");
System.out.println("Returned void");
MessageDialog.openInformation(shell, "Information", "info");
System.out.println("Returned void");
b = MessageDialog.openQuestion(shell, "Question", "info");
System.out.println("Returned " + Boolean.toString(b));
MessageDialog.openWarning(shell, "Warning", "info");
System.out.println("Returned void");
}
public static void main(String[] args) {
new MainClass().run();
}
}