private MenuBarExt buildMenu() {
menu = new MenuBarExt(false);
MenuBarExt fileMenu = new MenuBarExt(true);
addMenuItem(fileMenu, Icons.editorIcons.Blank(), "New", new NewDocumentStartCommand());
fileMenu.addSeparator();
addMenuItem(fileMenu, Icons.editorIcons.Blank(), "Open", new SystemShowDialogCommand(DynamicFileListDialog.class));
addMenuItem(fileMenu, Icons.editorIcons.Save(), "Save", new CurrentDocumentSaveCommand(false));
addMenuItem(fileMenu, Icons.editorIcons.Blank(), "Save as new copy", new CurrentDocumentCopyCommand());
addMenuItem(fileMenu, Icons.editorIcons.Blank(), "Rename...", new CurrentDocumentRenameCommand());
addMenuItem(fileMenu, Icons.editorIcons.Blank(), "Delete...", new CurrentDocumentDeleteCommand());
addMenuItem(fileMenu, Icons.editorIcons.Blank(), "Revision History", new CurrentDocumentRevisionHistoryCommand());
fileMenu.addSeparator();
addMenuItem(fileMenu, Icons.editorIcons.UploadDocument(), "Upload Files...", new SystemUploadDocumentsCommand());
this.menu.addItem("File", fileMenu);
MenuBarExt viewMenu = new MenuBarExt(true);
addMenuItem(viewMenu, Icons.editorIcons.CheckBlack(), "Wrap Text", new SystemToggleWrapTextCommand());
viewMenu.addSeparator();
addMenuItem(viewMenu, Icons.editorIcons.Blank(), "Full-screen mode", new SystemToggleFullScreenCommand());
this.menu.addItem("View", viewMenu);
MenuBarExt exportMenu = new MenuBarExt(true);
addMenuItem(exportMenu, Icons.editorIcons.Blank(), "Portable Document Format (PDF)", new CurrentDocumentExportCommand("pdf"));
addMenuItem(exportMenu, Icons.editorIcons.Blank(), "PostScript Document (PS)", new CurrentDocumentExportCommand("ps"));
addMenuItem(exportMenu, Icons.editorIcons.Blank(), "Device Independent Format (DVI)", new CurrentDocumentExportCommand("dvi"));
this.menu.addItem("Export", exportMenu);
MenuBarExt compilerMenu = new MenuBarExt(true);
addMenuItem(compilerMenu, Icons.editorIcons.ItemList(), "Project Resources", new SystemShowDialogCommand(DynamicResourcesDialog.class));
compilerMenu.addSeparator();
addMenuItem(compilerMenu, Icons.editorIcons.Blank(), "Settings...", new SystemShowDialogCommand(DynamicCompilerSettingsDialog.class));
this.menu.addItem("Compiler", compilerMenu);
MenuBarExt helpMenu = new MenuBarExt(true);
addMenuItem(helpMenu, Icons.editorIcons.Blank(), "Using LaTeX Lab", new SystemNotImplementedCommand());
addMenuItem(helpMenu, Icons.editorIcons.Blank(), "Using a custom CLSI server", new SystemNotImplementedCommand());
helpMenu.addSeparator();
addMenuItem(helpMenu, Icons.editorIcons.Blank(), "About", new SystemShowDialogCommand(DynamicAboutDialog.class));
this.menu.addItem("Help", helpMenu);
return menu;
}