@Override boolean updateTextDirection(int textDirection) { /* AUTO is handled by super */ if (super.updateTextDirection(textDirection) && text.length() != 0) { _setText (text); return true; } return false; }
/** * Sets the receiver's text. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. * </p> * @param string the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); text = string; if ((state & HAS_AUTO_DIRECTION) != 0) { updateTextDirection (AUTO_TEXT_DIRECTION); } }
/** * Sets the receiver's text. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. * </p> * @param string the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); text = string; if ((state & HAS_AUTO_DIRECTION) != 0) { updateTextDirection (AUTO_TEXT_DIRECTION); } }
/** * Sets the receiver's text. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. * </p> * @param string the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); text = string; if ((state & HAS_AUTO_DIRECTION) != 0) { updateTextDirection (AUTO_TEXT_DIRECTION); } }
/** * Sets the receiver's text. * <p> * Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. * </p> * @param string the new text * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the text is null</li> * </ul> * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> */ public void setText (String string) { checkWidget (); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); text = string; if ((state & HAS_AUTO_DIRECTION) != 0) { updateTextDirection (AUTO_TEXT_DIRECTION); } }
@Override boolean updateTextDirection(int textDirection) { /* AUTO is handled by super */ if (super.updateTextDirection(textDirection) && OS.IsUnicode) { int index = parent.indexOf (this); if (index != -1) { if ((textDirection & SWT.RIGHT_TO_LEFT) != 0) { _setText(index, RLE + text); return true; } else if ((textDirection & SWT.LEFT_TO_RIGHT) != 0) { _setText(index, LRE + text); return true; } } } return false; }