Java Code Examples for org.fife.ui.rsyntaxtextarea.RSyntaxTextArea#setRows()
The following examples show how to use
org.fife.ui.rsyntaxtextarea.RSyntaxTextArea#setRows() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonSearchDialog.java From jadx with Apache License 2.0 | 6 votes |
private Component makeCell(JNode node, int column) { if (column == 0) { JLabel label = new JLabel(node.makeLongStringHtml() + " ", node.getIcon(), SwingConstants.LEFT); label.setFont(font); label.setOpaque(true); label.setToolTipText(label.getText()); return label; } if (!node.hasDescString()) { return emptyLabel; } RSyntaxTextArea textArea = AbstractCodeArea.getDefaultArea(mainWindow); textArea.setLayout(new GridLayout(1, 1)); textArea.setEditable(false); textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA); textArea.setText(" " + node.makeDescString()); textArea.setRows(1); textArea.setColumns(textArea.getText().length() + 1); if (highlightText != null) { SearchContext searchContext = new SearchContext(highlightText); searchContext.setMatchCase(!highlightTextCaseInsensitive); searchContext.setMarkAll(true); SearchEngine.markAll(textArea, searchContext); } return textArea; }
Example 2
Source File: SQLTextArea.java From Cognizant-Intelligent-Test-Scripter with Apache License 2.0 | 5 votes |
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); jTextArea1 = new RSyntaxTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setModal(true); setUndecorated(true); jTextArea1.setColumns(20); jTextArea1.setRows(5); jScrollPane2.setViewportView(jTextArea1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 615, Short.MAX_VALUE) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(11, Short.MAX_VALUE)) ); pack(); }
Example 3
Source File: MainFrame.java From jsflight with Apache License 2.0 | 5 votes |
private void configureScriptTextArea(RSyntaxTextArea eventContent, RTextScrollPane scrollPane_2, String syntaxStyle) { eventContent.setSyntaxEditingStyle(syntaxStyle); eventContent.getFoldManager().setCodeFoldingEnabled(true); eventContent.setFont(new Font("Hack", Font.PLAIN, 16)); eventContent.setRows(3); eventContent.setMarkOccurrences(true); eventContent.setLineWrap(true); eventContent.setWrapStyleWord(true); scrollPane_2.setLineNumbersEnabled(true); scrollPane_2.setFoldIndicatorEnabled(true); }
Example 4
Source File: TextAreaPropertyEditorDialog.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 5 votes |
protected JTextArea createTextArea() { final RSyntaxTextArea textArea = new RSyntaxTextArea(); textArea.setBracketMatchingEnabled( true ); textArea.setSyntaxEditingStyle( RSyntaxTextArea.SYNTAX_STYLE_JAVA ); textArea.setColumns( 60 ); textArea.setRows( 20 ); textArea.getDocument().addDocumentListener( new DocumentUpdateHandler() ); return textArea; }
Example 5
Source File: PmdDataSourceEditor.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 4 votes |
private void init( final DesignTimeContext context ) { if ( context == null ) { throw new NullPointerException(); } this.context = context; setModal( true ); setTitle( Messages.getString( "PmdDataSourceEditor.Title" ) ); maxPreviewRowsSpinner = new JSpinner( new SpinnerNumberModel( 10000, 1, Integer.MAX_VALUE, 1 ) ); previewAction = new PreviewAction(); globalTemplateAction = new GlobalTemplateAction(); queryTemplateAction = new QueryTemplateAction(); filenameField = new JTextField( null, 0 ); filenameField.setColumns( 30 ); filenameField.getDocument().addDocumentListener( new FilenameDocumentListener() ); queryNameList = new JList(); queryNameList.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); queryNameList.setVisibleRowCount( 5 ); queryNameList.addListSelectionListener( new QueryNameListSelectionListener() ); queryNameList.setCellRenderer( new QueryNameListCellRenderer() ); queryAddButton = new BorderlessButton( new AddQueryAction() ); queryRemoveButton = new BorderlessButton( new RemoveQueryAction() ); queryNameTextField = new JTextField( null, 0 ); queryNameTextField.setColumns( 35 ); queryNameTextField.getDocument().addDocumentListener( new QueryNameTextFieldDocumentListener() ); domainIdTextField = new JTextField( null, 0 ); domainIdTextField.setColumns( 35 ); domainIdTextField.getDocument().addDocumentListener( new DomainTextFieldDocumentListener() ); queryTextArea = new RSyntaxTextArea(); queryTextArea.setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_XML ); queryTextArea.setWrapStyleWord( true ); queryTextArea.setLineWrap( true ); queryTextArea.setRows( 5 ); queryTextArea.getDocument().addDocumentListener( new QueryDocumentListener() ); queryDesignerButton = new JButton( new QueryDesignerAction() ); queryDesignerButton.setEnabled( false ); queryDesignerButton.setBorder( new EmptyBorder( 0, 0, 0, 0 ) ); globalScriptTextArea = new RSyntaxTextArea(); globalScriptTextArea.setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_NONE ); globalLanguageField = new SmartComboBox( new DefaultComboBoxModel( getScriptEngineLanguages() ) ); globalLanguageField.setRenderer( new QueryLanguageListCellRenderer() ); globalLanguageField.addActionListener( new UpdateScriptLanguageHandler() ); queryScriptTextArea = new RSyntaxTextArea(); queryScriptTextArea.setSyntaxEditingStyle( SyntaxConstants.SYNTAX_STYLE_NONE ); queryScriptTextArea.getDocument().addDocumentListener( new QueryScriptDocumentListener() ); queryLanguageListCellRenderer = new QueryLanguageListCellRenderer(); queryLanguageField = new SmartComboBox( new DefaultComboBoxModel( getScriptEngineLanguages() ) ); queryLanguageField.setRenderer( queryLanguageListCellRenderer ); queryLanguageField.addActionListener( new UpdateScriptLanguageHandler() ); super.init(); }
Example 6
Source File: QuerySelectorDialog.java From pentaho-reporting with GNU Lesser General Public License v2.1 | 4 votes |
protected void init() { setDefaultCloseOperation( JDialog.DISPOSE_ON_CLOSE ); fieldList = new JList(); fieldList.setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); fieldList.setVisibleRowCount( 5 ); fieldList.setCellRenderer( new FixDefaultListCellRenderer() ); fieldList.addMouseListener( new MouseHandler() ); syntaxModel = new KeyedComboBoxModel<String, String>(); syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_NONE ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.None" ) ); syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_JAVA ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Java" ) ); syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.JavaScript" ) ); syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_GROOVY ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Groovy" ) ); syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_HTML ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Html" ) ); syntaxModel .add( ( SyntaxConstants.SYNTAX_STYLE_CSS ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.CSS" ) ); syntaxModel .add( ( SyntaxConstants.SYNTAX_STYLE_SQL ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.SQL" ) ); syntaxModel .add( ( SyntaxConstants.SYNTAX_STYLE_XML ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.XML" ) ); syntaxModel.add( ( SyntaxConstants.SYNTAX_STYLE_PYTHON ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.Python" ) ); syntaxModel .add( ( SyntaxConstants.SYNTAX_STYLE_TCL ), UtilMessages.getInstance().getString( "RSyntaxAreaLanguages.TCL" ) ); textArea = new RSyntaxTextArea(); textArea.setBracketMatchingEnabled( true ); textArea.setSyntaxEditingStyle( RSyntaxTextArea.SYNTAX_STYLE_JAVA ); textArea.setColumns( 60 ); textArea.setRows( 20 ); final JPanel syntaxSelectionPane = new JPanel(); syntaxSelectionPane.setLayout( new FlowLayout() ); final JComboBox syntaxBox = new JComboBox( syntaxModel ); syntaxBox.addActionListener( new SyntaxHighlightAction() ); syntaxSelectionPane.add( syntaxBox ); final JPanel contentPane = new JPanel(); contentPane.setLayout( new BorderLayout() ); contentPane.add( new RTextScrollPane( 500, 300, textArea, true ), BorderLayout.CENTER ); contentPane.add( syntaxBox, BorderLayout.NORTH ); tab = new JTabbedPane(); tab.addTab( UtilMessages.getInstance().getString( "QuerySelectorDialog.DefinedQueries" ), new JScrollPane( fieldList ) ); tab.addTab( UtilMessages.getInstance().getString( "QuerySelectorDialog.CustomQuery" ), contentPane ); setTitle( UtilMessages.getInstance().getString( "QuerySelectorDialog.SelectQuery" ) ); super.init(); }