I notice that the ModifyListener will be triggered regardless the action is caused by user or system itself, for instance,
Text t = new Text(shell, SWT.BORDER);
t.addModifyListener(new TModifyListener());
...............................................
private class TModifyListener implements ModifyListener
{
@Override
public void modifyText(ModifyEvent event)
{
Text text = (Text) event.widget;
t.setText(process(text.getText()));
}
}
This will cause infinite loop and crash the program. Do you guys have any idea how to disable the event listening if the event is generated by system, and enable it if the event is caused by user?