Java JTextComponent highlighterIsNext(JTextComponent textComponent, boolean forwards, Highlighter.Highlight highlight)

Here you can find the source of highlighterIsNext(JTextComponent textComponent, boolean forwards, Highlighter.Highlight highlight)

Description

highlighter Is Next

License

Open Source License

Declaration

private static boolean highlighterIsNext(JTextComponent textComponent, boolean forwards,
            Highlighter.Highlight highlight) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.text.*;

public class Main {
    private static boolean highlighterIsNext(JTextComponent textComponent, boolean forwards,
            Highlighter.Highlight highlight) {
        final int minOffset = Math.min(highlight.getStartOffset(), highlight.getEndOffset());
        final int maxOffset = Math.max(highlight.getStartOffset(), highlight.getEndOffset());
        if (forwards) {
            return minOffset > textComponent.getSelectionEnd();
        } else {// ww  w  .j a  v a 2 s. c  om
            return maxOffset < textComponent.getSelectionStart();
        }
    }
}

Related

  1. getPositionBelow(JTextComponent c, int offs, int x)
  2. getPreferredScrollableViewportSize(javax.swing.text.JTextComponent t, Dimension ans)
  3. getRenderedLineOfChar(JTextComponent comp, int charIdx)
  4. getStoredBackground(JTextComponent comp)
  5. getStoredBackground(JTextComponent comp)
  6. implyDisabled(final JCheckBox checked, final boolean checkedState, final JTextComponent changed)
  7. inScrollPane(JTextComponent textComponent, boolean autoscroll)
  8. installUi(JTextComponent txt)
  9. installUndoManager(JTextComponent textComponent)