overlayDiv.getStyle().setBackgroundColor("#000");
Document.get().getBody().appendChild(overlayDiv);
DOM.sinkEvents(overlayDiv, Event.ONCLICK);
DOM.setEventListener(overlayDiv, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONCLICK:
cleanUp(overlayDiv, dialog, onButton, offButton, closeButton);
break;
default:
break;
}
}
});
dialog.getStyle().setZIndex(1001);
dialog.getStyle().setPosition(Position.FIXED);
dialog.getStyle().setTop(20, Unit.PT);
dialog.getStyle().setLeft(20, Unit.PT);
dialog.getStyle().setBackgroundColor("white");
dialog.getStyle().setBorderColor("#ccc");
dialog.getStyle().setBorderStyle(BorderStyle.SOLID);
dialog.getStyle().setBorderWidth(4, Unit.PX);
dialog.getStyle().setPadding(1, Unit.EM);
Document.get().getBody().appendChild(dialog);
DOM.sinkEvents(onButton, Event.ONCLICK);
DOM.setEventListener(onButton, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
cleanUp(overlayDiv, dialog, onButton, offButton, closeButton);
devModeOn();
}
});
dialog.appendChild(onButton);
dialog.appendChild(DOM.createElement("br"));
dialog.appendChild(DOM.createElement("br"));
dialog.appendChild(DOM.createElement("br"));
DOM.sinkEvents(offButton, Event.ONCLICK);
DOM.setEventListener(offButton, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
cleanUp(overlayDiv, dialog, onButton, offButton, closeButton);
devModeOff();
}
});
dialog.appendChild(offButton);
dialog.appendChild(DOM.createElement("br"));
dialog.appendChild(DOM.createElement("br"));
dialog.appendChild(DOM.createElement("br"));
DOM.sinkEvents(closeButton, Event.ONCLICK);
DOM.setEventListener(closeButton, new EventListener() {
@Override
public void onBrowserEvent(Event event) {
cleanUp(overlayDiv, dialog, onButton, offButton, closeButton);