return menuHelp;
}
public void handleMenuEvent(XJMenu menu, XJMenuItem item) {
//XJDocument document = XJApplication.shared().getActiveDocument();
XJWindow activeWindow = XJApplication.shared().getActiveWindow();
switch(item.tag) {
case MI_NEW:
XJApplication.shared().newDocument();
break;
case MI_OPEN:
XJApplication.shared().openDocument();
break;
case MI_SAVE:
if(activeWindow != null) {
for(XJDocument doc : activeWindow.getDocuments()) {
if(doc.save(false)) {
doc.changeReset();
}
}
}
break;
case MI_SAVEAS:
if(activeWindow != null) {
for(XJDocument doc : activeWindow.getDocuments()) {
if(doc.save(true)) {
doc.changeReset();
}
}
}
break;
case MI_CLEAR_RECENT_FILES:
XJApplication.shared().clearRecentFiles();
break;
case MI_QUIT:
XJApplication.shared().performQuit();
break;
case MI_PREFS:
XJApplication.shared().displayPrefs();
break;
case MI_ABOUT:
XJApplication.shared().displayAbout();
break;
case MI_HELP:
XJApplication.shared().displayHelp();
break;
case MI_GC:
System.gc();
break;
default:
if(item.tag>=MI_WINDOW) {
XJWindow window = XJApplication.shared().getWindowsInWindowMenu().get(item.tag-MI_WINDOW);
window.bringToFront();
item.setSelected(true);
} else if(item.tag>=MI_RECENT_FILES && item.tag<=MI_RECENT_FILES+XJApplication.MAX_RECENT_FILES) {
if(!XJApplication.shared().openDocument(item.getTitle())) {
XJApplication.shared().removeRecentFile(item.getTitle());
}