Tabnine Logo
Gutter.addLineTrackingIcon
Code IndexAdd Tabnine to your IDE (free)

How to use
addLineTrackingIcon
method
in
org.fife.ui.rtextarea.Gutter

Best Java code snippets using org.fife.ui.rtextarea.Gutter.addLineTrackingIcon (Showing top 12 results out of 315)

origin: bobbylight/RSyntaxTextArea

/**
 * Adds an icon that tracks an offset in the document, and is displayed
 * adjacent to the line numbers.  This is useful for marking things such
 * as source code errors.
 *
 * @param line The line to track (zero-based).
 * @param icon The icon to display.  This should be small (say 16x16).
 * @return A tag for this icon.  This can later be used in a call to
 *         {@link #removeTrackingIcon(GutterIconInfo)} to remove this
 *         icon.
 * @throws BadLocationException If <code>offs</code> is an invalid offset
 *         into the text area.
 * @see #addLineTrackingIcon(int, Icon, String)
 * @see #addOffsetTrackingIcon(int, Icon)
 * @see #removeTrackingIcon(GutterIconInfo)
 */
public GutterIconInfo addLineTrackingIcon(int line, Icon icon)
                    throws BadLocationException {
  return addLineTrackingIcon(line, icon, null);
}
origin: bobbylight/RSyntaxTextArea

@Test(expected = BadLocationException.class)
public void testAddLineTrackingIcon_3Arg_Invalid() throws Exception {
  RTextArea textArea = new RTextArea(PLAIN_TEXT);
  Gutter gutter = new Gutter(textArea);
  Icon icon = new TestIcon();
  String tip = "tip text";
  gutter.addLineTrackingIcon(4, icon, tip);
}
origin: bobbylight/RSyntaxTextArea

@Test(expected = BadLocationException.class)
public void testAddLineTrackingIcon_2Arg_Invalid() throws Exception {
  RTextArea textArea = new RTextArea(PLAIN_TEXT);
  Gutter gutter = new Gutter(textArea);
  Icon icon = new TestIcon();
  gutter.addLineTrackingIcon(4, icon);
}
origin: com.fifesoft/rsyntaxtextarea

/**
 * Adds an icon that tracks an offset in the document, and is displayed
 * adjacent to the line numbers.  This is useful for marking things such
 * as source code errors.
 *
 * @param line The line to track (zero-based).
 * @param icon The icon to display.  This should be small (say 16x16).
 * @return A tag for this icon.  This can later be used in a call to
 *         {@link #removeTrackingIcon(GutterIconInfo)} to remove this
 *         icon.
 * @throws BadLocationException If <code>offs</code> is an invalid offset
 *         into the text area.
 * @see #addLineTrackingIcon(int, Icon, String)
 * @see #addOffsetTrackingIcon(int, Icon)
 * @see #removeTrackingIcon(GutterIconInfo)
 */
public GutterIconInfo addLineTrackingIcon(int line, Icon icon)
                    throws BadLocationException {
  return addLineTrackingIcon(line, icon, null);
}
origin: bobbylight/RSyntaxTextArea

@Test
public void testRemoveAllTrackingIcons_Simple() throws Exception {
  RTextArea textArea = new RTextArea(PLAIN_TEXT);
  Gutter gutter = new Gutter(textArea);
  Icon icon = new TestIcon();
  textArea.setSize(200, 200);
  gutter.addLineTrackingIcon(0, icon);
  Point p = new Point(0, 4);
  Assert.assertEquals(1, gutter.getTrackingIcons(p).length);
  gutter.removeAllTrackingIcons();
  Assert.assertEquals(0, gutter.getTrackingIcons(p).length);
}
origin: bobbylight/RSyntaxTextArea

@Test
public void testRemoveTrackingIcon_Simple() throws Exception {
  RTextArea textArea = new RTextArea(PLAIN_TEXT);
  Gutter gutter = new Gutter(textArea);
  Icon icon = new TestIcon();
  textArea.setSize(200, 200);
  GutterIconInfo info = gutter.addLineTrackingIcon(0, icon);
  Point p = new Point(0, 4);
  Assert.assertEquals(1, gutter.getTrackingIcons(p).length);
  gutter.removeTrackingIcon(info);
  Assert.assertEquals(0, gutter.getTrackingIcons(p).length);
}
origin: bobbylight/RSyntaxTextArea

@Test
public void testAddLineTrackingIcon_2Arg_Valid() throws Exception {
  RTextArea textArea = new RTextArea(PLAIN_TEXT);
  Gutter gutter = new Gutter(textArea);
  Icon icon = new TestIcon();
  GutterIconInfo gii = gutter.addLineTrackingIcon(1, icon);
  int line1Start = textArea.getText().indexOf('\n') + 1;
  Assert.assertTrue(gii.getIcon() == icon);
  Assert.assertEquals(line1Start, gii.getMarkedOffset());
  Assert.assertNull(gii.getToolTip());
  textArea.insert("a", 0);
  line1Start = textArea.getText().indexOf('\n') + 1; // Should have advanced 1
  Assert.assertEquals(line1Start, gii.getMarkedOffset());
}
origin: bobbylight/RSyntaxTextArea

@Test
public void testAddLineTrackingIcon_3Arg_Valid() throws Exception {
  RTextArea textArea = new RTextArea(PLAIN_TEXT);
  Gutter gutter = new Gutter(textArea);
  Icon icon = new TestIcon();
  String tip = "tip text";
  GutterIconInfo gii = gutter.addLineTrackingIcon(1, icon, tip);
  int line1Start = textArea.getText().indexOf('\n') + 1;
  Assert.assertTrue(gii.getIcon() == icon);
  Assert.assertEquals(line1Start, gii.getMarkedOffset());
  Assert.assertEquals(tip, gii.getToolTip());
  textArea.insert("a", 0);
  line1Start = textArea.getText().indexOf('\n') + 1; // Should have advanced 1
  Assert.assertEquals(line1Start, gii.getMarkedOffset());
}
origin: UNIVALI-LITE/Portugol-Studio

  private void adicionaPontoDeParada(int indiceDaLinha) {
    if (!existePontoDeParadaNaLinha(indiceDaLinha)) {
      try {
        Gutter gutter = RSyntaxUtilities.getGutter(this);
        GutterIconInfo gutterInfo = gutter.addLineTrackingIcon(indiceDaLinha - 1, iconePontoDeParadaDesativado);
        pontosDeParada.add(new IconePontoDeParada(gutterInfo, false));//os pontos são sempre criados como desativados
      } catch (BadLocationException e) {
        //
      }
    }
  }
}
origin: eu.mihosoft.vrl/vrl

  /**
   * Adds an error message.
   *
   * @param line the line the message belongs to
   * @param message the message text
   */
  public void addCodeErrorMessage(int line, String message) {
//        numberView.addCodeErrorMessage(line, message);

    //editor.getParagraphs().get(line - 1).setErrorView(true);
    parent.getMainCanvas().getMessageBox().
        addMessage("Can't compile code:",
            message, null, MessageType.ERROR);

    BufferedImage errorImage = ImageUtils.createCompatibleImage(10, 10);
    Graphics2D g2 = errorImage.createGraphics();
    g2.fillRect(0, 0, 10, 10);
    g2.dispose();
    ImageIcon icon = new ImageIcon(errorImage);

    try {
      getScrollPane().getGutter().addLineTrackingIcon(line, icon);
    } catch (BadLocationException ex) {
      Logger.getLogger(VCodeEditor.class.getName()).
          log(Level.SEVERE, null, ex);
    }
  }

origin: UNIVALI-LITE/Portugol-Studio

private void alternaStatusDoPontoDeParada(IconePontoDeParada pontoDeParada) throws BadLocationException {
  if (pontoDeParada != null) {
    Gutter gutter = RSyntaxUtilities.getGutter(this);
    gutter.removeTrackingIcon(pontoDeParada.getGutterInfo());//remove o ícone antigo para criar um outro no mesmo lugar do gutter
    boolean novoEstado = !pontoDeParada.estaAtivado();//alterna o estado
    int linha = getLineOfOffset(pontoDeParada.getGutterInfo().getMarkedOffset());
    GutterIconInfo novoGutterInfo = gutter.addLineTrackingIcon(linha, novoEstado ? iconePontoDeParadaAtivado : iconePontoDeParadaDesativado);
    pontoDeParada.setaStatus(novoEstado, novoGutterInfo);
    disparaPontosDeParadaAtualizados();
  }
}
origin: UNIVALI-LITE/Portugol-Studio

private void destacarErroExecucao(int linha, int coluna)
{
  try
  {
    int line = Math.max(0, linha - 1);
    trackingIconDoErro = scrollPane.getGutter().addLineTrackingIcon(line, IconFactory.createIcon(IconFactory.CAMINHO_ICONES_PEQUENOS, "stop.png"));
    if (tagErro != null)
    {
      textArea.removeLineHighlight(tagErro);
    }
    int linhaAtual = textArea.getLineOfOffset(textArea.getCaretPosition());
    if (linhaAtual == line)
    {
      textArea.setHighlightCurrentLine(false);
    }
    tagErro = textArea.addLineHighlight(line, corErro);
    ultimaLinhaErro = line;
    ultimaColunaErro = coluna;
    rolarAtePosicao(line, coluna);
    int posicao = textArea.getLineStartOffset(line);
    textArea.getFoldManager().ensureOffsetNotInClosedFold(posicao);
  }
  catch (BadLocationException ex)
  {
    PortugolStudio.getInstancia().getTratadorExcecoes().exibirExcecao(ex);
  }
}
private GutterIconInfo trackingIconDoErro;
org.fife.ui.rtextareaGutteraddLineTrackingIcon

Javadoc

Adds an icon that tracks an offset in the document, and is displayed adjacent to the line numbers. This is useful for marking things such as source code errors.

Popular methods of Gutter

  • setLineNumberColor
    Sets the color to use to paint line numbers.
  • setBackground
  • <init>
    Constructor.
  • addOffsetTrackingIcon
    Adds an icon that tracks an offset in the document, and is displayed adjacent to the line numbers. T
  • getBookmarks
    Returns the bookmarks known to this gutter.
  • getLineNumbersEnabled
    Returns true if the line numbers are enabled and visible.
  • isIconRowHeaderEnabled
    Returns whether the icon row header is enabled.
  • setBorderColor
    Sets the color for the "border" line.
  • setIconRowHeaderEnabled
    Toggles whether the icon row header (used for breakpoints, bookmarks, etc.) is enabled.
  • setLineNumberFont
    Sets the font used for line numbers.
  • setLineNumbersEnabled
    Toggles whether or not line numbers are visible.
  • toggleBookmark
    Programatically toggles whether there is a bookmark for the specified line. If bookmarking is not en
  • setLineNumbersEnabled,
  • toggleBookmark,
  • add,
  • getBackground,
  • getBorder,
  • getComponent,
  • getComponentCount,
  • remove,
  • repaint

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Option (scala)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now