use of com.google.gwt.user.client.ui.HTMLPanel in project gwt-test-utils by gwt-test-utils.
the class HTMLPanelTest method getElementById.
@Test
public void getElementById() {
// Given
HTMLPanel panel = new HTMLPanel("<div id=\"childDiv\" class=\"myClass\">some text</div>");
// When
DivElement childDiv = panel.getElementById("childDiv").cast();
// Then
assertThat(childDiv.getClassName()).isEqualTo("myClass");
assertThat(childDiv.getInnerText()).isEqualTo("some text");
}
use of com.google.gwt.user.client.ui.HTMLPanel in project opennms by OpenNMS.
the class NodeMapWidget method addAlarmControl.
private void addAlarmControl() {
LOG.info("NodeMapWidget.addAlarmControl()");
m_alarmControl = new AlarmControl(m_eventManager, m_componentTracker);
final String id = m_alarmControl.getElement().getId();
if (id == null || "".equals(id)) {
m_alarmControl.getElement().setId("alarm-control");
} else {
LOG.info("NodeMapWidget.addAlarmControl(): id = " + id);
}
final HTMLPanel mapParent = HTMLPanel.wrap(m_mapPanel.getParent().getElement());
final Style searchStyle = m_alarmControl.getElement().getStyle();
searchStyle.setPosition(Position.ABSOLUTE);
searchStyle.setTop(5, Unit.PX);
searchStyle.setRight(5, Unit.PX);
searchStyle.setZIndex(1000);
mapParent.add(m_alarmControl);
}
use of com.google.gwt.user.client.ui.HTMLPanel in project GwtMobile by dennisjzh.
the class KitchenSink method emulateClickOnBackButton.
protected void emulateClickOnBackButton() {
HTMLPanel current = (HTMLPanel) PageHistory.Instance.current().getWidget();
HeaderPanel header = (HeaderPanel) current.getWidget(0);
Button left = header.getLeftButton();
NativeEvent event = Document.get().createClickEvent(1, 1, 1, 1, 1, false, false, false, false);
left.getElement().dispatchEvent(event);
}
Aggregations