| 1 3 package gnu.jemacs.swt; 4 5 import org.eclipse.swt.SWT; 6 import org.eclipse.swt.widgets.Dialog; 7 import org.eclipse.swt.widgets.Display; 8 import org.eclipse.swt.widgets.Shell; 9 10 14 public class CommandDialog extends Dialog 15 { 16 17 20 public CommandDialog(Shell parent) 21 { 22 super(parent); 23 } 24 25 29 public CommandDialog(Shell parent, int style) 30 { 31 super(parent, style); 32 } 33 34 public String getCommand() { 35 Shell parent = getParent(); 36 Shell shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); 37 shell.setText(getText()); 38 shell.open(); 40 Display display = parent.getDisplay(); 41 while (!shell.isDisposed()) { 42 if (!display.readAndDispatch()) display.sleep(); 43 } 44 return "hejsa"; 45 } 46 } 47 | Popular Tags |