textArea.setEditable(false); textArea.setAntiAliasingEnabled(true); textArea.setCodeFoldingEnabled(true); if (name.toLowerCase().endsWith(".class") || name.toLowerCase().endsWith(".java")) textArea.setSyntaxEditingStyle(SYNTAX_STYLE_JAVA);
@Override public void actionPerformed(ActionEvent e) { textArea.setCodeFoldingEnabled(!textArea.isCodeFoldingEnabled()); }
textArea.setCodeFoldingEnabled(true); RTextScrollPane sp = new RTextScrollPane(textArea); cp.add(sp);
textArea.requestFocusInWindow(); textArea.setMarkOccurrences(true); textArea.setCodeFoldingEnabled(true); textArea.setClearWhitespaceLinesEnabled(false);
public SyntaxSchemeDemo() { JPanel cp = new JPanel(new BorderLayout()); textArea = new RSyntaxTextArea(20, 60); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); textArea.setCodeFoldingEnabled(true); textArea.setAntiAliasingEnabled(true); RTextScrollPane sp = new RTextScrollPane(textArea); cp.add(sp); textArea.setText(TEXT); JMenuBar mb = new JMenuBar(); JMenu menu = new JMenu("File"); mb.add(menu); JMenuItem changeStyleProgrammaticallyItem = new JMenuItem( "Change Style Programmatically"); changeStyleProgrammaticallyItem .setActionCommand("ChangeProgrammatically"); changeStyleProgrammaticallyItem.addActionListener(this); menu.add(changeStyleProgrammaticallyItem); JMenuItem changeStyleViaThemesItem = new JMenuItem( "Change Style via Theme XML"); changeStyleViaThemesItem.setActionCommand("ChangeViaThemes"); changeStyleViaThemesItem.addActionListener(this); menu.add(changeStyleViaThemesItem); setJMenuBar(mb); setContentPane(cp); setTitle("Syntax Scheme Demo"); setDefaultCloseOperation(EXIT_ON_CLOSE); pack(); setLocationRelativeTo(null); }
@Test public void testCodeFoldingEnabled() { RSyntaxTextArea textArea = new RSyntaxTextArea(); Assert.assertFalse(textArea.isCodeFoldingEnabled()); textArea.setCodeFoldingEnabled(true); Assert.assertTrue(textArea.isCodeFoldingEnabled()); }
RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); textArea.setCodeFoldingEnabled(true); RTextScrollPane rs = new RTextScrollPane(textArea);
private void dobrarLinhasCodigo(List<Integer> linhas) { // Desabilitar e reabilitar força o parser do editor a reprocessar o // arquivo e desta forma a árvore estrutural de símbolos é atualizada. // Isto é gambiarra, mas por enquanto deixamos assim, mais pra frente // devemos pensar em uma solução melhor textArea.setCodeFoldingEnabled(false); textArea.setCodeFoldingEnabled(true); textArea.getFoldManager().reparse(); linhas.stream().forEach((linha) -> { Fold fold = textArea.getFoldManager().getFoldForLine(linha); if(fold!=null) fold.setCollapsed(true); }); }
textArea.setSyntaxEditingStyle(codeStyle); textArea.setText(sourceCode); textArea.setCodeFoldingEnabled(true); wrapLines = Boolean.valueOf(callbacks.loadExtensionSetting("wrapLinesInSourceViewer")); if (wrapLines) {
@Override public void initLayout(ScriptingWindow scriptingWindow) { m_scriptingWindow = scriptingWindow; m_scriptEditor = new RSyntaxTextArea(); m_scriptEditor.setFont(new Font(Font.MONOSPACED, Font.PLAIN, m_scriptEditor.getFont().getSize())); m_scriptEditor.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY); m_scriptEditor.setCodeFoldingEnabled(true); RTextScrollPane scrollPaneEditor = new RTextScrollPane(m_scriptEditor); // scrollPaneEditor.setMinimumSize(minimumSize1); m_csp = new CollapsibleSectionPanel(); m_scriptingWindow.frame.getContentPane().add(m_csp); m_csp.add(scrollPaneEditor); initSearchDialogs(); }
m_TextCode.setAutoIndentEnabled(true); m_TextCode.setAntiAliasingEnabled(true); m_TextCode.setCodeFoldingEnabled(true); m_TextCode.setBracketMatchingEnabled(false); panel.add(new RTextScrollPane(m_TextCode), BorderLayout.CENTER);
public TextEditorDemo() { JPanel cp = new JPanel(new BorderLayout()); AbstractTokenMakerFactory atmf = (AbstractTokenMakerFactory)TokenMakerFactory.getDefaultInstance(); atmf.putMapping("text/c3dg", "org.konte.ui.KonteRSTATokenMaker"); RSyntaxTextArea textArea = new RSyntaxTextArea(20, 60); textArea.setSyntaxEditingStyle("text/c3dg"); textArea.setCodeFoldingEnabled(true); RTextScrollPane sp = new RTextScrollPane(textArea); cp.add(sp); setContentPane(cp); setTitle("Text Editor Demo"); setDefaultCloseOperation(EXIT_ON_CLOSE); pack(); setLocationRelativeTo(null); }
sourceTextArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); sourceTextArea.setFont(new Font("monospaced", Font.PLAIN, 12)); sourceTextArea.setCodeFoldingEnabled(true); sourceTextArea.setEditable(false); sourceTextArea.setLineWrap(true);
super(rows, cols); super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); super.setCodeFoldingEnabled(CODE_FOLDING); super.setAntiAliasingEnabled(true); super.setLineWrap(LINE_WRAP);
super(rows, cols); super.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); super.setCodeFoldingEnabled(CODE_FOLDING); super.setAntiAliasingEnabled(true); super.setLineWrap(LINE_WRAP);
this.editor.setAntiAliasingEnabled(true); this.editor.setBracketMatchingEnabled(true); this.editor.setCodeFoldingEnabled(true);
/** * Creates the text area for this application. * * @return The text area. */ private RSyntaxTextArea createTextArea() { RSyntaxTextArea textArea = new RSyntaxTextArea(25, 80); LanguageSupportFactory.get().register(textArea); textArea.setCaretPosition(0); textArea.addHyperlinkListener(this); textArea.requestFocusInWindow(); textArea.setMarkOccurrences(true); textArea.setCodeFoldingEnabled(true); textArea.setTabsEmulated(true); textArea.setTabSize(3); //textArea.setBackground(new java.awt.Color(224, 255, 224)); //textArea.setUseSelectedTextColor(true); //textArea.setLineWrap(true); ToolTipManager.sharedInstance().registerComponent(textArea); return textArea; }
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { scrollPane = new org.fife.ui.rtextarea.RTextScrollPane(); textArea = new PSTextArea(new PortugolDocumento()); setOpaque(false); setLayout(new java.awt.BorderLayout()); scrollPane.setBorder(null); scrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setViewportBorder(javax.swing.BorderFactory.createEmptyBorder(3, 5, 0, 0)); scrollPane.setName("scrollPaneEditor"); // NOI18N scrollPane.setOpaque(false); textArea.setBorder(null); textArea.setToolTipText(""); textArea.setCodeFoldingEnabled(true); textArea.setName("textAreaEditor"); // NOI18N scrollPane.setViewportView(textArea); add(scrollPane, java.awt.BorderLayout.CENTER); }// </editor-fold>//GEN-END:initComponents
@Override public void configure(RSyntaxTextArea editor) { editor.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_GROOVY); editor.setCodeFoldingEnabled(true); editor.setTabsEmulated(true); editor.setTabSize(2);
private void configurarTextArea() { scrollPane.setFoldIndicatorEnabled(true); scrollPane.setIconRowHeaderEnabled(true); scrollPane.setLineNumbersEnabled(true); textArea.setSyntaxEditingStyle("text/por"); textArea.setCodeFoldingEnabled(true); textArea.setUseFocusableTips(true); textArea.addKeyListener(Editor.this); errorStrip = new ErrorStrip(textArea); //errorStrip.setBackground(textArea.getBackground()); //errorStrip.setOpaque(true); errorStrip.setCaretMarkerColor(getBackground()); add(errorStrip, BorderLayout.EAST); Icon iconeBreakPoint = IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "bug.png"); ((PSTextArea) textArea).setIconeDosBreakPoints(iconeBreakPoint); }