- Timestamp:
- 08/17/12 11:38:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/quest-ui-swt/src/main/java/de/ugoe/cs/quest/ui/swt/AboutDialog.java
r526 r570 1 1 2 package de.ugoe.cs.quest.ui.swt; 2 3 … … 14 15 public class AboutDialog extends Dialog { 15 16 16 17 17 protected Shell shlAboutEventbenchconsole; 18 private final FormToolkit formToolkit = new FormToolkit(Display.getDefault()); 18 19 19 /** 20 * Create the dialog. 21 * @param parent 22 * @param style 23 */ 24 public AboutDialog(Shell parent, int style) { 25 super(parent, style); 26 setText("SWT Dialog"); 27 } 20 /** 21 * Create the dialog. 22 * 23 * @param parent 24 * @param style 25 */ 26 public AboutDialog(Shell parent, int style) { 27 super(parent, style); 28 setText("SWT Dialog"); 29 } 28 30 29 30 31 32 33 34 35 36 37 38 39 40 41 42 31 /** 32 * Open the dialog. 33 */ 34 public void open() { 35 createContents(); 36 shlAboutEventbenchconsole.open(); 37 shlAboutEventbenchconsole.layout(); 38 Display display = getParent().getDisplay(); 39 while (!shlAboutEventbenchconsole.isDisposed()) { 40 if (!display.readAndDispatch()) { 41 display.sleep(); 42 } 43 } 44 } 43 45 44 /** 45 * Create contents of the dialog. 46 */ 47 private void createContents() { 48 shlAboutEventbenchconsole = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); 49 shlAboutEventbenchconsole.setSize(283, 113); 50 shlAboutEventbenchconsole.setText("About EventBenchConsole"); 51 52 Label lblEventbenchconsole = new Label(shlAboutEventbenchconsole, SWT.CENTER); 53 lblEventbenchconsole.setBounds(10, 10, 267, 15); 54 lblEventbenchconsole.setText("EventBenchConsole"); 55 56 Label lblFurtherInformationAbout = new Label(shlAboutEventbenchconsole, SWT.WRAP); 57 lblFurtherInformationAbout.setBounds(10, 31, 267, 31); 58 lblFurtherInformationAbout.setText("Further information about this software is provided on our homepage."); 59 60 final Hyperlink hprlnkHttpeventbenchinformatikunigoettingende = formToolkit.createHyperlink(shlAboutEventbenchconsole, "http://eventbench.informatik.uni-goettingen.de", SWT.NONE); 61 hprlnkHttpeventbenchinformatikunigoettingende.addMouseListener(new MouseAdapter() { 62 @Override 63 public void mouseDown(MouseEvent e) { 64 Program.launch(hprlnkHttpeventbenchinformatikunigoettingende.getText()); 65 } 66 }); 67 hprlnkHttpeventbenchinformatikunigoettingende.setBounds(10, 68, 267, 17); 68 formToolkit.paintBordersFor(hprlnkHttpeventbenchinformatikunigoettingende); 69 hprlnkHttpeventbenchinformatikunigoettingende.setBackground(null); 46 /** 47 * Create contents of the dialog. 48 */ 49 private void createContents() { 50 shlAboutEventbenchconsole = new Shell(getParent(), SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); 51 shlAboutEventbenchconsole.setSize(283, 113); 52 shlAboutEventbenchconsole.setText("About EventBenchConsole"); 70 53 71 } 54 Label lblEventbenchconsole = new Label(shlAboutEventbenchconsole, SWT.CENTER); 55 lblEventbenchconsole.setBounds(10, 10, 267, 15); 56 lblEventbenchconsole.setText("EventBenchConsole"); 57 58 Label lblFurtherInformationAbout = new Label(shlAboutEventbenchconsole, SWT.WRAP); 59 lblFurtherInformationAbout.setBounds(10, 31, 267, 31); 60 lblFurtherInformationAbout 61 .setText("Further information about this software is provided on our homepage."); 62 63 final Hyperlink hprlnkHttpeventbenchinformatikunigoettingende = 64 formToolkit.createHyperlink(shlAboutEventbenchconsole, 65 "http://eventbench.informatik.uni-goettingen.de", SWT.NONE); 66 hprlnkHttpeventbenchinformatikunigoettingende.addMouseListener(new MouseAdapter() { 67 @Override 68 public void mouseDown(MouseEvent e) { 69 Program.launch(hprlnkHttpeventbenchinformatikunigoettingende.getText()); 70 } 71 }); 72 hprlnkHttpeventbenchinformatikunigoettingende.setBounds(10, 68, 267, 17); 73 formToolkit.paintBordersFor(hprlnkHttpeventbenchinformatikunigoettingende); 74 hprlnkHttpeventbenchinformatikunigoettingende.setBackground(null); 75 76 } 72 77 }
Note: See TracChangeset
for help on using the changeset viewer.