Examples of TextComponentPeer


Examples of java.awt.peer.TextComponentPeer

     * @return      the end position of the selected text
     * @see         java.awt.TextComponent#setSelectionEnd
     * @see         java.awt.TextComponent#getSelectionStart
     */
    public synchronized int getSelectionEnd() {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            selectionEnd = peer.getSelectionEnd();
        }
        return selectionEnd;
    }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

        }

        this.selectionStart = selectionStart;
        this.selectionEnd = selectionEnd;

        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            peer.select(selectionStart, selectionEnd);
        }
    }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

     */
    public synchronized void selectAll() {
        this.selectionStart = 0;
        this.selectionEnd = getText().length();

        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            peer.select(selectionStart, selectionEnd);
        }
    }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

        int maxposition = getText().length();
        if (position > maxposition) {
            position = maxposition;
        }

        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            peer.setCaretPosition(position);
        } else {
            select(position, position);
        }
    }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

     * @return       the position of the text insertion caret
     * @see #setCaretPosition(int)
     * @since        JDK1.1
     */
    public synchronized int getCaretPosition() {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        int position = 0;

        if (peer != null) {
            position = peer.getCaretPosition();
        } else {
            position = selectionStart;
        }
        int maxposition = getText().length();
        if (position > maxposition) {
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

      throws IOException
    {
        // Serialization support.  Since the value of the fields
        // selectionStart, selectionEnd, and text aren't necessarily
        // up to date, we sync them up with the peer before serializing.
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) {
            text = peer.getText();
            selectionStart = peer.getSelectionStart();
            selectionEnd = peer.getSelectionEnd();
        }

        s.defaultWriteObject();

        AWTEventMulticaster.save(s, textListenerK, textListener);
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

   *
   * @return The text in this component.
   */
  public synchronized String getText()
  {
    TextComponentPeer tcp = (TextComponentPeer) getPeer();
    if (tcp != null)
      text = tcp.getText();

    return(text);
  }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

    if (text == null)
      text = "";

    this.text = text;

    TextComponentPeer tcp = (TextComponentPeer) getPeer();
    if (tcp != null)
      tcp.setText(text);
    setCaretPosition(0);
  }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

   *
   * @return The starting position of the selected text region.
   */
  public synchronized int getSelectionStart()
  {
    TextComponentPeer tcp = (TextComponentPeer) getPeer();
    if (tcp != null)
      selectionStart = tcp.getSelectionStart();

    return(selectionStart);
  }
View Full Code Here

Examples of java.awt.peer.TextComponentPeer

   *
   * @return The ending position of the selected text region.
   */
  public synchronized int getSelectionEnd()
  {
    TextComponentPeer tcp = (TextComponentPeer) getPeer();
    if (tcp != null)
      selectionEnd = tcp.getSelectionEnd();

    return(selectionEnd);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.