setPrompting(inputPrompt != null && focusedTextField != this
&& (text.equals("")));
- if (BrowserInfo.get().isFF3()) {
- /*
- * Firefox 3 is really sluggish when updating input attached to dom.
- * Some optimizations seems to work much better in Firefox3 if we
- * update the actual content lazily when the rest of the DOM has
- * stabilized. In tests, about ten times better performance is
- * achieved with this optimization. See for eg. #2898
- */
- Scheduler.get().scheduleDeferred(new Command() {
- public void execute() {
- String fieldValue;
- if (prompting) {
- fieldValue = isReadOnly() ? "" : inputPrompt;
- addStyleDependentName(CLASSNAME_PROMPT);
- } else {
- fieldValue = text;
- removeStyleDependentName(CLASSNAME_PROMPT);
- }
- /*
- * Avoid resetting the old value. Prevents cursor flickering
- * which then again happens due to this Gecko hack.
- */
- if (!getText().equals(fieldValue)) {
- setText(fieldValue);
- }
- }
- });
+ String fieldValue;
+ if (prompting) {
+ fieldValue = isReadOnly() ? "" : inputPrompt;
+ addStyleDependentName(CLASSNAME_PROMPT);
} else {
- String fieldValue;
- if (prompting) {
- fieldValue = isReadOnly() ? "" : inputPrompt;
- addStyleDependentName(CLASSNAME_PROMPT);
- } else {
- fieldValue = text;
- removeStyleDependentName(CLASSNAME_PROMPT);
- }
- setText(fieldValue);
+ fieldValue = text;
+ removeStyleDependentName(CLASSNAME_PROMPT);
}
+ setText(fieldValue);
lastTextChangeString = valueBeforeEdit = text;
+ valueBeforeEditIsSynced = true;
}
protected void onCut() {
*/
@Override
public void focus() {
- if (getParent() != null) {
- /*
- * When focusing a sub-window it basically means it should be
- * brought to the front. Instead of just moving the keyboard focus
- * we focus the window and bring it top-most.
- */
- bringToFront();
- } else {
- super.focus();
- }
+ /*
+ * When focusing a sub-window it basically means it should be brought to
+ * the front. Instead of just moving the keyboard focus we focus the
+ * window and bring it top-most.
+ */
+ super.focus();
+ bringToFront();
}
+ /**
+ * Notifies the child components and subwindows that the window is attached
+ * to the application.
+ */
+ @Override
+ public void attach() {
+ super.attach();
+ for (Window w : subwindows) {
+ w.attach();
+ }
+ }
+
+ /**
+ * Notifies the child components and subwindows that the window is detached
+ * from the application.
+ */
+ @Override
+ public void detach() {
+ super.detach();
+ for (Window w : subwindows) {
+ w.detach();
+ }
+ }
+
}