public static RSyntaxTextArea getDefaultArea(MainWindow mainWindow) { RSyntaxTextArea area = new RSyntaxTextArea(); loadCommonSettings(mainWindow, area); return area; }
CertificatePanel(TabbedPane panel, JNode jnode) { super(panel, jnode); setLayout(new BorderLayout()); textArea = new RSyntaxTextArea(jnode.getContent()); loadSettings(); JScrollPane sp = new JScrollPane(textArea); add(sp); }
luytenPrefs = configSaver.getLuytenPreferences(); textArea = new RSyntaxTextArea(25, 70); textArea.setCaretPosition(0); textArea.requestFocusInWindow();
@Test public void testMarkOccurrencesDelay() { RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setMarkOccurrencesDelay(5432); Assert.assertEquals(5432, textArea.getMarkOccurrencesDelay()); }
@Test public void testHyperlinkForeground() { RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setHyperlinkForeground(Color.pink); Assert.assertEquals(Color.pink, textArea.getHyperlinkForeground()); }
@Test public void testMatchedBracketBorderColor() { RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setMatchedBracketBorderColor(Color.pink); Assert.assertEquals(Color.pink, textArea.getMatchedBracketBorderColor()); }
@Test public void testMatchedBracketBGColor() { RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setMatchedBracketBGColor(Color.pink); Assert.assertEquals(Color.pink, textArea.getMatchedBracketBGColor()); }
@Test public void testGetPreviousWord_manyLinesInBetween() throws Exception { DumbCompleteWordAction action = new DumbCompleteWordAction(); RSyntaxDocument doc = new RSyntaxDocument( SyntaxConstants.SYNTAX_STYLE_JAVA); RSyntaxTextArea textArea = new RSyntaxTextArea(doc); textArea.setText("aaron arthur aardvark\nfoo bar\n// bad code\namazing\n a"); Assert.assertEquals(textArea.getDocument().getLength()-1, action.getPreviousWord(textArea, textArea.getDocument().getLength())); Assert.assertEquals("aaron arthur aardvark\nfoo bar\n// bad code\n".length(), action.getPreviousWord(textArea, textArea.getDocument().getLength()-2)); Assert.assertEquals("aaron arthur ".length(), action.getPreviousWord(textArea, 22)); Assert.assertEquals("aaron ".length(), action.getPreviousWord(textArea, 8)); }
@Test public void testSyntaxEditingStyle() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertEquals(SyntaxConstants.SYNTAX_STYLE_NONE, textArea.getSyntaxEditingStyle()); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); Assert.assertEquals(SyntaxConstants.SYNTAX_STYLE_JAVA, textArea.getSyntaxEditingStyle()); }
@Test public void testEOLMarkersVisible() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertFalse(textArea.getEOLMarkersVisible()); textArea.setEOLMarkersVisible(true); Assert.assertTrue(textArea.getEOLMarkersVisible()); }
@Test public void testMarkOccurrences() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertFalse(textArea.getMarkOccurrences()); textArea.setMarkOccurrences(true); Assert.assertTrue(textArea.getMarkOccurrences()); }
@Test public void testPaintTabLines() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertFalse(textArea.getPaintTabLines()); textArea.setPaintTabLines(true); Assert.assertTrue(textArea.getPaintTabLines()); }
@Test public void testUseFocusableTips() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertTrue(textArea.getUseFocusableTips()); textArea.setUseFocusableTips(false); Assert.assertFalse(textArea.getUseFocusableTips()); }
@Test public void testBracketMatchingEnabled() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertTrue(textArea.isBracketMatchingEnabled()); textArea.setBracketMatchingEnabled(false); Assert.assertFalse(textArea.isBracketMatchingEnabled()); }
@Test public void testHyperlinksEnabled() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertTrue(textArea.getHyperlinksEnabled()); textArea.setHyperlinksEnabled(false); Assert.assertFalse(textArea.getHyperlinksEnabled()); }
@Test public void testUseSelectedTextColor() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertFalse(textArea.getUseSelectedTextColor()); textArea.setUseSelectedTextColor(true); Assert.assertTrue(textArea.getUseSelectedTextColor()); }
@Test public void testAutoIndentEnabled() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertTrue(textArea.isAutoIndentEnabled()); textArea.setAutoIndentEnabled(false); Assert.assertFalse(textArea.isAutoIndentEnabled()); }
@Test public void testCodeFoldingEnabled() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertFalse(textArea.isCodeFoldingEnabled()); textArea.setCodeFoldingEnabled(true); Assert.assertTrue(textArea.isCodeFoldingEnabled()); }
@Test public void testGetSetFoldIconArmedBackground() { RSyntaxTextArea textArea = new RSyntaxTextArea(); FoldIndicator fi = new FoldIndicator(textArea); fi.setFoldIconArmedBackground(Color.red); Assert.assertEquals(Color.red, fi.getFoldIconArmedBackground()); fi.setFoldIconArmedBackground(Color.green); Assert.assertEquals(Color.green, fi.getFoldIconArmedBackground()); }
@Test public void testActionPerformed_dollarSignImportant() throws Exception { RSyntaxDocument doc = new RSyntaxDocument( SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT); RSyntaxTextArea textArea = new RSyntaxTextArea(doc); DumbCompleteWordAction action = getDumbCompleteWordAction(textArea); textArea.setText("$routeProvider routeSkip $ro"); action.actionPerformed(createActionEvent(textArea)); String actual = textArea.getText(); Assert.assertEquals("$routeProvider routeSkip $routeProvider", actual); }