reporter.report("menu item selected");
}
};
MenuBar main = new MenuBar();
main.setTitle("Main");
p.add(main);
MenuBar barA = new MenuBar();
barA.setTitle("A");
CloseHandler<PopupPanel> handler = new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
reporter.report("closed popup belonging to Main");
}
};
main.addCloseHandler(handler);
barA.addItem("a1", command);
barA.addItem("a2", command);
handler = new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
reporter.report("closed popup belonging to A");
}
};
barA.addCloseHandler(handler);
MenuBar barB = new MenuBar();
barB.setTitle("B");
barB.addItem("b1", command);
barB.addItem("b2", command);
handler = new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
reporter.report("closed popup belonging to B");
}
};
barB.addCloseHandler(handler);
MenuBar barC = new MenuBar();
barC.addItem("c1", command);
barC.addItem("c2", command);
handler = new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
reporter.report("closed popup belonging to c");
}
};
barC.addCloseHandler(handler);
barC.setTitle("C");
handler = new CloseHandler<PopupPanel>() {
public void onClose(CloseEvent<PopupPanel> event) {
reporter.report("closed popup belonging to B");