List of usage examples for java.awt.event KeyEvent VK_O
int VK_O
To view the source code for java.awt.event KeyEvent VK_O.
Click Source Link
From source file:ru.gelin.fictionbook.reader.actions.OpenAction.java
public OpenAction(FBDocumentHolder documentHolder) { super();//from w w w .j a v a 2 s. co m this.documentHolder = documentHolder; putValue(NAME, msg.get("menu.file.open")); putValue(MNEMONIC_KEY, KeyEvent.VK_O); putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("ctrl O")); putValue(SHORT_DESCRIPTION, msg.get("menu.file.open.tooltip")); }
From source file:com.stefanbrenner.droplet.ui.actions.OpenFileAction.java
protected OpenFileAction(final JFrame frame, final JFileChooser fileChooser, final IDropletContext dropletContext, final String title) { super(frame, dropletContext, title); this.fileChooser = fileChooser; putValue(Action.ACCELERATOR_KEY, UiUtils.getAccelerator(KeyEvent.VK_O)); putValue(Action.MNEMONIC_KEY, UiUtils.getMnemonic(Messages.getString("OpenFileAction.mnemonic"))); //$NON-NLS-1$ putValue(Action.SHORT_DESCRIPTION, Messages.getString("OpenFileAction.description")); //$NON-NLS-1$ }
From source file:org.pdfsam.guiclient.commons.business.actions.SetOutputPathSelectionTableAction.java
/** * @param selectionPanel/* ww w . ja va2s. com*/ * @param destinationField * the JTextField to update * @param defaultOutputFileName * the output file name. If null it's ignored. */ public SetOutputPathSelectionTableAction(JPdfSelectionPanel selectionPanel, JTextField destinationField, String defaultOutputFileName) { super(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(), "Set destination")); this.setEnabled(true); this.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.ALT_DOWN_MASK)); this.putValue(Action.SHORT_DESCRIPTION, GettextResource .gettext(Configuration.getInstance().getI18nResourceBundle(), "Set the destination path")); this.putValue(Action.SMALL_ICON, new ImageIcon(this.getClass().getResource("/images/set_outfile.png"))); this.selectionPanel = selectionPanel; this.destinationField = destinationField; this.defaultOutputFileName = defaultOutputFileName; }
From source file:org.apache.cayenne.modeler.action.OpenProjectAction.java
public KeyStroke getAcceleratorKey() { return KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()); }
From source file:org.pmedv.blackboard.commands.AddDiodeCommand.java
public AddDiodeCommand() { putValue(Action.NAME, resources.getResourceByKey("AddDiodeCommand.name")); putValue(Action.SMALL_ICON, resources.getIcon("icon.diode")); putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("AddDiodeCommand.description")); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK)); setEnabled(false);//www. j a va 2s .c o m }
From source file:de.tor.tribes.ui.components.GroupSelectionList.java
public GroupSelectionList(String pResourceURL) { super(pResourceURL); setCellRenderer(renderer);/*from w w w . ja va 2 s. c o m*/ addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_LEFT) { fireDecrementEvent(); } else if (e.getKeyCode() == KeyEvent.VK_RIGHT) { fireIncrementEvent(); } else if (e.getKeyCode() == KeyEvent.VK_DELETE) { fireResetEvent(); } else if (e.getKeyCode() == KeyEvent.VK_O) { fireSetStateEvent(ListItem.RELATION_TYPE.OR); } else if (e.getKeyCode() == KeyEvent.VK_U) { fireSetStateEvent(ListItem.RELATION_TYPE.AND); } else if (e.getKeyCode() == KeyEvent.VK_N) { fireSetStateEvent(ListItem.RELATION_TYPE.NOT); } else if (e.getKeyCode() == KeyEvent.VK_I) { fireSetStateEvent(ListItem.RELATION_TYPE.DISABLED); } else if (e.getKeyCode() == KeyEvent.VK_H) { JOptionPaneHelper.showInformationBox(GroupSelectionList.this, getRelationAsPlainText(), "Information"); } } }); addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { if (e.getButton() == MouseEvent.BUTTON1) { fireClickedEvent(e.getPoint()); } else { fireResetEvent(e.getPoint()); } } } }); TagManager.getSingleton().addManagerListener(GroupSelectionList.this); }
From source file:com.github.rholder.gradle.ui.DependencyViewerStandalone.java
private void initMenu() { JMenuBar menuBar = new JMenuBar(); JMenu fileMenu = new JMenu("File"); fileMenu.setMnemonic(KeyEvent.VK_F); menuBar.add(fileMenu);/*from w ww.ja v a2 s . c o m*/ JMenuItem open = new JMenuItem("Open Project Folder", KeyEvent.VK_O); open.setMnemonic(KeyEvent.VK_O); open.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { promptForGradleBaseDir(); refresh(); } }); fileMenu.add(open); JMenuItem refresh = new JMenuItem("Refresh"); refresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { refresh(); } }); fileMenu.add(refresh); fileMenu.addSeparator(); JMenuItem exit = new JMenuItem("Exit", KeyEvent.VK_X); exit.setMnemonic(KeyEvent.VK_X); exit.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); fileMenu.add(exit); setJMenuBar(menuBar); }
From source file:jpad.MainEditor.java
private void macSpecifics() { com.apple.eawt.Application app = new com.apple.eawt.Application(); //app.setDockIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("res/icon.png"))); try {//from w ww . ja v a2 s .co m OSXAdapter.setAboutHandler(this, getClass().getDeclaredMethod("showAbout", (Class[]) null)); OSXAdapter.setQuitHandler(this, getClass().getDeclaredMethod("quitApp", (Class[]) null)); } catch (Exception ex) { ex.printStackTrace(); } //TODO: set keyboard shortcuts for openMenuItem openMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); }
From source file:com.evanbelcher.DrillBook.display.DBMenuBar.java
/** * Constructs DBMenuBar. Adds the menu and menuitems. * * @param graphicsRunner the JFrame that created this * @param desktop the DBDesktopPane in the JFrame *//* ww w.j a v a 2 s . c o m*/ public DBMenuBar(GraphicsRunner graphicsRunner, DBDesktopPane desktop) { super(); gr = graphicsRunner; this.desktop = desktop; //Set up the menu JMenu menu = new JMenu("File"); add(menu); //Set up the menu items. JMenuItem menuItem = new JMenuItem("New"); menuItem.setMnemonic(KeyEvent.VK_N); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("new"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Open"); menuItem.setMnemonic(KeyEvent.VK_O); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("open"); menuItem.addActionListener(this); menuItem.setLayout(new MigLayout()); menu.add(menuItem); menuItem = new JMenuItem("Save"); menuItem.setMnemonic(KeyEvent.VK_S); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("save"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Save As"); menuItem.setActionCommand("saveas"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Print Current Page"); menuItem.setMnemonic(KeyEvent.VK_P); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("printpage"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Print Show"); menuItem.setActionCommand("printshow"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Print Dot Sheets"); menuItem.setActionCommand("printdotsheets"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Quit"); menuItem.setMnemonic(KeyEvent.VK_Q); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("quit"); menuItem.addActionListener(this); menu.add(menuItem); menu = new JMenu("Edit"); add(menu); menuItem = new JMenuItem("Undo"); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Z, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("undo"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Redo"); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("redo"); menuItem.addActionListener(this); menu.add(menuItem); menu = new JMenu("Settings"); add(menu); menuItem = new JMenuItem("Toggle Gridlines"); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("togglegrid"); menuItem.addActionListener(this); menuItem.setForeground(Main.getState().getSettings().shouldShowGrid() ? Color.BLACK : Color.RED); menu.add(menuItem); menuItem = new JMenuItem("Toggle Dot Names"); menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_D, InputEvent.CTRL_DOWN_MASK)); menuItem.setActionCommand("togglenames"); menuItem.addActionListener(this); menuItem.setForeground(Main.getState().getSettings().shouldShowNames() ? Color.BLACK : Color.RED); menu.add(menuItem); menuItem = new JMenuItem("Toggle Text Box"); menuItem.setActionCommand("toggletext"); menuItem.addActionListener(this); menuItem.setForeground(Main.getState().getSettings().shouldShowText() ? Color.BLACK : Color.RED); menu.add(menuItem); menuItem = new JMenuItem("Color Code Dots by Instrument"); menuItem.setActionCommand("colordots"); menuItem.addActionListener(this); menuItem.setForeground(Main.getState().getSettings().shouldColorDots() ? Color.BLACK : Color.RED); menu.add(menuItem); menuItem = new JMenuItem(); menuItem.setText(Main.getState().getSettings().useCollegeHashes() ? "Change to High School Hashes" : "Change to College Hashes"); menuItem.setActionCommand("changehash"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("Change Font Size"); menuItem.setActionCommand("fontsize"); menuItem.addActionListener(this); menu.add(menuItem); //add(Box.createHorizontalStrut(menu.getPreferredSize().width)); //add these to the menubar itself menuItem = new JMenuItem("Play"); menuItem.setMaximumSize(new Dimension(menuItem.getPreferredSize().width, Integer.MAX_VALUE)); menuItem.setActionCommand("play"); menuItem.addActionListener(this); add(menuItem); add(Box.createHorizontalGlue()); menu = new JMenu("Help"); add(menu); menuItem = new JMenuItem("Help"); menuItem.setActionCommand("help"); menuItem.addActionListener(this); menu.add(menuItem); menuItem = new JMenuItem("About"); menuItem.setActionCommand("about"); menuItem.addActionListener(this); menu.add(menuItem); }
From source file:org.parosproxy.paros.view.OutputPanel.java
/** * This method initializes this/* w w w .j ava 2 s . c o m*/ */ private void initialize() { this.setLayout(new BorderLayout()); this.setName(Constant.messages.getString("output.panel.title")); // ZAP: i18n if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) { this.setSize(243, 119); } // ZAP: Added Output (doc) icon this.setIcon(new ImageIcon(OutputPanel.class.getResource("/resource/icon/16/172.png"))); // 'doc' icon this.setDefaultAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | Event.SHIFT_MASK, false)); this.setMnemonic(Constant.messages.getChar("output.panel.mnemonic")); this.add(getMainPanel(), BorderLayout.CENTER); this.setShowByDefault(true); }