src/solaris/classes/sun/awt/X11/XTextAreaPeer.java

Print this page




  88         return null;
  89     }
  90 
  91     public int getIndexAtPoint(int x, int y) {
  92         Thread.dumpStack();
  93         return 0;
  94     }
  95 
  96 
  97     /**
  98      * Create a Text area.
  99      */
 100     XTextAreaPeer(TextArea target) {
 101         super( target  );
 102 
 103         // some initializations require that target be set even
 104         // though init(target) has not been called
 105         this.target = target;
 106 
 107         //ComponentAccessor.enableEvents(target,AWTEvent.MOUSE_WHEEL_EVENT_MASK);
 108         target.enableInputMethods(true);
 109 
 110         firstChangeSkipped = false;
 111         String text = ((TextArea)target).getText();
 112         jtext = new AWTTextArea(text, this);
 113         jtext.setWrapStyleWord(true);
 114         jtext.getDocument().addDocumentListener(jtext);
 115         XToolkit.specialPeerMap.put(jtext,this);
 116         jtext.enableInputMethods(true);
 117         textPane = new AWTTextPane(jtext,this, target.getParent());
 118 
 119         setBounds(x, y, width, height, SET_BOUNDS);
 120         textPane.setVisible(true);
 121         textPane.validate();
 122 
 123         AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
 124         foreground = compAccessor.getForeground(target);
 125         if (foreground == null)  {
 126             foreground = SystemColor.textText;
 127         }
 128         setForeground(foreground);
 129 
 130         background = compAccessor.getBackground(target);
 131         if (background == null) {
 132             if (target.isEditable()) background = SystemColor.text;
 133             else background = SystemColor.control;
 134         }
 135         setBackground(background);
 136 
 137         if (!target.isBackgroundSet()) {
 138             // This is a way to set the background color of the TextArea
 139             // without calling setBackground - go through accessor
 140             compAccessor.setBackground(target, background);
 141         }
 142         if (!target.isForegroundSet()) {
 143             target.setForeground(SystemColor.textText);




  88         return null;
  89     }
  90 
  91     public int getIndexAtPoint(int x, int y) {
  92         Thread.dumpStack();
  93         return 0;
  94     }
  95 
  96 
  97     /**
  98      * Create a Text area.
  99      */
 100     XTextAreaPeer(TextArea target) {
 101         super( target  );
 102 
 103         // some initializations require that target be set even
 104         // though init(target) has not been called
 105         this.target = target;
 106 
 107         //ComponentAccessor.enableEvents(target,AWTEvent.MOUSE_WHEEL_EVENT_MASK);
 108         AWTAccessor.ComponentAccessor compAccessor = AWTAccessor.getComponentAccessor();
 109 
 110         firstChangeSkipped = false;
 111         String text = ((TextArea)target).getText();
 112         jtext = new AWTTextArea(text, this);
 113         jtext.setWrapStyleWord(true);
 114         jtext.getDocument().addDocumentListener(jtext);
 115         XToolkit.specialPeerMap.put(jtext,this);
 116         jtext.enableInputMethods(compAccessor.areInputMethodsEnabled(target));
 117         textPane = new AWTTextPane(jtext,this, target.getParent());
 118 
 119         setBounds(x, y, width, height, SET_BOUNDS);
 120         textPane.setVisible(true);
 121         textPane.validate();
 122 

 123         foreground = compAccessor.getForeground(target);
 124         if (foreground == null)  {
 125             foreground = SystemColor.textText;
 126         }
 127         setForeground(foreground);
 128 
 129         background = compAccessor.getBackground(target);
 130         if (background == null) {
 131             if (target.isEditable()) background = SystemColor.text;
 132             else background = SystemColor.control;
 133         }
 134         setBackground(background);
 135 
 136         if (!target.isBackgroundSet()) {
 137             // This is a way to set the background color of the TextArea
 138             // without calling setBackground - go through accessor
 139             compAccessor.setBackground(target, background);
 140         }
 141         if (!target.isForegroundSet()) {
 142             target.setForeground(SystemColor.textText);