Remove usage of to-be-deprecated GWT DOM helper methods
These are not all currently deprecated, but are deprecated in GWT master, e.g.: https://gwt.googlesource.com/gwt/+/a6044a4a54c352b2709d27dd1907e977ce1607ad This change was produced with an automated tool courtesy of the GWT team. Change-Id: Ie5401a3e2231bad7099c4ff35e2c64d77cbbb33b
This commit is contained in:
		@@ -159,7 +159,7 @@ public class CopyableLabel extends Composite implements HasText {
 | 
			
		||||
      h.closeElement("div");
 | 
			
		||||
 | 
			
		||||
      if (swf != null) {
 | 
			
		||||
        DOM.removeChild(getElement(), swf);
 | 
			
		||||
        getElement().removeChild(swf);
 | 
			
		||||
      }
 | 
			
		||||
      DOM.appendChild(getElement(), swf = SafeHtml.parse(h));
 | 
			
		||||
      initHideHandler();
 | 
			
		||||
 
 | 
			
		||||
@@ -77,8 +77,8 @@ public class KeyHelpPopup extends PluginSafePopupPanel implements
 | 
			
		||||
    body.add(lists);
 | 
			
		||||
 | 
			
		||||
    focus = new FocusPanel(body);
 | 
			
		||||
    DOM.setStyleAttribute(focus.getElement(), "outline", "0px");
 | 
			
		||||
    DOM.setElementAttribute(focus.getElement(), "hideFocus", "true");
 | 
			
		||||
    focus.getElement().getStyle().setProperty("outline", "0px");
 | 
			
		||||
    focus.getElement().setAttribute("hideFocus", "true");
 | 
			
		||||
    focus.addKeyPressHandler(this);
 | 
			
		||||
    focus.addKeyDownHandler(this);
 | 
			
		||||
    add(focus);
 | 
			
		||||
 
 | 
			
		||||
@@ -15,7 +15,6 @@
 | 
			
		||||
package com.google.gwtexpui.globalkey.client;
 | 
			
		||||
 | 
			
		||||
import com.google.gwt.dom.client.Element;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.ui.TextArea;
 | 
			
		||||
 | 
			
		||||
public class NpTextArea extends TextArea {
 | 
			
		||||
@@ -29,6 +28,6 @@ public class NpTextArea extends TextArea {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public void setSpellCheck(boolean spell) {
 | 
			
		||||
    DOM.setElementPropertyBoolean(getElement(), "spellcheck", spell);
 | 
			
		||||
    getElement().setPropertyBoolean("spellcheck", spell);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -16,7 +16,6 @@ package com.google.gerrit.client;
 | 
			
		||||
 | 
			
		||||
import com.google.gwt.event.dom.client.ClickEvent;
 | 
			
		||||
import com.google.gwt.event.dom.client.ClickHandler;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.ui.Button;
 | 
			
		||||
import com.google.gwt.user.client.ui.FlowPanel;
 | 
			
		||||
import com.google.gwt.user.client.ui.Widget;
 | 
			
		||||
@@ -49,7 +48,7 @@ public class ConfirmationDialog extends AutoCenterDialogBox {
 | 
			
		||||
    buttons.add(okButton);
 | 
			
		||||
 | 
			
		||||
    cancelButton = new Button();
 | 
			
		||||
    DOM.setStyleAttribute(cancelButton.getElement(), "marginLeft", "300px");
 | 
			
		||||
    cancelButton.getElement().getStyle().setProperty("marginLeft", "300px");
 | 
			
		||||
    cancelButton.setText(Gerrit.C.confirmationDialogCancel());
 | 
			
		||||
    cancelButton.addClickHandler(new ClickHandler() {
 | 
			
		||||
      @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,6 @@ import com.google.gwt.event.dom.client.ClickHandler;
 | 
			
		||||
import com.google.gwt.event.dom.client.KeyPressEvent;
 | 
			
		||||
import com.google.gwt.event.dom.client.KeyPressHandler;
 | 
			
		||||
import com.google.gwt.http.client.Response;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.Window;
 | 
			
		||||
import com.google.gwt.user.client.rpc.StatusCodeException;
 | 
			
		||||
import com.google.gwt.user.client.ui.Button;
 | 
			
		||||
@@ -151,7 +150,7 @@ public class ErrorDialog extends PluginSafePopupPanel {
 | 
			
		||||
 | 
			
		||||
    if (msg != null) {
 | 
			
		||||
      final Label m = new Label(msg);
 | 
			
		||||
      DOM.setStyleAttribute(m.getElement(), "whiteSpace", "pre");
 | 
			
		||||
      m.getElement().getStyle().setProperty("whiteSpace", "pre");
 | 
			
		||||
      body.add(m);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -18,7 +18,6 @@ import com.google.gwt.event.dom.client.ClickEvent;
 | 
			
		||||
import com.google.gwt.event.dom.client.ClickHandler;
 | 
			
		||||
import com.google.gwt.event.logical.shared.CloseEvent;
 | 
			
		||||
import com.google.gwt.event.logical.shared.CloseHandler;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.History;
 | 
			
		||||
import com.google.gwt.user.client.ui.Button;
 | 
			
		||||
import com.google.gwt.user.client.ui.FlowPanel;
 | 
			
		||||
@@ -52,7 +51,7 @@ public class NotSignedInDialog extends AutoCenterDialogBox implements CloseHandl
 | 
			
		||||
    buttons.add(signin);
 | 
			
		||||
 | 
			
		||||
    final Button close = new Button();
 | 
			
		||||
    DOM.setStyleAttribute(close.getElement(), "marginLeft", "200px");
 | 
			
		||||
    close.getElement().getStyle().setProperty("marginLeft", "200px");
 | 
			
		||||
    close.setText(Gerrit.C.signInDialogClose());
 | 
			
		||||
    close.addClickHandler(new ClickHandler() {
 | 
			
		||||
      @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,6 @@ import com.google.gerrit.reviewdb.client.AccountProjectWatch;
 | 
			
		||||
import com.google.gerrit.reviewdb.client.Change.Status;
 | 
			
		||||
import com.google.gwt.event.dom.client.ClickEvent;
 | 
			
		||||
import com.google.gwt.event.dom.client.ClickHandler;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.ui.CheckBox;
 | 
			
		||||
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
 | 
			
		||||
import com.google.gwt.user.client.ui.FlowPanel;
 | 
			
		||||
@@ -49,7 +48,7 @@ public class MyWatchesTable extends FancyFlexTable<AccountProjectWatchInfo> {
 | 
			
		||||
    fmt.setRowSpan(0, 0, 2);
 | 
			
		||||
    fmt.setRowSpan(0, 1, 2);
 | 
			
		||||
    fmt.setRowSpan(0, 2, 2);
 | 
			
		||||
    DOM.setElementProperty(fmt.getElement(0, 3), "align", "center");
 | 
			
		||||
    fmt.getElement(0, 3).setPropertyString("align", "center");
 | 
			
		||||
 | 
			
		||||
    fmt.setColSpan(0, 3, 5);
 | 
			
		||||
    table.setText(1, 0, Util.C.watchedProjectColumnNewChanges());
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,6 @@ import com.google.gwt.text.shared.Renderer;
 | 
			
		||||
import com.google.gwt.uibinder.client.UiBinder;
 | 
			
		||||
import com.google.gwt.uibinder.client.UiField;
 | 
			
		||||
import com.google.gwt.uibinder.client.UiHandler;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.ui.Anchor;
 | 
			
		||||
import com.google.gwt.user.client.ui.CheckBox;
 | 
			
		||||
import com.google.gwt.user.client.ui.Composite;
 | 
			
		||||
@@ -153,7 +152,7 @@ public class PermissionRuleEditor extends Composite implements
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
      rangeEditor.getStyle().setDisplay(Display.NONE);
 | 
			
		||||
      DOM.setElementPropertyBoolean(action.getElement(), "disabled", readOnly);
 | 
			
		||||
      action.getElement().setPropertyBoolean("disabled", readOnly);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (readOnly) {
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,6 @@ package com.google.gerrit.client.admin;
 | 
			
		||||
import com.google.gwt.editor.client.IsEditor;
 | 
			
		||||
import com.google.gwt.editor.client.adapters.TakesValueEditor;
 | 
			
		||||
import com.google.gwt.text.shared.Renderer;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.ui.Composite;
 | 
			
		||||
import com.google.gwt.user.client.ui.IntegerBox;
 | 
			
		||||
import com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment;
 | 
			
		||||
@@ -56,7 +55,7 @@ abstract class RangeBox extends Composite implements
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    void setEnabled(boolean on) {
 | 
			
		||||
      DOM.setElementPropertyBoolean(list.getElement(), "disabled", !on);
 | 
			
		||||
      list.getElement().setPropertyBoolean("disabled", !on);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -77,7 +76,7 @@ abstract class RangeBox extends Composite implements
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    void setEnabled(boolean on) {
 | 
			
		||||
      DOM.setElementPropertyBoolean(box.getElement(), "disabled", !on);
 | 
			
		||||
      box.getElement().setPropertyBoolean("disabled", !on);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
 
 | 
			
		||||
@@ -175,14 +175,14 @@ public class ApprovalTable extends Composite {
 | 
			
		||||
 | 
			
		||||
  private void removeAllChildren(Element el) {
 | 
			
		||||
    for (int i = DOM.getChildCount(el) - 1; i >= 0; i--) {
 | 
			
		||||
      DOM.removeChild(el, DOM.getChild(el, i));
 | 
			
		||||
      el.removeChild(DOM.getChild(el, i));
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private void addMissingLabel(String text) {
 | 
			
		||||
    Element li = DOM.createElement("li");
 | 
			
		||||
    li.setClassName(Gerrit.RESOURCES.css().missingApproval());
 | 
			
		||||
    DOM.setInnerText(li, text);
 | 
			
		||||
    li.setInnerText(text);
 | 
			
		||||
    DOM.appendChild(missing.getElement(), li);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -20,7 +20,6 @@ import com.google.gerrit.common.data.ChangeInfo;
 | 
			
		||||
import com.google.gerrit.reviewdb.client.Change;
 | 
			
		||||
import com.google.gerrit.reviewdb.client.PatchSet;
 | 
			
		||||
import com.google.gwt.core.client.GWT;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
 | 
			
		||||
public class ChangeLink extends InlineHyperlink {
 | 
			
		||||
  public static String permalink(final Change.Id c) {
 | 
			
		||||
@@ -32,7 +31,7 @@ public class ChangeLink extends InlineHyperlink {
 | 
			
		||||
 | 
			
		||||
  public ChangeLink(final String text, final Change.Id c) {
 | 
			
		||||
    super(text, PageLinks.toChange(c));
 | 
			
		||||
    DOM.setElementProperty(getElement(), "href", permalink(c));
 | 
			
		||||
    getElement().setPropertyString("href", permalink(c));
 | 
			
		||||
    cid = c;
 | 
			
		||||
    psid = null;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,6 @@ import com.google.gerrit.client.rpc.GerritCallback;
 | 
			
		||||
import com.google.gerrit.client.rpc.Natives;
 | 
			
		||||
import com.google.gerrit.reviewdb.client.Project;
 | 
			
		||||
import com.google.gwt.core.client.JsArray;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwt.user.client.ui.FlowPanel;
 | 
			
		||||
import com.google.gwt.user.client.ui.FocusWidget;
 | 
			
		||||
import com.google.gwt.user.client.ui.SuggestBox;
 | 
			
		||||
@@ -63,7 +62,7 @@ public abstract class CherryPickDialog extends ActionDialog {
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    newBranch.setWidth("100%");
 | 
			
		||||
    DOM.setStyleAttribute(newBranch.getElement(), "boxSizing", "border-box");
 | 
			
		||||
    newBranch.getElement().getStyle().setProperty("boxSizing", "border-box");
 | 
			
		||||
    message.setCharacterWidth(70);
 | 
			
		||||
 | 
			
		||||
    final FlowPanel mwrap = new FlowPanel();
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,6 @@ import com.google.gwt.event.dom.client.ClickEvent;
 | 
			
		||||
import com.google.gwt.event.dom.client.ClickHandler;
 | 
			
		||||
import com.google.gwt.event.logical.shared.CloseEvent;
 | 
			
		||||
import com.google.gwt.event.logical.shared.CloseHandler;
 | 
			
		||||
import com.google.gwt.user.client.DOM;
 | 
			
		||||
import com.google.gwtjsonrpc.common.AsyncCallback;
 | 
			
		||||
import com.google.gwt.user.client.ui.Button;
 | 
			
		||||
import com.google.gwt.user.client.ui.FlowPanel;
 | 
			
		||||
@@ -55,7 +54,7 @@ public abstract class CommentedActionDialog<T> extends AutoCenterDialogBox
 | 
			
		||||
    message = new NpTextArea();
 | 
			
		||||
    message.setCharacterWidth(60);
 | 
			
		||||
    message.setVisibleLines(10);
 | 
			
		||||
    DOM.setElementPropertyBoolean(message.getElement(), "spellcheck", true);
 | 
			
		||||
    message.getElement().setPropertyBoolean("spellcheck", true);
 | 
			
		||||
    setFocusOn(message);
 | 
			
		||||
    sendButton = new Button(Util.C.commentedActionButtonSend());
 | 
			
		||||
    sendButton.addClickHandler(new ClickHandler() {
 | 
			
		||||
@@ -67,7 +66,7 @@ public abstract class CommentedActionDialog<T> extends AutoCenterDialogBox
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    cancelButton = new Button(Util.C.commentedActionButtonCancel());
 | 
			
		||||
    DOM.setStyleAttribute(cancelButton.getElement(), "float", "right");
 | 
			
		||||
    cancelButton.getElement().getStyle().setProperty("float", "right");
 | 
			
		||||
    cancelButton.addClickHandler(new ClickHandler() {
 | 
			
		||||
      @Override
 | 
			
		||||
      public void onClick(final ClickEvent event) {
 | 
			
		||||
@@ -82,7 +81,7 @@ public abstract class CommentedActionDialog<T> extends AutoCenterDialogBox
 | 
			
		||||
    buttonPanel = new FlowPanel();
 | 
			
		||||
    buttonPanel.add(sendButton);
 | 
			
		||||
    buttonPanel.add(cancelButton);
 | 
			
		||||
    DOM.setStyleAttribute(buttonPanel.getElement(), "marginTop", "4px");
 | 
			
		||||
    buttonPanel.getElement().getStyle().setProperty("marginTop", "4px");
 | 
			
		||||
 | 
			
		||||
    panel = new FlowPanel();
 | 
			
		||||
    panel.add(new SmallHeading(heading));
 | 
			
		||||
 
 | 
			
		||||
@@ -47,15 +47,15 @@ public class ComplexDisclosurePanel extends Composite implements
 | 
			
		||||
      final Element tr1 = DOM.getChild(tbody, 0);
 | 
			
		||||
      final Element tr2 = DOM.getChild(tbody, 1);
 | 
			
		||||
 | 
			
		||||
      DOM.setElementProperty(DOM.getChild(tr1, 0), "width", "20px");
 | 
			
		||||
      DOM.setElementPropertyInt(DOM.getChild(tr2, 0), "colSpan", 2);
 | 
			
		||||
      DOM.getChild(tr1, 0).setPropertyString("width", "20px");
 | 
			
		||||
      DOM.getChild(tr2, 0).setPropertyInt("colSpan", 2);
 | 
			
		||||
      headerParent = tr1;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    header = new ComplexPanel() {
 | 
			
		||||
      {
 | 
			
		||||
        setElement(DOM.createTD());
 | 
			
		||||
        DOM.setInnerHTML(getElement(), " ");
 | 
			
		||||
        getElement().setInnerHTML(" ");
 | 
			
		||||
        addStyleName(Gerrit.RESOURCES.css().complexHeader());
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -29,7 +29,7 @@ public class FancyFlexTableImplIE6 extends FancyFlexTableImpl {
 | 
			
		||||
    assert newBody != null;
 | 
			
		||||
 | 
			
		||||
    final Element tableElem = DOM.getParent(oldBody);
 | 
			
		||||
    DOM.removeChild(tableElem, oldBody);
 | 
			
		||||
    tableElem.removeChild(oldBody);
 | 
			
		||||
    setBodyElement(myTable, newBody);
 | 
			
		||||
    DOM.appendChild(tableElem, newBody);
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -55,7 +55,7 @@ public class Hyperlink extends com.google.gwt.user.client.ui.Hyperlink {
 | 
			
		||||
  @Override
 | 
			
		||||
  public void onBrowserEvent(final Event event) {
 | 
			
		||||
    if (DOM.eventGetType(event) == Event.ONCLICK && impl.handleAsClick(event)) {
 | 
			
		||||
      DOM.eventPreventDefault(event);
 | 
			
		||||
      event.preventDefault();
 | 
			
		||||
      go();
 | 
			
		||||
    } else {
 | 
			
		||||
      super.onBrowserEvent(event);
 | 
			
		||||
 
 | 
			
		||||
@@ -40,7 +40,7 @@ public class InlineHyperlink extends
 | 
			
		||||
  @Override
 | 
			
		||||
  public void onBrowserEvent(final Event event) {
 | 
			
		||||
    if (DOM.eventGetType(event) == Event.ONCLICK && impl.handleAsClick(event)) {
 | 
			
		||||
      DOM.eventPreventDefault(event);
 | 
			
		||||
      event.preventDefault();
 | 
			
		||||
      go();
 | 
			
		||||
    } else {
 | 
			
		||||
      super.onBrowserEvent(event);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user