[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Keeping shell open?

The application is GMF based the user completes some actions that calls this which must return a value at the end:

public class ChangePropEditPolicy extends OpenEditPolicy{
	private String  inputtext; // text to be read in
	
	 @Override
	 protected Command getOpenCommand(Request request) {

        Command ret = null; // value to be returned at the end

SOME GMF STUFF...

final Shell s = new Shell(SWT.CLOSE|SWT.RESIZE|SWT.APPLICATION_MODAL);
s.setSize(500, 600);
s.setMinimumSize(500, 600);

final Text t1 = new Text(s,SWT.BORDER);
t1.setBounds(10, 10, 100, 20);
Button b1 = new Button(s, SWT.PUSH);
b1.setBounds(10, 50, 40, 40);
b1.addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
inputtext = t1.getText();
s.close();
}
});
s.open();



SOME MORE GMF STUFF THAT USES inputtext THAT THE USER INPUTS, BUT THE PROGRAM JUST KEEPS RUNNING BEFORE THE USER CAN INPUT IT SO IS ALWAYS EMPTY


return ret;
}}