Merge branch 'master' of github.com:antlr/antlr4
This commit is contained in:
commit
7e6af55245
|
@ -30,9 +30,6 @@
|
|||
|
||||
package org.antlr.v4.runtime.misc;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
|
@ -151,38 +148,6 @@ public class Utils {
|
|||
return data;
|
||||
}
|
||||
|
||||
public static void waitForClose(final Window window) throws InterruptedException {
|
||||
final Object lock = new Object();
|
||||
|
||||
Thread t = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
synchronized (lock) {
|
||||
while (window.isVisible()) {
|
||||
try {
|
||||
lock.wait(500);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
t.start();
|
||||
|
||||
window.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosing(WindowEvent arg0) {
|
||||
synchronized (lock) {
|
||||
window.setVisible(false);
|
||||
lock.notify();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
t.join();
|
||||
}
|
||||
|
||||
/** Convert array of strings to string→index map. Useful for
|
||||
* converting rulenames to name→ruleindex map.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue