@Override public void actionPerformed(ActionEvent e) { scrollPane.setLineNumbersEnabled( !scrollPane.getLineNumbersEnabled()); }
/** * Creates a scroll pane. * * @param comp The component this scroll pane should display. This should * be an instance of {@link RTextArea}, * <code>javax.swing.JLayer</code> (or the older * <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>. * If this argument is <code>null</code>, you must call * {@link #setViewportView(Component)}, passing in an instance of * one of the types above. * @param lineNumbers Whether line numbers are initially enabled. * @param lineNumberColor The color to use for line numbers. */ public RTextScrollPane(Component comp, boolean lineNumbers, Color lineNumberColor) { super(comp); RTextArea textArea = getFirstRTextAreaDescendant(comp); // Create the gutter for this document. Font defaultFont = new Font("Monospaced", Font.PLAIN, 12); gutter = new Gutter(textArea); gutter.setLineNumberFont(defaultFont); gutter.setLineNumberColor(lineNumberColor); setLineNumbersEnabled(lineNumbers); // Set miscellaneous properties. setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); }
@Override public void actionPerformed(ActionEvent e) { JTextComponent textComponent = getTextComponent(e); if (textComponent instanceof HttpPanelSyntaxHighlightTextArea) { HttpPanelSyntaxHighlightTextArea httpPanelTextArea = (HttpPanelSyntaxHighlightTextArea)textComponent; Component c = httpPanelTextArea.getParent(); if (c instanceof JViewport) { c = c.getParent(); if (c instanceof RTextScrollPane) { final RTextScrollPane scrollPane = (RTextScrollPane)c; scrollPane.setLineNumbersEnabled(!scrollPane.getLineNumbersEnabled()); } } } } }
rTextScrollPane1.setLineNumbersEnabled(true);
sp.setLineNumbersEnabled(false);
sp.setLineNumbersEnabled(false);
/** * Creates a scroll pane with preferred size (width, height). * * @param area The text area this scroll pane will contain. If this is * <code>null</code>, you must call * {@link #setViewportView(Component)}, passing in an * {@link RTextArea}. * @param lineNumbers Whether line numbers are initially enabled. * @param lineNumberColor The color to use for line numbers. */ public RTextScrollPane(RTextArea area, boolean lineNumbers, Color lineNumberColor) { super(area); // Create the text area and set it inside this scroll bar area. textArea = area; // Create the gutter for this document. Font defaultFont = new Font("Monospaced", Font.PLAIN, 12); gutter = new Gutter(textArea); gutter.setLineNumberFont(defaultFont); gutter.setLineNumberColor(lineNumberColor); setLineNumbersEnabled(lineNumbers); // Set miscellaneous properties. setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); }
finalPayloadScrollPane.setLineNumbersEnabled(true);
/** * Creates a scroll pane with preferred size (width, height). * * @param area The text area this scroll pane will contain. If this is * <code>null</code>, you must call * {@link #setViewportView(Component)}, passing in an * {@link RTextArea}. * @param lineNumbers Whether line numbers are initially enabled. * @param lineNumberColor The color to use for line numbers. */ public RTextScrollPane(RTextArea area, boolean lineNumbers, Color lineNumberColor) { super(area); // Create the text area and set it inside this scroll bar area. textArea = area; // Create the gutter for this document. Font defaultFont = new Font("Monospaced", Font.PLAIN, 12); gutter = new Gutter(textArea); gutter.setLineNumberFont(defaultFont); gutter.setLineNumberColor(lineNumberColor); setLineNumbersEnabled(lineNumbers); // Set miscellaneous properties. setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); }
jwtArea.setPopupMenu(new JPopupMenu()); RTextScrollPane sp = new RTextScrollPane(jwtArea); sp.setLineNumbersEnabled(false);
/** * Creates a scroll pane. * * @param comp The component this scroll pane should display. This should * be an instance of {@link RTextArea}, * <code>javax.swing.JLayer</code> (or the older * <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>. * If this argument is <code>null</code>, you must call * {@link #setViewportView(Component)}, passing in an instance of * one of the types above. * @param lineNumbers Whether line numbers are initially enabled. * @param lineNumberColor The color to use for line numbers. */ public RTextScrollPane(Component comp, boolean lineNumbers, Color lineNumberColor) { super(comp); RTextArea textArea = getFirstRTextAreaDescendant(comp); // Create the gutter for this document. Font defaultFont = new Font("Monospaced", Font.PLAIN, 12); gutter = new Gutter(textArea); gutter.setLineNumberFont(defaultFont); gutter.setLineNumberColor(lineNumberColor); setLineNumbersEnabled(lineNumbers); // Set miscellaneous properties. setVerticalScrollBarPolicy(VERTICAL_SCROLLBAR_ALWAYS); setHorizontalScrollBarPolicy(HORIZONTAL_SCROLLBAR_AS_NEEDED); }
RSyntaxSQLEntryPanel(ISession session, SyntaxPreferences prefs, HashMap<String, Object> props) { super(session.getApplication()); if (session == null) { throw new IllegalArgumentException("Null ISession passed"); } _session = session; _propertiesWrapper = new RSyntaxPropertiesWrapper(props); _textArea = new SquirrelRSyntaxTextArea(session, prefs, _propertiesWrapper, getIdentifier()); _textScrollPane = new RTextScrollPane(_textArea); _textScrollPane.setLineNumbersEnabled(prefs.isLineNumbersEnabled()); dt = new DropTarget(_textArea, new FileEditorDropTargetListener(session)); ////////////////////////////////////////////////////////////////////// // Dragging inside the text area itself conflicts with file dnd // so we disable it. See bug #3006515 _textArea.setDragEnabled(false); // //////////////////////////////////////////////////////////////////// }
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); }
if (c instanceof RTextScrollPane) { final RTextScrollPane scrollPane = (RTextScrollPane)c; scrollPane.setLineNumbersEnabled(fileConfiguration.getBoolean(key + SHOW_LINE_NUMBERS, scrollPane.getLineNumbersEnabled()));