use of easik.ui.menu.FileSaveAction in project fql by CategoricalData.
the class ApplicationFrame method buildMenu.
/**
* Builds the menu
*/
private void buildMenu() {
final JMenuBar mainMenu;
final JMenu menuFile;
final JMenu menuEdit;
@SuppressWarnings("unused") JMenu menuAction;
final JMenu menuHelp;
mainMenu = new JMenuBar();
// Make the File Menu
menuFile = new JMenu("File");
addMenuItem(menuFile, new FileNewOverviewAction(this), KeyEvent.VK_N);
addMenuItem(menuFile, new FileOpenAction(this), KeyEvent.VK_O);
menuFile.addSeparator();
addMenuItem(menuFile, new FileSaveAction(this), KeyEvent.VK_S);
addMenuItem(menuFile, new FileSaveAsAction(this), KeyEvent.VK_S, InputEvent.SHIFT_DOWN_MASK);
menuFile.addSeparator();
_recentFilesMenu = new JMenu("Open recent...");
menuFile.add(_recentFilesMenu);
updateRecentFilesMenu();
menuFile.addSeparator();
addMenuItem(menuFile, new OverviewDocumentInfoAction(this), KeyEvent.VK_I);
menuFile.addSeparator();
addMenuItem(menuFile, new FileQuitAction(this), KeyEvent.VK_Q);
mainMenu.add(menuFile);
menuFile.setMnemonic(KeyEvent.VK_F);
menuEdit = new JMenu("Edit");
menuEdit.add(new JMenuItem(new NewSketchAction(null, _overview)));
menuEdit.add(new JMenuItem(new ImportSketchAction(null, _overview)));
menuEdit.addSeparator();
menuEdit.add(_NewViewMenuItem = new JMenuItem(new NewViewAction(_overview)));
mainMenu.add(menuEdit);
menuEdit.addMenuListener(new MenuListener() {
@Override
public void menuSelected(final MenuEvent e1) {
final Object[] selection = _overview.getSelectionCells();
_NewViewMenuItem.setEnabled((selection.length == 1) && (selection[0] instanceof SketchNode));
}
@Override
public void menuDeselected(final MenuEvent e1) {
}
@Override
public void menuCanceled(final MenuEvent e1) {
}
});
menuEdit.addSeparator();
// If
addMenuItem(menuEdit, _ProgramSettingsItem = new JMenuItem("Preferences"), KeyEvent.VK_E);
// you
// change
// this
// title,
// update
// OSX.java
_ProgramSettingsItem.setToolTipText("Set Global Easik Properties");
_ProgramSettingsItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e1) {
final ProgramSettingsUI myUI = new ProgramSettingsUI(ApplicationFrame.this);
myUI.showDialog();
}
});
menuEdit.setMnemonic(KeyEvent.VK_E);
// Create help menu
menuHelp = new JMenu("Help");
mainMenu.add(menuHelp);
menuHelp.setMnemonic(KeyEvent.VK_H);
menuHelp.add(new HelpAction());
menuHelp.add(new AboutAction());
setJMenuBar(mainMenu);
}
Aggregations