Search in sources :

Example 6 with HTMLPanel

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");
}
Also used : DivElement(com.google.gwt.dom.client.DivElement) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel) Test(org.junit.Test)

Example 7 with HTMLPanel

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);
}
Also used : Style(com.google.gwt.dom.client.Style) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel) AlarmControl(org.opennms.features.vaadin.nodemaps.internal.gwt.client.ui.controls.alarm.AlarmControl)

Example 8 with HTMLPanel

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);
}
Also used : HeaderPanel(com.gwtmobile.ui.client.widgets.HeaderPanel) Button(com.gwtmobile.ui.client.widgets.Button) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel) NativeEvent(com.google.gwt.dom.client.NativeEvent)

Aggregations

HTMLPanel (com.google.gwt.user.client.ui.HTMLPanel)8 Style (com.google.gwt.dom.client.Style)2 SafeHtmlBuilder (com.google.gwt.safehtml.shared.SafeHtmlBuilder)2 Test (org.junit.Test)2 DivElement (com.google.gwt.dom.client.DivElement)1 NativeEvent (com.google.gwt.dom.client.NativeEvent)1 UiBinder (com.google.gwt.uibinder.client.UiBinder)1 Label (com.google.gwt.user.client.ui.Label)1 RadioButton (com.google.gwt.user.client.ui.RadioButton)1 Button (com.gwtmobile.ui.client.widgets.Button)1 HeaderPanel (com.gwtmobile.ui.client.widgets.HeaderPanel)1 AlarmControl (org.opennms.features.vaadin.nodemaps.internal.gwt.client.ui.controls.alarm.AlarmControl)1 SearchControl (org.opennms.features.vaadin.nodemaps.internal.gwt.client.ui.controls.search.SearchControl)1 ShortcutInfo (org.rstudio.core.client.command.ShortcutInfo)1