Package javax.swing.text

Examples of javax.swing.text.Segment


                // start = startIndex + 1;
                if (start < 0)
                    start = 0;
                length = getDocument().getLength() - start;
            }
            Segment segment = new Segment();

            try {
                getDocument().getText(start, length, segment);
            } catch (BadLocationException ex) {
                LOG.log(Level.FINE,
                        "this should not happen (calculated the valid start/length) " , ex);
            }

            Matcher matcher = pattern.matcher(segment.toString());
            MatchResult currentResult = getMatchResult(matcher, !backwards);
            if (currentResult != null) {
                updateStateAfterFound(currentResult, start);
            } else {
                updateStateAfterNotFound();
View Full Code Here


            // JW: logic still needs cleanup...
            if (pattern.pattern().equals(lastRegEx)) {
                return false;
            }
            int length = getDocument().getLength() - start;
            Segment segment = new Segment();

            try {
                getDocument().getText(start, length, segment);
            } catch (BadLocationException ex) {
                LOG.log(Level.FINE,
                        "this should not happen (calculated the valid start/length) " , ex);
            }
            Matcher matcher = pattern.matcher(segment.toString());
            MatchResult currentResult = getMatchResult(matcher, true);
            if (currentResult != null) {
                // JW: how to compare match results reliably?
                // the group().equals probably isn't the best idea...
                // better check pattern?
View Full Code Here

    setDoubleBuffered(true);
    setOpaque(true);

    ToolTipManager.sharedInstance().registerComponent(this);

    currentLine = new Segment();
    currentLineIndex = -1;

    setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR));

    setFont(new Font("Monospaced",Font.PLAIN,14));
View Full Code Here

    // Initialize some misc. stuff
    painter = new TextAreaPainter(this,defaults);
    documentHandler = new DocumentHandler();
    listenerList = new EventListenerList();
    caretEvent = new MutableCaretEvent();
    lineSegment = new Segment();
    bracketLine = bracketPosition = -1;
    blink = true;

    // Initialize the GUI
    setLayout(new ScrollLayout());
View Full Code Here

        end = start;
        start = tmp;
      }

      StringBuffer buf = new StringBuffer();
      Segment seg = new Segment();

      for(int i = selectionStartLine; i <= selectionEndLine; i++)
      {
        Element lineElement = map.getElement(i);
        int lineStart = lineElement.getStartOffset();
View Full Code Here

  public void tokenizeLines(int start, int len)
  {
    if(tokenMarker == null || !tokenMarker.supportsMultilineTokens())
      return;

    Segment lineSegment = new Segment();
    Element map = getDefaultRootElement();

    len += start;

    try
View Full Code Here

   */
  public DocumentReader(Document document) {
    position = 0;
    mark = -1;
    this.document = document;
    this.segment = new Segment();
  }
View Full Code Here

    if (offset<0 || offset>=tc.getDocument().getLength()) {
      lastCompletionsAtText = null;
      return lastParameterizedCompletionsAt = null;
    }

    Segment s = new Segment();
    Document doc = tc.getDocument();
    Element root = doc.getDefaultRootElement();
    int line = root.getElementIndex(offset);
    Element elem = root.getElement(line);
    int start = elem.getStartOffset();
View Full Code Here

    if (paramListStart==0) {
      return list; // null
    }

    int dot = tc.getCaretPosition();
    Segment s = new Segment();
    Document doc = tc.getDocument();
    Element root = doc.getDefaultRootElement();
    int line = root.getElementIndex(dot);
    Element elem = root.getElement(line);
    int offs = elem.getStartOffset();
View Full Code Here

  /**
   * Initializes this completion provider.
   */
  protected void init() {
    completions = new ArrayList();
    seg = new Segment();
  }
View Full Code Here

TOP

Related Classes of javax.swing.text.Segment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.