home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / sun / awt / windows / WTextComponentPeer.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.5 KB  |  80 lines

  1. package sun.awt.windows;
  2.  
  3. import java.awt.Rectangle;
  4. import java.awt.TextComponent;
  5. import java.awt.event.TextEvent;
  6. import java.awt.peer.TextComponentPeer;
  7.  
  8. abstract class WTextComponentPeer extends WComponentPeer implements TextComponentPeer {
  9.    public void setEditable(boolean var1) {
  10.       this.enableEditing(var1);
  11.       ((WComponentPeer)this).setBackground(((TextComponent)super.target).getBackground());
  12.    }
  13.  
  14.    public native String getText();
  15.  
  16.    public native void setText(String var1);
  17.  
  18.    public native int getSelectionStart();
  19.  
  20.    public native int getSelectionEnd();
  21.  
  22.    public native void select(int var1, int var2);
  23.  
  24.    WTextComponentPeer(TextComponent var1) {
  25.       super(var1);
  26.    }
  27.  
  28.    void initialize() {
  29.       TextComponent var1 = (TextComponent)super.target;
  30.       String var2 = var1.getText();
  31.       if (var2 != null) {
  32.          this.setText(var2);
  33.       }
  34.  
  35.       this.select(var1.getSelectionStart(), var1.getSelectionEnd());
  36.       this.setEditable(var1.isEditable());
  37.       super.initialize();
  38.    }
  39.  
  40.    native void enableEditing(boolean var1);
  41.  
  42.    public boolean isFocusTraversable() {
  43.       return true;
  44.    }
  45.  
  46.    public void setCaretPosition(int var1) {
  47.       this.select(var1, var1);
  48.    }
  49.  
  50.    public int getCaretPosition() {
  51.       return this.getSelectionStart();
  52.    }
  53.  
  54.    public void valueChanged() {
  55.       ((WComponentPeer)this).postEvent(new TextEvent(super.target, 900));
  56.    }
  57.  
  58.    public boolean shouldClearRectBeforePaint() {
  59.       return false;
  60.    }
  61.  
  62.    private static native void initIDs();
  63.  
  64.    public int getIndexAtPoint(int var1, int var2) {
  65.       return -1;
  66.    }
  67.  
  68.    public Rectangle getCharacterBounds(int var1) {
  69.       return null;
  70.    }
  71.  
  72.    public long filterEvents(long var1) {
  73.       return 0L;
  74.    }
  75.  
  76.    static {
  77.       initIDs();
  78.    }
  79. }
  80.