Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

34
LINES

< > BotCompany Repo | #1013052 // Test RSyntaxTextArea with Substance (fixed num pad arrows)

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 6131K of libraries. Click here for Pure Java version (5708L/38K/137K).

!7

lib 1013041 // RSyntaxTextArea

import org.fife.ui.rtextarea.*;
import org.fife.ui.rsyntaxtextarea.*;

static Map<Int> keyStrokeMap = litmap(
  KeyEvent.VK_UP, KeyEvent.VK_KP_UP,
  KeyEvent.VK_DOWN, KeyEvent.VK_KP_DOWN,
  KeyEvent.VK_LEFT, KeyEvent.VK_KP_LEFT,
  KeyEvent.VK_RIGHT, KeyEvent.VK_KP_RIGHT
);

p-substance {
  new RSyntaxTextAreaDefaultInputMap inputMap;
  for (KeyStroke key : inputMap.keys()) {
    Int code = keyStrokeMap.get(key.getKeyCode());
    if (code != null)
      inputMap.put(KeyStroke.getKeyStroke(code, key.getModifiers()),
        inputMap.get(key));
  }
  //inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0),
  //  inputMap.get(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0));
  UIManager.put("RSyntaxTextAreaUI.inputMap", inputMap);

  RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60);
  textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
  textArea.setCodeFoldingEnabled(true);
  textArea.setTabSize(2);
  textArea.setTabsEmulated(true); // Spaces are MUCH better
  RTextScrollPane sp = new RTextScrollPane(textArea);
  showFrame(sp);
}

Author comment

Began life as a copy of #1013043

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1013052
Snippet name: Test RSyntaxTextArea with Substance (fixed num pad arrows)
Eternal ID of this version: #1013052/5
Text MD5: 446a3bfb2cd19a72b16099f77c50e8d1
Transpilation MD5: 91fb20bf08fc8814077658ade252bb84
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-12-22 16:46:37
Source code size: 1134 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 387
Version history: 4 change(s)
Referenced in: [show references]