/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
boolean firstChangeSkipped;
super(target);
firstChangeSkipped = false;
if (txt.echoCharIsSet()) {
}
else setEchoChar((char)0);
}
// Fix for 5100200
// Restoring Motif behaviour
// Since the end position of the selected text can be greater then the length of the text,
// so we should set caret to max position of the text
// After this line we should not change the component's text
firstChangeSkipped = true;
}
public void dispose() {
// visible caret has a timer thread which must be stopped
super.dispose();
}
void initTextField() {
if (foreground == null)
if (background == null) {
}
if (!target.isBackgroundSet()) {
// This is a way to set the background color of the TextArea
// without calling setBackground - go through accessor
}
if (!target.isForegroundSet()) {
}
}
/**
* @see java.awt.peer.TextComponentPeer
*/
}
}
/**
* @see java.awt.peer.ComponentPeer
*/
super.setEnabled(enabled);
}
}
/**
* @see java.awt.peer.TextComponentPeer
*/
else return null;
}
}
/**
* @see java.awt.peer.TextFieldPeer
*/
public void setEchoChar(char c) {
xtext.setEchoChar(c);
}
}
/**
* @see java.awt.peer.TextComponentPeer
*/
public int getSelectionStart() {
return xtext.getSelectionStart();
}
/**
* @see java.awt.peer.TextComponentPeer
*/
public int getSelectionEnd() {
return xtext.getSelectionEnd();
}
/**
* @see java.awt.peer.TextComponentPeer
*/
}
/**
* @see java.awt.peer.TextComponentPeer
*/
repaint();
}
// JTextField.setText() posts two different events (remove & insert).
// Since we make no differences between text events,
// the document listener has to be disabled while
// JTextField.setText() is called.
if (firstChangeSkipped) {
}
}
return true;
}
/**
* to be implemented.
* @see java.awt.peer.TextComponentPeer
*/
}
/**
* DEPRECATED
* @see java.awt.peer.TextFieldPeer
*/
public void setEchoCharacter(char c) {
setEchoChar(c);
}
void repaintText() {
xtext.repaintNow();
}
if (log.isLoggable(PlatformLogger.FINE)) log.fine("target="+ target + ", old=" + background + ", new=" + c);
background = c;
xtext.setBackground(c);
}
repaintText();
}
foreground = c;
}
repaintText();
}
synchronized (getStateLock()) {
font = f;
}
}
}
/**
* DEPRECATED
* @see java.awt.peer.TextFieldPeer
*/
return getPreferredSize(cols);
}
/**
* Deselects the the highlighted text.
*/
public void deselect() {
}
}
/**
* to be implemented.
* @see java.awt.peer.TextComponentPeer
*/
public int getCaretPosition() {
return xtext.getCaretPosition();
}
/**
* @see java.awt.peer.TextComponentPeer
*/
public void select(int s, int e) {
// Fixed 5100806
// We must take care that Swing components repainted correctly
}
return xtext.getMinimumSize();
}
return xtext.getPreferredSize();
}
return getMinimumSize(cols);
}
}
public boolean isFocusable() {
return true;
}
// NOTE: This method is called by privileged threads.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
modifiers));
}
protected void disposeImpl() {
}
public void repaint() {
}
}
}
}
super.focusLost(e);
}
super.focusGained(e);
}
}
super.handleJavaMouseEvent(mouseEvent);
else
}
}
/**
* DEPRECATED
*/
return getMinimumSize();
}
/**
* DEPRECATED
*/
return getMinimumSize(cols);
}
public void setVisible(boolean b) {
super.setVisible(b);
}
/*
* Fixed 6277332, 6198290:
* the coordinates is coming (to peer): relatively to closest HW parent
* the coordinates is setting (to textField): relatively to closest ANY parent
* the parent of peer is target.getParent()
* the parent of textField is the same
* see 6277332, 6198290 for more information
*/
int childX = x;
int childY = y;
// we up to heavyweight parent in order to be sure
// that the coordinates of the text pane is relatively to closest parent
while (parent.isLightweight()){
}
}
}
//
// Accessibility support
//
// stub functions: to be fully implemented in a future release
/* To be fully implemented in a future release
int oldSelectionStart;
int oldSelectionEnd;
public native int getIndexAtPoint(int x, int y);
public native Rectangle getCharacterBounds(int i);
public native long filterEvents(long mask);
/**
* Handle a change in the text selection endpoints
* (Note: could be simply a change in the caret location)
*
public void selectionValuesChanged(int start, int end) {
return; // Need to write implemetation of this.
}
*/
/**
* Creates a UI for a JTextField.
*
* @param c the text field
* @return the UI
*/
return "PasswordField";
} else {
return "TextField";
}
}
super.installUI(c);
jtf = (JTextField) c;
if ((f == null) || (f instanceof UIResource)) {
}
}
}
}
if ((s == null) || (s instanceof UIResource)) {
}
}
}
if ((b == null) || (b instanceof UIResource)) {
}
}
}
protected void installKeyboardActions() {
super.installKeyboardActions();
map);
}
}
return new XTextAreaPeer.XAWTCaret();
}
}
implements ActionListener,
{
boolean isFocused = false;
super(text);
setDoubleBuffered(true);
setFocusable(false);
setCaretPosition(0);
addActionListener(this);
addNotify();
}
getText(),
actionEvent.getModifiers()));
}
}
}
}
}
}
}
return (ComponentPeer) peer;
}
public void repaintNow() {
}
return peer.getGraphics();
}
public void updateUI() {
}
isFocused = true;
super.processFocusEvent(fe);
}
isFocused = false;
super.processFocusEvent(fe);
}
public boolean hasFocus() {
return isFocused;
}
}
}
}
// Fix for 4915454 - override the default implementation to avoid
// loading SystemFlavorMap and associated classes.
}
public void setEchoChar(char c) {
super.setEchoChar(c);
}
}
}