List of usage examples for java.awt.event InputEvent ALT_DOWN_MASK
int ALT_DOWN_MASK
To view the source code for java.awt.event InputEvent ALT_DOWN_MASK.
Click Source Link
From source file:org.omegat.gui.scripting.ScriptingWindow.java
private void addRunShortcutToOmegaT() { JRootPane appliRootPane = Core.getMainWindow().getApplicationFrame().getRootPane(); appliRootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.CTRL_DOWN_MASK | InputEvent.ALT_DOWN_MASK, false), "RUN_CURRENT_SCRIPT"); appliRootPane.getActionMap().put("RUN_CURRENT_SCRIPT", new AbstractAction() { private static final long serialVersionUID = 1L; @Override// w w w . j a va 2s . c o m public void actionPerformed(ActionEvent e) { runScript(); } }); }
From source file:org.orbisgis.groovy.GroovyConsolePanel.java
/** * Create actions instances/*from ww w . ja v a 2 s. com*/ * * Each action is put in the Popup menu and the tool bar Their shortcuts are * registered also in the editor */ private void initActions() { //Execute action executeAction = new DefaultAction(GroovyConsoleActions.A_EXECUTE, I18N.tr("Execute"), I18N.tr("Execute the groovy script"), GroovyIcon.getIcon("execute"), EventHandler.create(ActionListener.class, this, "onExecute"), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK)).setLogicalGroup("custom"); actions.addAction(executeAction); //Execute Selected SQL executeSelectedAction = new DefaultAction(GroovyConsoleActions.A_EXECUTE_SELECTION, I18N.tr("Execute selected"), I18N.tr("Run selected code"), GroovyIcon.getIcon("execute_selection"), EventHandler.create(ActionListener.class, this, "onExecuteSelected"), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_DOWN_MASK)).setLogicalGroup("custom") .setAfter(GroovyConsoleActions.A_EXECUTE); actions.addAction(executeSelectedAction); //Clear action clearAction = new DefaultAction(GroovyConsoleActions.A_CLEAR, I18N.tr("Clear"), I18N.tr("Erase the content of the editor"), GroovyIcon.getIcon("erase"), EventHandler.create(ActionListener.class, this, "onClear"), null); actions.addAction(clearAction); //Open action actions.addAction(new DefaultAction(GroovyConsoleActions.A_OPEN, I18N.tr("Open"), I18N.tr("Load a file in this editor"), GroovyIcon.getIcon("open"), EventHandler.create(ActionListener.class, this, "onOpenFile"), KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK))); //Save saveAction = new DefaultAction(GroovyConsoleActions.A_SAVE, I18N.tr("Save"), I18N.tr("Save the editor content into a file"), GroovyIcon.getIcon("save"), EventHandler.create(ActionListener.class, this, "onSaveFile"), KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK)); actions.addAction(saveAction); // Save As saveAsAction = new DefaultAction(GroovyConsoleActions.A_SAVE, I18N.tr("Save As"), I18N.tr("Save the editor content into a new file"), GroovyIcon.getIcon("page_white_save"), EventHandler.create(ActionListener.class, this, "onSaveAsNewFile"), KeyStroke.getKeyStroke("ctrl maj s")); actions.addAction(saveAsAction); //Find action findAction = new DefaultAction(GroovyConsoleActions.A_SEARCH, I18N.tr("Search.."), I18N.tr("Search text in the document"), GroovyIcon.getIcon("find"), EventHandler.create(ActionListener.class, this, "openFindReplaceDialog"), KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK)) .addStroke(KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_DOWN_MASK)); actions.addAction(findAction); // Comment/Uncomment commentAction = new DefaultAction(GroovyConsoleActions.A_COMMENT, I18N.tr("(Un)comment"), I18N.tr("(Un)comment the selected text"), null, EventHandler.create(ActionListener.class, this, "onComment"), KeyStroke.getKeyStroke("alt C")) .setLogicalGroup("format"); actions.addAction(commentAction); // Block Comment/Uncomment blockCommentAction = new DefaultAction(GroovyConsoleActions.A_BLOCKCOMMENT, I18N.tr("Block (un)comment"), I18N.tr("Block (un)comment the selected text."), null, EventHandler.create(ActionListener.class, this, "onBlockComment"), KeyStroke.getKeyStroke("alt shift C")).setLogicalGroup("format"); actions.addAction(blockCommentAction); }
From source file:org.orbisgis.r.RConsolePanel.java
/** * Create actions instances//from w w w. j av a2 s. c om * * Each action is put in the Popup menu and the tool bar Their shortcuts are * registered also in the editor */ private void initActions() { //Execute action executeAction = new DefaultAction(RConsoleActions.A_EXECUTE, I18N.tr("Execute"), I18N.tr("Execute the R script"), RIcon.getIcon("execute"), EventHandler.create(ActionListener.class, this, "onExecute"), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK)); actions.addAction(executeAction); //Execute Selected SQL executeSelectedAction = new DefaultAction(RConsoleActions.A_EXECUTE_SELECTION, I18N.tr("Execute selected"), I18N.tr("Run selected code"), RIcon.getIcon("execute_selection"), EventHandler.create(ActionListener.class, this, "onExecuteSelected"), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_DOWN_MASK)).setLogicalGroup("custom") .setAfter(RConsoleActions.A_EXECUTE); actions.addAction(executeSelectedAction); //Clear action clearAction = new DefaultAction(RConsoleActions.A_CLEAR, I18N.tr("Clear"), I18N.tr("Erase the content of the editor"), RIcon.getIcon("erase"), EventHandler.create(ActionListener.class, this, "onClear"), null); actions.addAction(clearAction); //Open action actions.addAction( new DefaultAction(RConsoleActions.A_OPEN, I18N.tr("Open"), I18N.tr("Load a file in this editor"), RIcon.getIcon("open"), EventHandler.create(ActionListener.class, this, "onOpenFile"), KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK))); //Save saveAction = new DefaultAction(RConsoleActions.A_SAVE, I18N.tr("Save"), I18N.tr("Save the editor content into a file"), RIcon.getIcon("save"), EventHandler.create(ActionListener.class, this, "onSaveFile"), KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK)); actions.addAction(saveAction); // Save As saveAsAction = new DefaultAction(RConsoleActions.A_SAVE, I18N.tr("Save As"), I18N.tr("Save the editor content into a new file"), RIcon.getIcon("page_white_save"), EventHandler.create(ActionListener.class, this, "onSaveAsNewFile"), KeyStroke.getKeyStroke("ctrl maj s")); actions.addAction(saveAsAction); //Find action findAction = new DefaultAction(RConsoleActions.A_SEARCH, I18N.tr("Search.."), I18N.tr("Search text in the document"), RIcon.getIcon("find"), EventHandler.create(ActionListener.class, this, "openFindReplaceDialog"), KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK)) .addStroke(KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_DOWN_MASK)); actions.addAction(findAction); // Comment/Uncomment commentAction = new DefaultAction(RConsoleActions.A_COMMENT, I18N.tr("(Un)comment"), I18N.tr("(Un)comment the selected text"), null, EventHandler.create(ActionListener.class, this, "onComment"), KeyStroke.getKeyStroke("alt C")) .setLogicalGroup("format"); actions.addAction(commentAction); }
From source file:org.orbisgis.sqlconsole.ui.SQLConsolePanel.java
/** * Create actions instances/*w w w.j a va 2 s .c o m*/ * * Each action is put in the Popup menu and the tool bar * Their shortcuts are registered also in the editor */ private void initActions() { //Execute Action executeAction = new DefaultAction(SQLAction.A_EXECUTE, I18N.tr("Execute"), I18N.tr("Run SQL statements"), SQLConsoleIcon.getIcon("execute"), EventHandler.create(ActionListener.class, this, "onExecute"), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.CTRL_DOWN_MASK)).setLogicalGroup("custom"); actions.addAction(executeAction); //Execute Selected SQL executeSelectedAction = new DefaultAction(SQLAction.A_EXECUTE_SELECTION, I18N.tr("Execute selected"), I18N.tr("Run selected SQL statements"), SQLConsoleIcon.getIcon("execute_selection"), EventHandler.create(ActionListener.class, this, "onExecuteSelected"), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_DOWN_MASK)).setLogicalGroup("custom") .setAfter(SQLAction.A_EXECUTE); actions.addAction(executeSelectedAction); //Clear action clearAction = new DefaultAction(SQLAction.A_CLEAR, I18N.tr("Clear"), I18N.tr("Erase the content of the editor"), SQLConsoleIcon.getIcon("erase"), EventHandler.create(ActionListener.class, this, "onClear"), null).setLogicalGroup("custom") .setAfter(SQLAction.A_EXECUTE_SELECTION); actions.addAction(clearAction); //Find action findAction = new DefaultAction(SQLAction.A_SEARCH, I18N.tr("Search.."), I18N.tr("Search text in the document"), SQLConsoleIcon.getIcon("find"), EventHandler.create(ActionListener.class, this, "openFindReplaceDialog"), KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_DOWN_MASK)) .addStroke(KeyStroke.getKeyStroke(KeyEvent.VK_H, InputEvent.CTRL_DOWN_MASK)) .setLogicalGroup("custom"); actions.addAction(findAction); //Quote quoteAction = new DefaultAction(SQLAction.A_QUOTE, I18N.tr("Quote"), I18N.tr("Quote selected text"), null, EventHandler.create(ActionListener.class, this, "onQuote"), KeyStroke.getKeyStroke(KeyEvent.VK_SLASH, InputEvent.SHIFT_DOWN_MASK)).setLogicalGroup("format"); actions.addAction(quoteAction); //unQuote unQuoteAction = new DefaultAction(SQLAction.A_UNQUOTE, I18N.tr("Un Quote"), I18N.tr("Un Quote selected text"), null, EventHandler.create(ActionListener.class, this, "onUnQuote"), KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, InputEvent.SHIFT_DOWN_MASK)) .setLogicalGroup("format"); actions.addAction(unQuoteAction); // Comment/Uncomment commentAction = new DefaultAction(SQLAction.A_COMMENT, I18N.tr("(Un)comment"), I18N.tr("(Un)comment the selected text"), null, EventHandler.create(ActionListener.class, this, "onComment"), KeyStroke.getKeyStroke("alt C")) .setLogicalGroup("format"); actions.addAction(commentAction); // Block Comment/Uncomment blockCommentAction = new DefaultAction(SQLAction.A_BLOCKCOMMENT, I18N.tr("Block (un)comment"), I18N.tr("Block (un)comment the selected text."), null, EventHandler.create(ActionListener.class, this, "onBlockComment"), KeyStroke.getKeyStroke("alt shift C")).setLogicalGroup("format"); actions.addAction(blockCommentAction); //Format SQL formatSQLAction = new DefaultAction(SQLAction.A_FORMAT, I18N.tr("Format"), I18N.tr("Format editor content"), null, EventHandler.create(ActionListener.class, this, "onFormatCode"), KeyStroke.getKeyStroke("alt shift F")).setLogicalGroup("format"); actions.addAction(formatSQLAction); //Save saveAction = new DefaultAction(SQLAction.A_SAVE, I18N.tr("Save"), I18N.tr("Save the editor content into a file"), SQLConsoleIcon.getIcon("save"), EventHandler.create(ActionListener.class, this, "onSaveFile"), KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_DOWN_MASK)).setLogicalGroup("custom"); actions.addAction(saveAction); // Save As saveAsAction = new DefaultAction(SQLAction.A_SAVE, I18N.tr("Save As"), I18N.tr("Save the editor content into a new file"), SQLConsoleIcon.getIcon("page_white_save"), EventHandler.create(ActionListener.class, this, "onSaveAsNewFile"), KeyStroke.getKeyStroke("ctrl maj s")).setLogicalGroup("custom"); actions.addAction(saveAsAction); //Open action actions.addAction(new DefaultAction(SQLAction.A_OPEN, I18N.tr("Open"), I18N.tr("Load a file in this editor"), SQLConsoleIcon.getIcon("open"), EventHandler.create(ActionListener.class, this, "onOpenFile"), KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_DOWN_MASK)).setLogicalGroup("custom")); //ShowHide function list actions.addAction(new DefaultAction(SQLAction.A_SQL_LIST, I18N.tr("SQL list"), I18N.tr("Show/Hide SQL function list"), SQLConsoleIcon.getIcon("builtinfunctionmap"), EventHandler.create(ActionListener.class, this, "onShowHideFunctionPanel"), null) .setLogicalGroup("custom")); //Time out action actions.addAction(new DefaultAction(SQLAction.A_SQL_TIMEOUT, I18N.tr("Timeout"), I18N.tr("Custom a time out to execute the SQL statement"), SQLConsoleIcon.getIcon("timeout_sql"), EventHandler.create(ActionListener.class, this, "onSQLTimeOut"), KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_DOWN_MASK)).setLogicalGroup("custom")); }
From source file:org.pdfsam.guiclient.commons.business.actions.SetOutputPathSelectionTableAction.java
/** * @param selectionPanel/*ww w . j av a2s . co m*/ * @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.pdfsam.plugin.merge.actions.SaveListAsXmlAction.java
/** * @param selectionPanel// ww w. ja v a 2 s. co m */ public SaveListAsXmlAction(JPdfSelectionPanel selectionPanel) { super(GettextResource.gettext(Configuration.getInstance().getI18nResourceBundle(), "Export as xml")); this.setEnabled(true); this.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_E, InputEvent.ALT_DOWN_MASK)); this.putValue(Action.SHORT_DESCRIPTION, GettextResource.gettext( Configuration.getInstance().getI18nResourceBundle(), "Export the selection list in xml format")); this.putValue(Action.SMALL_ICON, new ImageIcon(this.getClass().getResource("/images/saveXml.png"))); this.selectionPanel = selectionPanel; }
From source file:org.pmedv.blackboard.commands.ConvertToSymbolCommand.java
public ConvertToSymbolCommand() { putValue(Action.NAME, resources.getResourceByKey("ConvertToSymbolCommand.name")); putValue(Action.SMALL_ICON, resources.getIcon("icon.converttosymbol")); putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("ConvertToSymbolCommand.description")); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); setEnabled(false);/*from w w w . jav a2 s . c o m*/ }
From source file:org.pmedv.blackboard.commands.CreatePartListCommand.java
public CreatePartListCommand() { putValue(Action.NAME, resources.getResourceByKey("CreatePartListCommand.name")); putValue(Action.SMALL_ICON, resources.getIcon("icon.partlist")); putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("CreatePartListCommand.description")); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.ALT_DOWN_MASK | InputEvent.CTRL_DOWN_MASK)); setEnabled(false);// ww w . ja va 2 s .c o m }
From source file:org.pmedv.blackboard.commands.MoveToLayerCommand.java
public MoveToLayerCommand() { putValue(Action.NAME, resources.getResourceByKey("MoveToLayerCommand.name")); putValue(Action.SMALL_ICON, resources.getIcon("icon.movetolayer")); putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("MoveToLayerCommand.description")); putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_L, InputEvent.ALT_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK)); setEnabled(false);//from w w w .j ava 2 s. com }
From source file:org.wings.plaf.css.FrameCG.java
private void appendStrokes(StringBuilder builder, SComponent component, int condition, InputMap inputMap) { KeyStroke[] keyStrokes = inputMap.keys(); if (keyStrokes != null) { for (int i = 0; i < keyStrokes.length; i++) { KeyStroke keyStroke = keyStrokes[i]; Object binding = inputMap.get(keyStroke); switch (keyStroke.getKeyEventType()) { case KeyEvent.KEY_PRESSED: builder.append("kss.push(new ks('"); builder.append(component.getName()); builder.append("',"); builder.append(/* w ww .j a v a 2 s . c om*/ condition == SComponent.WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT ? "!0" : "!1"); builder.append(",'"); builder.append(binding); builder.append("',"); builder.append(keyStroke.getKeyCode()); builder.append(','); builder.append((keyStroke.getModifiers() & InputEvent.SHIFT_DOWN_MASK) != 0 ? "!0" : "!1"); builder.append(','); builder.append((keyStroke.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0 ? "!0" : "!1"); builder.append(','); builder.append((keyStroke.getModifiers() & InputEvent.ALT_DOWN_MASK) != 0 ? "!0" : "!1"); builder.append("));\n"); break; case KeyEvent.KEY_TYPED: break; case KeyEvent.KEY_RELEASED: break; } } } }