Package java.awt.peer

Examples of java.awt.peer.TextComponentPeer


        // having a key listener, so just check whether the flag is set
        return (eventMask & AWTEvent.INPUT_METHODS_ENABLED_MASK) != 0;
    }

    public InputMethodRequests getInputMethodRequests() {
        TextComponentPeer peer = (TextComponentPeer)this.peer;
        if (peer != null) return peer.getInputMethodRequests();
        else return null;
    }
View Full Code Here


     * <code>TextComponent</code> without changing its
     * functionality.
     */
    public void removeNotify() {
        synchronized (getTreeLock()) {
      TextComponentPeer peer = (TextComponentPeer)this.peer;
      if (peer != null) {
          text = peer.getText();
    selectionStart = peer.getSelectionStart();
    selectionEnd = peer.getSelectionEnd();
      }
      super.removeNotify();
  }
    }
View Full Code Here

     *                  the text is set to the empty string ""
     * @see         java.awt.TextComponent#getText 
     */
    public synchronized void setText(String t) {
  text = (t != null) ? t : "";
  TextComponentPeer peer = (TextComponentPeer)this.peer;
  if (peer != null) {
      peer.setText(text);
  }
    }
View Full Code Here

     *
     * @return the value of this <code>TextComponent</code>
     * @see     java.awt.TextComponent#setText
     */
    public synchronized String getText() {
  TextComponentPeer peer = (TextComponentPeer)this.peer;
  if (peer != null) {
      text = peer.getText();
  }
  return text;
    }
View Full Code Here

        if (editable == b) {
            return;
        }

  editable = b;
  TextComponentPeer peer = (TextComponentPeer)this.peer;
  if (peer != null) {
      peer.setEditable(b);
  }
    }
View Full Code Here

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

     * @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

  }

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

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

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

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

  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

TOP

Related Classes of java.awt.peer.TextComponentPeer

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.