org.fife.ui.rtextarea.RTextScrollPane.setLineNumbersEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(71)

本文整理了Java中org.fife.ui.rtextarea.RTextScrollPane.setLineNumbersEnabled方法的一些代码示例,展示了RTextScrollPane.setLineNumbersEnabled的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RTextScrollPane.setLineNumbersEnabled方法的具体详情如下:
包路径:org.fife.ui.rtextarea.RTextScrollPane
类名称:RTextScrollPane
方法名:setLineNumbersEnabled

RTextScrollPane.setLineNumbersEnabled介绍

[英]Toggles whether or not line numbers are visible.
[中]切换行号是否可见。

代码示例

代码示例来源:origin: bobbylight/RSyntaxTextArea

@Override
public void actionPerformed(ActionEvent e) {
  scrollPane.setLineNumbersEnabled(
      !scrollPane.getLineNumbersEnabled());
}

代码示例来源:origin: bobbylight/RSyntaxTextArea

/**
 * 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);
}

代码示例来源:origin: org.zaproxy/zap

@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());
        }
      }
    }
  }
}

代码示例来源:origin: sebbrudzinski/Open-LaTeX-Studio

rTextScrollPane1.setLineNumbersEnabled(true);

代码示例来源:origin: mvetsch/JWT4B

sp.setLineNumbersEnabled(false);

代码示例来源:origin: mvetsch/JWT4B

sp.setLineNumbersEnabled(false);

代码示例来源:origin: org.codehaus.jtstand/jtstand-editor

/**
 * 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);
}

代码示例来源:origin: RUB-NDS/BurpSSOExtension

finalPayloadScrollPane.setLineNumbersEnabled(true);

代码示例来源:origin: org.nuiton.thirdparty/rsyntaxtextarea

/**
 * 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);
}

代码示例来源:origin: mvetsch/JWT4B

jwtArea.setPopupMenu(new JPopupMenu()); 
RTextScrollPane sp = new RTextScrollPane(jwtArea);
sp.setLineNumbersEnabled(false);

代码示例来源:origin: com.fifesoft/rsyntaxtextarea

/**
 * 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);
}

代码示例来源:origin: net.sf.squirrel-sql.plugins/syntax

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);
  //
  ////////////////////////////////////////////////////////////////////
}

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

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);
}

代码示例来源:origin: org.zaproxy/zap

if (c instanceof RTextScrollPane) {
  final RTextScrollPane scrollPane = (RTextScrollPane)c;
  scrollPane.setLineNumbersEnabled(fileConfiguration.getBoolean(key + SHOW_LINE_NUMBERS, scrollPane.getLineNumbersEnabled()));

相关文章