void createMenuBar() {

		final Page page = editor.getPage();

		menuBar = new JMenuBar();

		// create the File Menu

		String s = getInternationalText("OpenRecentPages");
		JMenu recentFileMenu = new JMenu(s != null ? s : "Recent Opened Files");
		page.setRecentFilesMenu(recentFileMenu);
		JMenuItem mi = null;
		String[] recentFiles = ModelerUtilities.fileChooser.getRecentFiles();
		for (int i = 0; i < 4; i++) {
			mi = new JMenuItem(i < recentFiles.length ? recentFiles[i] : "");
			mi.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					String s = ((JMenuItem) e.getSource()).getText();
					if (s != null && !s.trim().equals(""))
						navigator.visitLocation(s);
				}
			});
			recentFileMenu.add(mi);
		}

		final JMenuItem reportMI = new JMenuItem(createReportAction);
		s = getInternationalText("CreateJNLP");
		final JMenuItem jnlpMI = new JMenuItem((s != null ? s : "Create a Customized JNLP Launching File") + "...");
		s = getInternationalText("CreateLaunchingUrlInSystemClipboard");
		final JMenuItem jnlpUrlMI = new JMenuItem(s != null ? s : "Copy and Paste the Launching URL");
		s = getInternationalText("CompressPage");
		final JMenuItem compressPageMI = new JMenuItem((s != null ? s : "Compress Current Page") + "...");
		s = getInternationalText("CompressFolder");
		final JMenuItem compressFolderMI = new JMenuItem((s != null ? s : "Compress Current Activity Folder") + "...");

		s = getInternationalText("File");
		JMenu menu = new JMenu(s != null ? s : "File");
		menu.addMenuListener(new MenuListener() {
			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}

			public void menuSelected(MenuEvent e) {
				boolean isRemote = page.isRemote();
				jnlpMI.setEnabled(isRemote);
				jnlpUrlMI.setEnabled(isRemote);
				compressPageMI.setEnabled(!isRemote);
				compressFolderMI.setEnabled(!isRemote);
				if (page.getAddress().equals("Untitled.cml")) {
					reportMI.setEnabled(false);
				}
				else {
					reportMI.setEnabled(!page.isEditable());
				}
			}
		});
		menu.setMnemonic(KeyEvent.VK_F);
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		JMenuItem menuItem = new JMenuItem(page.getAction(Page.NEW_PAGE));
		s = getInternationalText("NewBlankPage");
		if (s != null)
			menuItem.setText(s);
		menuItem.setMnemonic(KeyEvent.VK_N);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				editor.setEditable(true);
				autoSelectEncoding();
			}
		});
		menu.add(menuItem);

		s = getInternationalText("NewWindow");
		menuItem = new JMenuItem(s != null ? s : "New Window");
		menuItem.setMnemonic(KeyEvent.VK_W);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.META_MASK | KeyEvent.SHIFT_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				openNewWindow(true, false);
			}
		});
		menu.add(menuItem);
		menu.addSeparator();

		menuItem = new JMenuItem(page.getAction(Page.OPEN_PAGE));
		s = getInternationalText("OpenPage");
		menuItem.setText((s != null ? s : "Open") + "...");
		menuItem.setMnemonic(KeyEvent.VK_O);
		menu.add(menuItem);

		menu.add(recentFileMenu);
		recentFileMenu.setMnemonic(KeyEvent.VK_F);
		menu.addSeparator();

		menuItem = new JMenuItem(page.getAction(Page.SAVE_PAGE));
		s = getInternationalText("SavePage");
		if (s != null)
			menuItem.setText(s);
		menuItem.setMnemonic(KeyEvent.VK_S);
		menu.add(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.SAVE_PAGE_AS));
		s = getInternationalText("SavePageAs");
		menuItem.setText((s != null ? s : "Save As") + "...");
		menuItem.setMnemonic(KeyEvent.VK_A);
		menu.add(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.SAVE_PAGE_AS_APPLET));
		menuItem.setMnemonic(KeyEvent.VK_H);
		s = getInternationalText("SavePageAsApplet");
		menuItem.setText((s != null ? s : "Save As Applet") + "...");
		menuItem.setToolTipText("Save this page as an applet");
		menu.add(menuItem);

		compressPageMI.setToolTipText("Compress all the files of the current page in a ZIP file");
		compressPageMI.setMnemonic(KeyEvent.VK_G);
		compressPageMI.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.writePageToZipFile();
			}
		});
		menu.add(compressPageMI);

		compressFolderMI.setToolTipText("Compress all the files of the current activity folder in a ZIP file");
		compressFolderMI.setMnemonic(KeyEvent.VK_M);
		compressFolderMI.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (page.isRemote())
					return;
				JComboBox comboBox = new JComboBox();
				File dir = new File(FileUtilities.getCodeBase(page.getAddress()));
				if (!dir.isDirectory())
					return;
				String[] fn = dir.list(new FilenameFilter() {
					public boolean accept(File directory, String name) {
						return name.toLowerCase().endsWith(".cml");
					}
				});
				if (fn == null)
					return;
				for (String s : fn)
					comboBox.addItem(s);
				if (JOptionPane.showConfirmDialog(Modeler.this, comboBox, "Please select the first page:", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION) {
					new FolderCompressor(editor).compressCurrentFolder((String) comboBox.getSelectedItem());
				}
			}
		});
		menu.add(compressFolderMI);
		menu.addSeparator();

		jnlpUrlMI.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				StringSelection ss = new StringSelection(getContextRoot() + "tmp.jnlp?address=" + FileUtilities.httpEncode(page.getAddress()));
				Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);
				JOptionPane.showMessageDialog(Modeler.this, "An URL for opening the current MW page from outside MW\nis now available for pasting.");
			}
		});
		menu.add(jnlpUrlMI);
		jnlpMI.setMnemonic(KeyEvent.VK_J);
		jnlpMI.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				JNLPSaver.save(Modeler.this, page.getAddress(), page.getTitle(), true);
			}
		});
		menu.add(jnlpMI);

		s = getInternationalText("CreateReport");
		if (s != null)
			reportMI.setText(s);
		reportMI.setIcon(null);
		menu.add(reportMI);
		menu.addSeparator();

		menuItem = new JMenuItem(page.getAction("Page Setup"));
		s = getInternationalText("PageSetup");
		menuItem.setText((s != null ? s : "Page Setup") + "...");
		menuItem.setMnemonic(KeyEvent.VK_U);
		menu.add(menuItem);

		menuItem = new JMenuItem(page.getAction("Preview"));
		menuItem.setMnemonic(KeyEvent.VK_V);
		s = getInternationalText("PrintPreview");
		menuItem.setText((s != null ? s : "Print Preview") + "...");
		menu.add(menuItem);

		menuItem = new JMenuItem(page.getAction("Print"));
		menuItem.setMnemonic(KeyEvent.VK_P);
		s = getInternationalText("Print");
		menuItem.setText((s != null ? s : "Print") + "...");
		menu.add(menuItem);
		menu.addSeparator();

		s = getInternationalText("ToggleEditor");
		menuItem = new JMenuItem(s != null ? s : "Toggle Lock on Editor");
		menuItem.setMnemonic(KeyEvent.VK_L);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.META_MASK | KeyEvent.SHIFT_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK, true));
		menuItem.setRequestFocusEnabled(false);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				editor.editCheckBox.doClick();
			}
		});
		menu.add(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.SET_PROPERTIES));
		menuItem.setIcon(null);
		if (IS_MAC) {
			menuItem.setMnemonic(KeyEvent.VK_I);
			menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.META_MASK, true));
		}
		else {
			menuItem.setMnemonic(KeyEvent.VK_R);
		}
		s = getInternationalText("Properties");
		menuItem.setText((s != null ? s : "Properties") + "...");
		menu.add(menuItem);

		menuItem = new JMenuItem(editor.openSnapshotGallery);
		s = getInternationalText("ViewSnapshot");
		menuItem.setText((s != null ? s : "View Snapshots") + "...");
		menu.add(menuItem);

		s = getInternationalText("ViewSessionLog");
		menuItem = new JMenuItem((s != null ? s : "View Session Log") + "...");
		menuItem.setMnemonic(KeyEvent.VK_I);
		menuItem.setToolTipText("The log maintains the records of visits and problems since this launch.");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				LogDumper.sharedInstance().show(Modeler.this);
			}
		});
		menu.add(menuItem);
		menu.addSeparator();

		if (!IS_MAC) {
			menuItem = menu.add(page.getActionMap().get(Page.CLOSE_PAGE));
			s = getInternationalText("Exit");
			if (s != null)
				menuItem.setText(s);
			menuItem.setMnemonic(KeyEvent.VK_X);
			if (directMW)
				menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_MASK));
		}

		// create the Edit Menu

		final JMenuItem cutMI = new JMenuItem(page.getAction(DefaultEditorKit.cutAction));
		final JMenuItem copyMI = new JMenuItem(page.getAction(DefaultEditorKit.copyAction));

		s = getInternationalText("Edit");
		menu = new JMenu(s != null ? s : "Edit");
		menu.setMnemonic(KeyEvent.VK_E);
		menu.addMenuListener(new MenuListener() {
			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}

			public void menuSelected(MenuEvent e) {
				boolean b = page.getSelectedText() != null;
				copyMI.setEnabled(b);
				if (!page.isEditable())
					return;
				cutMI.setEnabled(b);
			}
		});
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		menuItem = new JMenuItem(page.getAction(Page.UNDO));
		menuItem.setMnemonic(KeyEvent.VK_U);
		s = getInternationalText("Undo");
		if (s != null)
			menuItem.setText(s);
		menu.add(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.REDO));
		menuItem.setMnemonic(KeyEvent.VK_R);
		s = getInternationalText("Redo");
		if (s != null)
			menuItem.setText(s);
		menu.add(menuItem);
		menu.addSeparator();

		s = getInternationalText("Cut");
		cutMI.setText(s != null ? s : "Cut");
		cutMI.setMnemonic(KeyEvent.VK_T);
		cutMI.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_MASK) : KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK));
		menu.add(cutMI);
		editor.addEnabledComponentWhenEditable(cutMI);

		s = getInternationalText("Copy");
		copyMI.setText(s != null ? s : "Copy");
		copyMI.setMnemonic(KeyEvent.VK_C);
		copyMI.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_MASK) : KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.CTRL_MASK));
		menu.add(copyMI);

		menuItem = new JMenuItem(page.getAction(DefaultEditorKit.pasteAction));
		s = getInternationalText("Paste");
		menuItem.setText(s != null ? s : "Paste");
		menuItem.setMnemonic(KeyEvent.VK_P);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_MASK) : KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction("Paste Plain Text"));
		s = getInternationalText("PastePlainText");
		menuItem.setText(s != null ? s : "Paste Plain Text");
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);
		menu.addSeparator();

		s = getInternationalText("Title");
		menuItem = new JMenuItem((s != null ? s : "Title") + "...");
		menuItem.setMnemonic(KeyEvent.VK_T);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.inputTitle();
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("BackgroundSound");
		menuItem = new JMenuItem((s != null ? s : "Background Sound") + "...");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.inputBackgroundSound();
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("AdditionalResourceFiles");
		menuItem = new JMenuItem((s != null ? s : "Additional Resource Files") + "...");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.inputAdditionalResourceFiles();
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);
		menu.addSeparator();

		final ButtonGroup encodingGroup = new ButtonGroup();
		final ActionListener encodingListener = new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				AbstractButton ab = (AbstractButton) e.getSource();
				if (ab.getName() != null)
					page.setCharacterEncoding(ab.getName());
			}
		};

		s = getInternationalText("CharacterEncoding");
		JMenu subMenu = new JMenu(s != null ? s : "Character Encoding");
		subMenu.setMnemonic(KeyEvent.VK_E);
		subMenu.addMenuListener(new MenuListener() {
			public void menuSelected(MenuEvent e) {
				JMenuItem mi;
				Enumeration en = encodingGroup.getElements();
				while (en.hasMoreElements()) {
					mi = (JMenuItem) en.nextElement();
					if (mi.getName().equals(page.getCharacterEncoding())) {
						mi.removeActionListener(encodingListener);
						mi.setSelected(true);
						mi.addActionListener(encodingListener);
						break;
					}
				}
			}

			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}
		});
		menu.add(subMenu);
		menu.addSeparator();

		menuItem = new JRadioButtonMenuItem("Arabic (ISO-8859-6)");
		menuItem.setName("ISO-8859-6");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Baltic (ISO-8859-4)");
		menuItem.setName("ISO-8859-4");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Central European (ISO-8859-2)");
		menuItem.setName("ISO-8859-2");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("SimplifiedChinese");
		menuItem = new JRadioButtonMenuItem((s != null ? s : "Chinese Simplified") + " (GB18030)");
		menuItem.setName("GB18030");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("TraditionalChinese");
		menuItem = new JRadioButtonMenuItem((s != null ? s : "Chinese Traditional") + " (Big5)");
		menuItem.setName("Big5");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Cyrillic (ISO-8859-5)");
		menuItem.setName("ISO-8859-5");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Greek (ISO-8859-7)");
		menuItem.setName("ISO-8859-7");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Hebrew (ISO-8859-8)");
		menuItem.setName("ISO-8859-8");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Japanese (EUC-JP)");
		menuItem.setName("EUC-JP");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Korean (EUC-KR)");
		menuItem.setName("EUC-KR");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Thai (ISO-8859-11)");
		menuItem.setName("ISO-8859-11");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Turkish (ISO-8859-9)");
		menuItem.setName("ISO-8859-9");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Western (ISO-8859-1)");
		menuItem.setName("ISO-8859-1");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JRadioButtonMenuItem("Unicode (UTF-8)");
		menuItem.setName("UTF-8");
		menuItem.addActionListener(encodingListener);
		subMenu.add(menuItem);
		encodingGroup.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(DefaultEditorKit.selectAllAction));
		menuItem.setMnemonic(KeyEvent.VK_A);
		s = getInternationalText("SelectAll");
		menuItem.setText(s != null ? s : "Select All");
		menu.add(menuItem);

		s = getInternationalText("Find");
		menuItem = new JMenuItem((s != null ? s : "Find on This Page") + "...");
		menuItem.setMnemonic(KeyEvent.VK_F);
		menuItem.addActionListener(editor.findAction);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.CTRL_MASK, true));
		menu.add(menuItem);

		// create the Insert Menu

		s = getInternationalText("Insert");
		menu = new JMenu(s != null ? s : "Insert");
		menu.setMnemonic(KeyEvent.VK_I);
		menu.addMenuListener(new MenuListener() {
			public void menuSelected(MenuEvent e) {
				if (!editor.isEditable())
					return;
				insertSymbolMenuItem.setEnabled(page.getCharacterEncoding().equals("UTF-8"));
			}

			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}
		});
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		// FIXME: insert file doesn't work right. editor.addEnabledComponentWhenEditable(menuItem);
		menuItem = new JMenuItem(page.getAction("File"));
		menuItem.setMnemonic(KeyEvent.VK_F);
		s = getInternationalText("InsertFile");
		if (s != null)
			menuItem.setText(s);
		menu.add(menuItem);
		menuItem.setEnabled(false);

		s = getInternationalText("InsertPicture");
		subMenu = new JMenu(s != null ? s : "Picture");
		subMenu.setMnemonic(KeyEvent.VK_P);
		menu.add(subMenu);
		menu.addSeparator();

		menuItem = new JMenuItem(page.getAction("Input Image"));
		s = getInternationalText("InputImage");
		if (s != null)
			menuItem.getAction().putValue("i18n", s);
		menuItem.setMnemonic(KeyEvent.VK_F);
		menuItem.setIcon(null);
		s = getInternationalText("InsertPictureFromFile");
		menuItem.setText((s != null ? s : "From File") + "...");
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);
		subMenu.addSeparator();

		s = getInternationalText("InsertPictureFromSnapshotGallery");
		menuItem = new JMenuItem((s != null ? s : "From Snapshot Gallery") + "...");
		menuItem.setMnemonic(KeyEvent.VK_S);
		menuItem.addActionListener(editor.openSnapshotGallery);
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("InsertModel");
		subMenu = new JMenu(s != null ? s : "Model Container");
		subMenu.setMnemonic(KeyEvent.VK_M);
		menu.add(subMenu);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_ATOM_CONTAINER));
		menuItem.setMnemonic(KeyEvent.VK_A);
		menuItem.setIcon(null);
		s = getInternationalText("InsertBasic2DContainer");
		menuItem.setText(s != null ? s : "Basic 2D Molecular Simulator");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_CHEM_CONTAINER));
		menuItem.setMnemonic(KeyEvent.VK_C);
		menuItem.setIcon(null);
		s = getInternationalText("InsertReaction2DContainer");
		menuItem.setText(s != null ? s : "2D Chemical Reaction Simulator");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_PROSYN_CONTAINER));
		menuItem.setMnemonic(KeyEvent.VK_P);
		menuItem.setIcon(null);
		s = getInternationalText("InsertProteinSynthesisContainer");
		menuItem.setText(s != null ? s : "2D Protein Synthesis Simulator");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_3, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_GB_CONTAINER));
		menuItem.setMnemonic(KeyEvent.VK_G);
		menuItem.setIcon(null);
		s = getInternationalText("InsertMesoscaleContainer");
		menuItem.setText(s != null ? s : "2D Mesoscale Particle Simulator");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_4, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		subMenu.addSeparator();
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName(Page.INSERT_JMOL);
		s = getInternationalText("InsertJmolContainer");
		menuItem.setText((s != null ? s : Page.INSERT_JMOL) + "...");
		menuItem.setMnemonic(KeyEvent.VK_V);
		menuItem.setIcon(null);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_5, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName(Page.INSERT_MW3D);
		s = getInternationalText("InsertBasic3DContainer");
		menuItem.setText((s != null ? s : Page.INSERT_MW3D) + "...");
		menuItem.setMnemonic(KeyEvent.VK_Y);
		menuItem.setIcon(null);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_6, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("InsertModelOutput");
		subMenu = new JMenu(s != null ? s : "Model Output");
		subMenu.setMnemonic(KeyEvent.VK_G);
		menu.add(subMenu);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Numeric Box");
		s = getInternationalText("InsertNumericBox");
		menuItem.setText((s != null ? s : "Numeric Box") + "...");
		menuItem.setMnemonic(KeyEvent.VK_N);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Bar Graph");
		s = getInternationalText("InsertBarGraph");
		menuItem.setText((s != null ? s : "Bar Graph") + "...");
		menuItem.setMnemonic(KeyEvent.VK_B);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_X);
		menuItem.setName("X-Y Graph");
		s = getInternationalText("InsertXYGraph");
		menuItem.setText((s != null ? s : "X-Y Graph") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_G);
		menuItem.setName("Gauge");
		s = getInternationalText("InsertGauge");
		menuItem.setText((s != null ? s : "Gauge") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_P);
		menuItem.setName("Pie Chart");
		s = getInternationalText("InsertPieChart");
		menuItem.setText((s != null ? s : "Pie Chart") + "...");
		menuItem.setEnabled(false);
		subMenu.add(menuItem);
		// editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("InsertInstrument");
		subMenu = new JMenu(s != null ? s : "Instrument");
		menu.add(subMenu);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_B);
		menuItem.setName("Diffraction Device");
		s = getInternationalText("InsertDiffractionDevice");
		menuItem.setText((s != null ? s : "Diffraction Device") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_B);
		menuItem.setName("Emission and Absorption Spectrometer");
		s = getInternationalText("InsertSpectrometer");
		menuItem.setText((s != null ? s : "Emission and Absorption Spectrometer") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("InsertStandardController");
		subMenu = new JMenu(s != null ? s : "Standard Controller for Model");
		subMenu.setMnemonic(KeyEvent.VK_C);
		menu.add(subMenu);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_B);
		menuItem.setName("Button");
		s = getInternationalText("InsertButton");
		menuItem.setText((s != null ? s : "Button") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_C);
		menuItem.setName("Check Box");
		s = getInternationalText("InsertCheckBox");
		menuItem.setText((s != null ? s : "Check Box") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_K, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_S);
		menuItem.setName("Spinner");
		s = getInternationalText("InsertSpinner");
		menuItem.setText((s != null ? s : "Spinner") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_L);
		menuItem.setName("Slider");
		s = getInternationalText("InsertSlider");
		menuItem.setText((s != null ? s : "Slider") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_M);
		menuItem.setName("Combo Box");
		s = getInternationalText("InsertComboBox");
		menuItem.setText((s != null ? s : "Combo Box") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("A Group of Radio Buttons");
		s = getInternationalText("InsertRadioButton");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_R);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Script Console");
		s = getInternationalText("InsertScriptConsole");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_S);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("InsertSpecialController");
		subMenu = new JMenu(s != null ? s : "Special Controller for Model");
		subMenu.setMnemonic(KeyEvent.VK_E);
		menu.add(subMenu);
		menu.addSeparator();

		s = getInternationalText("InsertChemicalReactionKinetics");
		JMenu subMenu2 = new JMenu(s != null ? s : "Chemical Reaction Kinetics");
		subMenu2.setMnemonic(KeyEvent.VK_C);
		subMenu.add(subMenu2);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_B);
		menuItem.setName("Bond-Breaking Barrier");
		s = getInternationalText("InsertBondBreakingBarrier");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		subMenu2.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_A);
		menuItem.setName("Activation Barrier");
		s = getInternationalText("InsertActivationBarrier");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		subMenu2.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		s = getInternationalText("InsertLightMatterInteraction");
		subMenu2 = new JMenu(s != null ? s : "Light-Matter Interactions");
		subMenu2.setMnemonic(KeyEvent.VK_L);
		subMenu.add(subMenu2);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setMnemonic(KeyEvent.VK_E);
		menuItem.setName("Electronic Structure");
		s = getInternationalText("InsertElectronicStructure");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		subMenu2.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction("Hyperlink"));
		menuItem.setMnemonic(KeyEvent.VK_K);
		menuItem.setIcon(null);
		s = getInternationalText("InsertHyperlink");
		menuItem.setText((s != null ? s : "Hyperlink") + "...");
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Activity Button");
		s = getInternationalText("InsertActivityButton");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Multiple Choice");
		s = getInternationalText("InsertMultipleChoice");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_U);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Image Question");
		s = getInternationalText("InsertImageQuestion");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_Q);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("User Input Text Field");
		s = getInternationalText("InsertTextField");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_F);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("User Input Text Area");
		s = getInternationalText("InsertTextArea");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_A);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Text Box");
		s = getInternationalText("InsertTextBox");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_B);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction("Color Bar"));
		s = getInternationalText("ColorBar");
		menuItem.setText((s != null ? s : "Color Bar") + "...");
		menuItem.setMnemonic(KeyEvent.VK_H);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Table");
		s = getInternationalText("InsertTable");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_L);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Applet");
		s = getInternationalText("Applet");
		menuItem.setText((s != null ? s + " (Applet)" : "Applet") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Plugin");
		s = getInternationalText("Plugin");
		menuItem.setText((s != null ? s : "Plugin") + "...");
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK, true));
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Audio Player");
		s = getInternationalText("InsertAudioPlayer");
		menuItem.setText((s != null ? s : "Audio Player") + "...");
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);
		menu.addSeparator();

		insertSymbolMenuItem = new JMenuItem(page.getAction("Symbol (Unicode Only)"));
		insertSymbolMenuItem.setIcon(null);
		s = getInternationalText("InsertSymbol");
		insertSymbolMenuItem.setText((s != null ? s : "Symbol (Unicode Only)") + "...");
		menu.add(insertSymbolMenuItem);
		editor.addEnabledComponentWhenEditable(insertSymbolMenuItem);

		s = getInternationalText("InsertMiscComponent");
		subMenu = new JMenu(s != null ? s : "Miscellaneous Components");
		subMenu.setMnemonic(KeyEvent.VK_T);
		menu.add(subMenu);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Periodic Table");
		s = getInternationalText("PeriodicTable");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_P);
		menuItem.setIcon(null);
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Function Graph");
		s = getInternationalText("FunctionGraph");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		menuItem.setMnemonic(KeyEvent.VK_F);
		menuItem.setIcon(null);
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);
		subMenu.addSeparator();

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Feedback Area");
		s = getInternationalText("InsertFeedbackArea");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction(Page.INSERT_COMPONENT));
		menuItem.setName("Database Search Text Field");
		s = getInternationalText("InsertDatabaseSearchField");
		menuItem.setText((s != null ? s : menuItem.getName()) + "...");
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		// create the View Menu

		s = getInternationalText("View");
		menu = new JMenu(s != null ? s : "View");
		menu.setMnemonic(KeyEvent.VK_V);
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		menuItem = menu.add(page.getActionMap().get("Full Screen"));
		s = getInternationalText("FullScreen");
		if (s != null)
			menuItem.setText(s);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("PageSource");
		menuItem = new JMenuItem((s != null ? s : "Page Source") + "...");
		menuItem.setMnemonic(KeyEvent.VK_O);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.ALT_MASK | KeyEvent.META_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ExternalClient.open(ExternalClient.HTML_CLIENT, page.getAddress(), page);
			}
		});
		menu.add(menuItem);
		menu.addSeparator();

		s = getInternationalText("Goto");
		subMenu = new JMenu(s != null ? s : "Go to");
		subMenu.setMnemonic(KeyEvent.VK_G);
		menu.add(subMenu);

		backMenuItem = new JMenuItem(page.getActionMap().get(Navigator.BACK));
		backMenuItem.setMnemonic(KeyEvent.VK_B);
		backMenuItem.setIcon(null);
		s = getInternationalText("Back");
		if (s != null)
			backMenuItem.setText(s);
		subMenu.add(backMenuItem);
		editor.addEnabledComponentWhenNotEditable(backMenuItem);

		forwardMenuItem = new JMenuItem(page.getActionMap().get(Navigator.FORWARD));
		forwardMenuItem.setMnemonic(KeyEvent.VK_F);
		forwardMenuItem.setIcon(null);
		s = getInternationalText("Forward");
		if (s != null)
			forwardMenuItem.setText(s);
		subMenu.add(forwardMenuItem);
		editor.addEnabledComponentWhenNotEditable(forwardMenuItem);
		subMenu.addSeparator();

		homeMenuItem = new JMenuItem(page.getActionMap().get(Navigator.HOME));
		homeMenuItem.setMnemonic(KeyEvent.VK_H);
		homeMenuItem.setIcon(null);
		s = getInternationalText("Home");
		if (s != null)
			homeMenuItem.setText(s);
		editor.addEnabledComponentWhenNotEditable(homeMenuItem);
		subMenu.add(homeMenuItem);

		reloadMenuItem = menu.add(page.getAction(Page.REFRESH));
		s = getInternationalText("Reload");
		if (s != null)
			reloadMenuItem.setText(s);
		reloadMenuItem.setIcon(null);
		menu.add(reloadMenuItem);
		editor.addEnabledComponentWhenNotEditable(reloadMenuItem);

		menu.addSeparator();

		s = getInternationalText("TextSize");
		subMenu = new JMenu(s != null ? s : "Text Size");
		subMenu.setMnemonic(KeyEvent.VK_T);
		menu.add(subMenu);

		s = getInternationalText("IncreaseFont");
		menuItem = new JMenuItem(s != null ? s : "Increase");
		menuItem.setMnemonic(KeyEvent.VK_I);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, KeyEvent.META_MASK | KeyEvent.ALT_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				FontSizeChanger.step(page, 1);
			}
		});
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("DecreaseFont");
		menuItem = new JMenuItem(s != null ? s : "Decrease");
		menuItem.setMnemonic(KeyEvent.VK_D);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, KeyEvent.META_MASK | KeyEvent.ALT_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_OPEN_BRACKET, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				FontSizeChanger.step(page, -1);
			}
		});
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);
		subMenu.addSeparator();

		s = getInternationalText("ActualSize");
		menuItem = new JMenuItem(s != null ? s : "Actual Size");
		menuItem.setMnemonic(KeyEvent.VK_A);
		menuItem.setAccelerator(IS_MAC ? KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, KeyEvent.META_MASK | KeyEvent.ALT_MASK, true) : KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				FontSizeChanger.step(page, -page.getFontIncrement());
			}
		});
		subMenu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		// create the Option Menu

		s = getInternationalText("Option");
		menu = new JMenu(s != null ? s : "Options");
		menu.setMnemonic(KeyEvent.VK_O);
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		menuItem = new JMenuItem(page.getAction("Font"));
		s = getInternationalText("Font");
		menuItem.setText((s != null ? s : "Font") + "...");
		menuItem.setIcon(null);
		menuItem.setMnemonic(KeyEvent.VK_F);
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction("Paragraph"));
		s = getInternationalText("Paragraph");
		menuItem.setText((s != null ? s : "Paragraph") + "...");
		menuItem.setIcon(null);
		menuItem.setMnemonic(KeyEvent.VK_P);
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);

		menuItem = new JMenuItem(page.getAction("Bullet"));
		s = getInternationalText("Bullet");
		menuItem.setText((s != null ? s : "Bullet") + "...");
		menuItem.setIcon(null);
		menuItem.setMnemonic(KeyEvent.VK_B);
		menu.add(menuItem);
		editor.addEnabledComponentWhenEditable(menuItem);
		menu.addSeparator();

		s = getInternationalText("Background");
		colorMenu = new ColorMenu(editor, s != null ? s : "Background", ModelerUtilities.colorChooser, ModelerUtilities.fillEffectChooser);
		colorMenu.addMenuListener(new MenuListener() {
			public void menuSelected(MenuEvent e) {
				colorMenu.setColor(page.getBackground());
			}

			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}
		});
		colorMenu.addNoFillListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.changeFillMode(FillMode.getNoFillMode());
			}
		});
		colorMenu.addColorArrayListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.changeFillMode(new FillMode.ColorFill(colorMenu.getColor()));
			}
		});
		colorMenu.addMoreColorListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Color c = colorMenu.getColorChooser().getColor();
				page.changeFillMode(new FillMode.ColorFill(c));
			}
		});
		colorMenu.addHexColorListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Color c = colorMenu.getHexInputColor(page.getFillMode() instanceof FillMode.ColorFill ? ((FillMode.ColorFill) page.getFillMode()).getColor() : null);
				if (c == null)
					return;
				page.changeFillMode(new FillMode.ColorFill(c));
			}
		});
		colorMenu.addFillEffectListeners(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.changeFillMode(colorMenu.getFillEffectChooser().getFillMode());
			}
		}, null);
		colorMenu.setMnemonic(KeyEvent.VK_G);
		menu.add(colorMenu);
		editor.addEnabledComponentWhenEditable(colorMenu);

		s = getInternationalText("Theme");
		subMenu = new JMenu(s != null ? s : "Apply Theme");
		subMenu.setMnemonic(KeyEvent.VK_T);
		menu.add(subMenu);

		ItemListener il = new ItemListener() {
			public void itemStateChanged(ItemEvent e) {
				if (e.getStateChange() == ItemEvent.SELECTED) {
					JOptionPane.showMessageDialog(Modeler.this, NAME + " has to restart for the selected\n" + "theme to display properly.\n\n" + "(If it does not restart automatically, please click\n" + "to restart it.)", "Theme change", JOptionPane.INFORMATION_MESSAGE);
					lookandfeel = ((AbstractButton) e.getSource()).getText();
					restart = true;
					if (launchedByJWS) {
						navigator.visitLocation(Initializer.sharedInstance().getResetJnlpAddress());
					}
					else {
						Modeler.this.dispatchEvent(new WindowEvent(Modeler.this, WindowEvent.WINDOW_CLOSING));
					}
				}
			}
		};

		ButtonGroup bg = new ButtonGroup();

		String lfName;
		for (int i = 0; i < lf.length; i++) {
			lfName = lf[i].getName();
			menuItem = new JRadioButtonMenuItem(lfName);
			menuItem.setSelected(lfName.equals(lookandfeel));
			menuItem.addItemListener(il);
			subMenu.add(menuItem);
			bg.add(menuItem);
		}

		s = getInternationalText("Precache");
		preinstallMenu = new JMenu(s != null ? s : "Prefetch to Cache");
		preinstallMenu.setMnemonic(KeyEvent.VK_P);
		Zipper.sharedInstance().addComponentToLock(preinstallMenu);
		menu.add(preinstallMenu);

		for (int i = 0; i < precacheFiles.length; i += 2) {
			menuItem = new JMenuItem(precacheFiles[i + 1]);
			final int i1 = i;
			menuItem.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					editor.precache(precacheFiles[i1], " Fetching " + precacheFiles[i1 + 1] + "......");
				}
			});
			preinstallMenu.add(menuItem);
		}
		preinstallMenu.addSeparator();
		menuItem = new JMenuItem("All Packages Above");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				int n = precacheFiles.length / 2;
				String[] address = new String[n];
				String[] message = new String[n];
				for (int i = 0; i < n; i++) {
					address[i] = precacheFiles[i + i];
					message[i] = precacheFiles[i + i + 1];
				}
				editor.precache(address, message);
			}
		});
		preinstallMenu.add(menuItem);

		if (!IS_MAC) {
			menu.addSeparator();
			s = getInternationalText("Preference");
			menuItem = new JMenuItem((s != null ? s : "Preferences") + "...");
			menuItem.setMnemonic(KeyEvent.VK_R);
			menuItem.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					if (preferencesDialog == null)
						preferencesDialog = new PreferencesDialog(Modeler.this);
					preferencesDialog.setPreferences(preference);
					preferencesDialog.setVisible(true);
				}
			});
			menu.add(menuItem);
		}

		menuBar.add(bookmarkMenu);
		editor.addEnabledComponentWhenNotEditable(bookmarkMenu);
		editor.addDisabledComponentWhileLoading(bookmarkMenu);

		// create the remote menu

		s = getInternationalText("SubmitCurrentPage");
		final JMenuItem uploadMI = new JMenuItem((s != null ? s : "Submit Current Page") + "...");
		s = getInternationalText("SubmitCurrentFolder");
		final JMenuItem uploadCurrentFolderMI = new JMenuItem((s != null ? s : "Submit Current Activity Folder") + "...");
		final JMenuItem commentMI = new JMenuItem();
		final JMenuItem viewCommentMI = new JMenuItem();

		s = getInternationalText("Webspace");
		menu = new JMenu(s != null ? s : "Webspace");
		menu.setMnemonic(KeyEvent.VK_C);
		menu.addMenuListener(new MenuListener() {
			public void menuSelected(MenuEvent e) {
				boolean isRemote = page.isRemote();
				uploadMI.setEnabled(!isRemote);
				uploadCurrentFolderMI.setEnabled(!isRemote);
				commentMI.setEnabled(isRemote);
				viewCommentMI.setEnabled(isRemote);
			}

			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}
		});
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		uploadMI.setMnemonic(KeyEvent.VK_P);
		uploadMI.addActionListener(serverGate.uploadAction);
		menu.add(uploadMI);

		uploadCurrentFolderMI.setMnemonic(KeyEvent.VK_F);
		uploadCurrentFolderMI.addActionListener(serverGate.uploadCurrentFolderAction);
		menu.add(uploadCurrentFolderMI);
		menu.addSeparator();

		s = getInternationalText("MyMwSpace");
		menuItem = new JMenuItem(s != null ? s : "My MW Space");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				navigator.visitLocation(getContextRoot() + "home.jsp?client=mw");
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("MyModels");
		menuItem = new JMenuItem(s != null ? s : "My Models");
		menuItem.setMnemonic(KeyEvent.VK_V);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (user.getUserID() != null && !user.getUserID().trim().equals("")) {
					navigator.visitLocation(getMyModelSpaceAddress());
				}
				else {
					navigator.visitLocation(getContextRoot() + "modelspace.jsp?client=mw");
				}
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("MyReports");
		menuItem = new JMenuItem(s != null ? s : "My Reports");
		menuItem.setMnemonic(KeyEvent.VK_R);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				navigator.visitLocation(getMyReportAddress());
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);
		menu.addSeparator();

		commentMI.setAction(serverGate.commentAction);
		s = getInternationalText("MakeComments");
		commentMI.setText((s != null ? s : "Make Comments") + "...");
		menu.add(commentMI);

		viewCommentMI.setAction(serverGate.viewCommentAction);
		s = getInternationalText("ViewComments");
		viewCommentMI.setText((s != null ? s : "View Discussion about Current Page") + "...");
		menu.add(viewCommentMI);

		// create the Window Menu

		s = getInternationalText("Window");
		windowMenu = new JMenu(s != null ? s : "Window");
		windowMenu.setMnemonic(KeyEvent.VK_W);
		windowMenu.addMenuListener(new MenuListener() {
			public void menuCanceled(MenuEvent e) {
			}

			public void menuDeselected(MenuEvent e) {
			}

			public void menuSelected(MenuEvent e) {
				updateWindowMenu();
			}
		});
		menuBar.add(windowMenu);
		editor.addDisabledComponentWhileLoading(windowMenu);

		s = getInternationalText("Minimize");
		menuItem = new JMenuItem(s != null ? s : "Minimize");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Modeler.this.setState(ICONIFIED);
			}
		});
		windowMenu.add(menuItem);

		s = getInternationalText("Maximize");
		menuItem = new JMenuItem(s != null ? s : "Maximize");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				Modeler.this.setExtendedState(MAXIMIZED_BOTH);
			}
		});
		windowMenu.add(menuItem);

		s = getInternationalText("BringAllToFront");
		menuItem = new JMenuItem(s != null ? s : "Bring All to Front");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				for (Modeler x : windowList) {
					x.setState(NORMAL);
					x.toFront();
				}
			}
		});
		windowMenu.add(menuItem);
		windowMenu.addSeparator();

		// create the Help Menu

		s = getInternationalText("Help");
		menu = new JMenu(s != null ? s : "Help");
		menu.setMnemonic(KeyEvent.VK_H);
		menuBar.add(menu);
		editor.addDisabledComponentWhileLoading(menu);

		s = getInternationalText("UserManual");
		menuItem = new JMenuItem(s != null ? s : "Open Online User's Manual");
		menuItem.setMnemonic(KeyEvent.VK_O);
		menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0, true));
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (e.getModifiers() > 0) {
					navigator.visitLocation(navigator.getHomeDirectory() + "tutorial/index.cml");
				}
				else {
					openWithNewInstance(navigator.getHomeDirectory() + "tutorial/index.cml");
				}
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("OpenUserManualInNewWindow");
		menuItem = new JMenuItem(s != null ? s : "Open Online User's Manual in New Window");
		menuItem.setMnemonic(KeyEvent.VK_O);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				openWithNewInstance(navigator.getHomeDirectory() + "tutorial/index.cml");
			}
		});
		menu.add(menuItem);

		s = getInternationalText("KeyboardShortcuts");
		menuItem = new JMenuItem(s != null ? s : "Keyboard Shortcuts");
		menuItem.setMnemonic(KeyEvent.VK_K);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String s = navigator.getHomeDirectory();
				if (Locale.getDefault().equals(Locale.PRC)) {
					s += "cn/manual/keyboard.cml";
				}
				else if (Locale.getDefault().equals(Locale.TAIWAN)) {
					s += "tw/manual/keyboard.cml";
				}
				else {
					s += "tutorial/keyboard.cml";
				}
				navigator.visitLocation(s);
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("SupportedMathFunctions");
		menuItem = new JMenuItem(s != null ? s : "Supported Math Functions");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				navigator.visitLocation(navigator.getHomeDirectory() + "tutorial/functions.cml");
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);
		menu.addSeparator();

		s = getInternationalText("Feedback");
		menuItem = new JMenuItem(s != null ? s : "Send Feedback");
		menuItem.setMnemonic(KeyEvent.VK_F);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				navigator.visitLocation(getContextRoot() + "contact.jsp?client=mw");
			}
		});
		menu.add(menuItem);
		editor.addEnabledComponentWhenNotEditable(menuItem);

		s = getInternationalText("UninstallMWViaJavaCacheViewer");
		menuItem = new JMenuItem((s != null ? s : "Uninstall Molecular Workbench via Java Cache Viewer") + "...");
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				try {
					Runtime.getRuntime().exec("javaws -viewer");
				}
				catch (IOException e1) {
					e1.printStackTrace();
				}
				finally {
					System.exit(0);
				}
			}
		});
		menu.add(menuItem);

		if (launchedByJWS || mwLauncher) {
			s = getInternationalText("ResetDesktopLauncher");
			menuItem = new JMenuItem(s != null ? s : "Reset Desktop Launcher");
			menuItem.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					navigator.visitLocation(Initializer.sharedInstance().getResetJnlpAddress());
				}
			});
			menu.add(menuItem);
		}
		menu.addSeparator();

		if (!IS_MAC) {
			s = getInternationalText("About");
			menuItem = new JMenuItem(s != null ? s : "About Molecular Workbench");
			menuItem.setMnemonic(KeyEvent.VK_A);
			menuItem.addActionListener(new ActionListener() {
				public void actionPerformed(ActionEvent e) {
					navigator.visitLocation(navigator.getHomeDirectory() + "about.cml");
				}
			});
			menu.add(menuItem);
			editor.addEnabledComponentWhenNotEditable(menuItem);
		}

		s = getInternationalText("SystemInfo");
		menuItem = new JMenuItem((s != null ? s : "System Information") + "...");
		menuItem.setMnemonic(KeyEvent.VK_S);
		menuItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				new SystemInfoDialog(Modeler.this).setVisible(true);
			}
		});
		menu.add(menuItem);

	}