本文整理了Java中javax.swing.JComboBox.getActionMap()
方法的一些代码示例,展示了JComboBox.getActionMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.getActionMap()
方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:getActionMap
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide
protected void installKeyboardActions() {
super.installKeyboardActions();
//Basic UI won't install an action to open the combo on spacebar,
//so we do it ourselves
if (!tableUI) {
comboBox.getInputMap().put(
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "showPopup"); //NOI18N
comboBox.getActionMap().put("showPopup", new AbstractAction() {
public void actionPerformed(ActionEvent ae) {
if (!comboBox.isPopupVisible()) {
comboBox.showPopup();
}
}
}); //NOI18N
}
}
代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide
protected void installKeyboardActions() {
super.installKeyboardActions();
//Basic UI won't install an action to open the combo on spacebar,
//so we do it ourselves
if (!tableUI) {
comboBox.getInputMap().put(
KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "showPopup"); //NOI18N
comboBox.getActionMap().put("showPopup", new AbstractAction() {
public void actionPerformed(ActionEvent ae) {
if (!comboBox.isPopupVisible()) {
comboBox.showPopup();
}
}
}); //NOI18N
}
}
代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler
private void initTabHandler() {
this.combo.setFocusTraversalKeysEnabled(false);
this.combo.getActionMap().put("tab-action", new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
combo.setSelectedItem(getText());
Component component = getParent().getParent();
if(component instanceof JTable) {
JTable table = (JTable)component;
if((e.getModifiers() & ActionEvent.SHIFT_MASK) > 0) {
table.changeSelection(table.getEditingRow(), table.getEditingColumn()-1, false, false);
} else {
table.changeSelection(table.getEditingRow(), table.getEditingColumn()+1, false, false);
}
} else {
if((e.getModifiers() & ActionEvent.SHIFT_MASK) > 0) {
transferFocusBackward();
} else {
transferFocus();
}
}
}
});
InputMap inputMap = this.combo.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(KeyStroke.getKeyStroke("TAB"), "tab-action");
inputMap.put(KeyStroke.getKeyStroke("shift TAB"), "tab-action");
}
代码示例来源:origin: org.netbeans.api/org-openide-explorer
comboBox.getActionMap().put(
"showPopup",
new AbstractAction() {
comboBox.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "selectPrevious"); //NOI18N
comboBox.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "selectNext"); //NOI18N
comboBox.getActionMap().put("selectPrevious", selectPrevAction); //NOI18N
comboBox.getActionMap().put("selectNext", selectNextAction); //NOI18N
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-editor
private JComboBox createComboBox( String[] choices, String defaultValue, Icon[] icons, Font font, FocusListener listener ) {
JComboBox combo = new JComboBox(choices);
combo.setSelectedItem(defaultValue);
combo.getAccessibleContext().setAccessibleDescription(getBundleString("FixDupImportStmts_Combo_ACSD")); //NOI18N
combo.getAccessibleContext().setAccessibleName(getBundleString("FixDupImportStmts_Combo_Name_ACSD")); //NOI18N
combo.setOpaque(false);
combo.setFont( font );
combo.addFocusListener( listener );
combo.setEnabled( choices.length > 1 );
combo.setRenderer( new DelegatingRenderer(combo.getRenderer(), choices, icons ) );
InputMap inputMap = combo.getInputMap( JComboBox.WHEN_FOCUSED );
inputMap.put( KeyStroke.getKeyStroke( KeyEvent.VK_SPACE, 0), "showPopup" ); //NOI18N
combo.getActionMap().put( "showPopup", new TogglePopupAction() ); //NOI18N
return combo;
}
代码示例来源:origin: stackoverflow.com
final JComboBox simpleBox = new JComboBox(Locale.getAvailableLocales());
// this line configures the combo to only commit on ENTER
// or selecting an item from the list
simpleBox.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
//
// simpleBox.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
// Collections.EMPTY_SET);
// just noticed the OPs edit - following indeed is easier to disable _all_ traversal
// keys with one statement
simpleBox.setFocusTraversalKeysEnabled(false);
Action myAction = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
LOG.info("got it!");
simpleBox.transferFocus();
}
};
simpleBox.getActionMap().put("tab-action", myAction);
simpleBox.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.put(KeyStroke.getKeyStroke("TAB"), "tab-action");
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-editor
private JComboBox createComboBox(DataItem item, Font font, FocusListener listener) {
List<ItemVariant> variants = item.getVariants();
JComboBox combo = new JComboBox(variants.toArray());
combo.setSelectedItem(item.getDefaultVariant());
combo.getAccessibleContext().setAccessibleDescription(getBundleString("FixDupImportStmts_Combo_ACSD")); //NOI18N
combo.getAccessibleContext().setAccessibleName(getBundleString("FixDupImportStmts_Combo_Name_ACSD")); //NOI18N
combo.setOpaque(false);
combo.setFont(font);
combo.addFocusListener(listener);
combo.setEnabled(variants.size() > 1);
combo.setRenderer(new DelegatingRenderer(combo.getRenderer(), variants, item.getVariantIcons()));
InputMap inputMap = combo.getInputMap(JComboBox.WHEN_FOCUSED);
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0), "showPopup"); //NOI18N
combo.getActionMap().put("showPopup", new TogglePopupAction()); //NOI18N
return combo;
}
代码示例来源:origin: JetBrains/jediterm
comboBox.getActionMap().put(DefaultEditorKit.copyAction, new AbstractAction() {
@Override
public void actionPerformed(final ActionEvent e) {
代码示例来源:origin: org.nuiton.jaxx/jaxx-widgets
ActionMap map = comboBox.getActionMap();
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15
final ActionMap actionMap = comboBox.getActionMap();
代码示例来源:origin: com.haulmont.thirdparty/glazedlists
final ActionMap actionMap = comboBox.getActionMap();
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16
final ActionMap actionMap = comboBox.getActionMap();
代码示例来源:origin: com.haulmont.thirdparty/glazedlists
final ActionMap actionMap = comboBox.getActionMap();
this.originalSelectNextAction = actionMap.get("selectNext");
this.originalSelectPreviousAction = actionMap.get("selectPrevious");
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15
final ActionMap actionMap = comboBox.getActionMap();
this.originalSelectNextAction = actionMap.get("selectNext");
this.originalSelectPreviousAction = actionMap.get("selectPrevious");
代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16
final ActionMap actionMap = comboBox.getActionMap();
this.originalSelectNextAction = actionMap.get("selectNext");
this.originalSelectPreviousAction = actionMap.get("selectPrevious");
代码示例来源:origin: org.swinglabs.swingx/swingx-all
ActionMap map = comboBox.getActionMap();
代码示例来源:origin: tmyroadctfig/swingx
ActionMap map = comboBox.getActionMap();
代码示例来源:origin: tmyroadctfig/swingx
ActionMap map = comboBox.getActionMap();
代码示例来源:origin: org.swinglabs.swingx/swingx-all
ActionMap map = comboBox.getActionMap();
内容来源于网络,如有侵权,请联系作者删除!