javax.swing.JTextPane.processKeyEvent()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(128)

本文整理了Java中javax.swing.JTextPane.processKeyEvent()方法的一些代码示例,展示了JTextPane.processKeyEvent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextPane.processKeyEvent()方法的具体详情如下:
包路径:javax.swing.JTextPane
类名称:JTextPane
方法名:processKeyEvent

JTextPane.processKeyEvent介绍

暂无

代码示例

代码示例来源:origin: groovy/groovy-core

  1. protected void processKeyEvent(KeyEvent e) {
  2. super.processKeyEvent(e);
  3. // Handle release of Insert key to toggle overtype/insert mode
  4. // unless a modifier is active (eg Shift+Insert for paste or
  5. // Ctrl+Insert for Copy)
  6. if (e.getID() == KeyEvent.KEY_RELEASED &&
  7. e.getKeyCode() == KeyEvent.VK_INSERT &&
  8. e.getModifiersEx() == 0) {
  9. setOvertypeMode(!isOvertypeMode());
  10. }
  11. }

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

  1. protected void processKeyEvent(KeyEvent e)
  2. {
  3. super.processKeyEvent(e);
  4. // Handle release of Insert key to toggle overtype/insert mode
  5. if (e.getID() == KeyEvent.KEY_RELEASED &&
  6. e.getKeyCode() == KeyEvent.VK_INSERT) {
  7. setOvertypeMode(!isOvertypeMode());
  8. }
  9. }

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

  1. protected void processKeyEvent(KeyEvent e)
  2. {
  3. super.processKeyEvent(e);
  4. // Handle release of Insert key to toggle overtype/insert mode
  5. if (e.getID() == KeyEvent.KEY_RELEASED &&
  6. e.getKeyCode() == KeyEvent.VK_INSERT) {
  7. setOvertypeMode(!isOvertypeMode());
  8. }
  9. }

代码示例来源:origin: org.kohsuke.droovy/groovy

  1. protected void processKeyEvent(KeyEvent e)
  2. {
  3. super.processKeyEvent(e);
  4. // Handle release of Insert key to toggle overtype/insert mode
  5. if (e.getID() == KeyEvent.KEY_RELEASED &&
  6. e.getKeyCode() == KeyEvent.VK_INSERT) {
  7. setOvertypeMode(!isOvertypeMode());
  8. }
  9. }

代码示例来源:origin: antlr/antlrworks

  1. @Override
  2. protected void processKeyEvent(KeyEvent keyEvent) {
  3. // If the document is not writable, emits a beep
  4. if(writable) {
  5. if(keyEvent.getKeyCode() == KeyEvent.VK_TAB && keyEvent.getID() == KeyEvent.KEY_PRESSED) {
  6. int start = getSelectionStart();
  7. int stop = getSelectionEnd();
  8. if(start != stop) {
  9. // Ident the lines covered by the selection
  10. try {
  11. indentText(start, stop, keyEvent.isShiftDown()?-1:1);
  12. keyEvent.consume();
  13. } catch (BadLocationException e) {
  14. e.printStackTrace();
  15. }
  16. } else {
  17. super.processKeyEvent(keyEvent);
  18. }
  19. } else {
  20. super.processKeyEvent(keyEvent);
  21. }
  22. } else {
  23. super.processKeyEvent(keyEvent);
  24. }
  25. }

代码示例来源:origin: org.codehaus.groovy/groovy-console

  1. protected void processKeyEvent(KeyEvent e) {
  2. super.processKeyEvent(e);
  3. // Handle release of Insert key to toggle overtype/insert mode
  4. // unless a modifier is active (eg Shift+Insert for paste or
  5. // Ctrl+Insert for Copy)
  6. if (e.getID() == KeyEvent.KEY_RELEASED &&
  7. e.getKeyCode() == KeyEvent.VK_INSERT &&
  8. e.getModifiersEx() == 0) {
  9. setOvertypeMode(!isOvertypeMode());
  10. }
  11. }

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

  1. protected void processKeyEvent(KeyEvent e) {
  2. super.processKeyEvent(e);
  3. // Handle release of Insert key to toggle overtype/insert mode
  4. // unless a modifier is active (eg Shift+Insert for paste or
  5. // Ctrl+Insert for Copy)
  6. if (e.getID() == KeyEvent.KEY_RELEASED &&
  7. e.getKeyCode() == KeyEvent.VK_INSERT &&
  8. e.getModifiersEx() == 0) {
  9. setOvertypeMode(!isOvertypeMode());
  10. }
  11. }

相关文章

JTextPane类方法