Search in sources :

Example 1 with HTMLPanel

use of com.google.gwt.user.client.ui.HTMLPanel in project rstudio by rstudio.

the class ShortcutInfoPanel method getShortcutContent.

protected Widget getShortcutContent() {
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    List<ShortcutInfo> shortcuts = ShortcutManager.INSTANCE.getActiveShortcutInfo();
    String[][] groupNames = { new String[] { "Tabs", "Panes", "Files" }, new String[] { "Source Navigation", "Execute" }, new String[] { "Source Editor", "Debug" }, new String[] { "Source Control", "Build", "Console", "Terminal", "Other" } };
    int pctWidth = 100 / groupNames.length;
    sb.appendHtmlConstant("<table width='100%'><tr>");
    for (String[] colGroupNames : groupNames) {
        sb.appendHtmlConstant("<td width='" + pctWidth + "%'>");
        for (String colGroupName : colGroupNames) {
            sb.appendHtmlConstant("<h2>");
            sb.appendEscaped(colGroupName);
            sb.appendHtmlConstant("</h2><table>");
            for (int i = 0; i < shortcuts.size(); i++) {
                ShortcutInfo info = shortcuts.get(i);
                if (info.getDescription() == null || info.getShortcuts().size() == 0 || !info.getGroupName().equals(colGroupName)) {
                    continue;
                }
                sb.appendHtmlConstant("<tr><td><strong>");
                sb.appendHtmlConstant(StringUtil.joinStrings(info.getShortcuts(), ", "));
                sb.appendHtmlConstant("</strong></td><td>");
                sb.appendEscaped(info.getDescription());
                sb.appendHtmlConstant("</td></tr>");
            }
            sb.appendHtmlConstant("</table>");
            if (colGroupName == "Panes") {
                sb.appendHtmlConstant("<p>Add Shift to zoom (maximize) pane.</p>");
            }
        }
        sb.appendHtmlConstant("</td>");
    }
    sb.appendHtmlConstant("</td></tr></table>");
    HTMLPanel panel = new HTMLPanel(sb.toSafeHtml());
    return panel;
}
Also used : ShortcutInfo(org.rstudio.core.client.command.ShortcutInfo) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel)

Example 2 with HTMLPanel

use of com.google.gwt.user.client.ui.HTMLPanel in project rstudio by rstudio.

the class NewRMarkdownDialog method createFormatOption.

private Widget createFormatOption(String name, String description) {
    HTMLPanel formatWrapper = new HTMLPanel("");
    formatWrapper.setStyleName(style.outputFormat());
    SafeHtmlBuilder sb = new SafeHtmlBuilder();
    sb.appendHtmlConstant("<span class=\"" + style.outputFormatName() + "\">");
    sb.appendEscaped(name);
    sb.appendHtmlConstant("</span>");
    RadioButton button = new RadioButton("DefaultOutputFormat", sb.toSafeHtml().asString(), true);
    button.addStyleName(style.outputFormatChoice());
    formatOptions_.add(button);
    formatWrapper.add(button);
    Label label = new Label(description);
    label.setStyleName(style.outputFormatDetails());
    formatWrapper.add(label);
    return formatWrapper;
}
Also used : Label(com.google.gwt.user.client.ui.Label) RadioButton(com.google.gwt.user.client.ui.RadioButton) SafeHtmlBuilder(com.google.gwt.safehtml.shared.SafeHtmlBuilder) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel)

Example 3 with HTMLPanel

use of com.google.gwt.user.client.ui.HTMLPanel in project rstudio by rstudio.

the class SVNResolveDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    HTMLPanel widget = GWT.<Binder>create(Binder.class).createAndBindUi(this);
    inputElements_ = new InputElement[] { radioWorking_, radioMineConflict_, radioTheirsConflict_, radioMineAll_, radioTheirsAll_ };
    spanTargetNoun_.setInnerText(fileCount_ == 1 ? "path" : "paths");
    labelWorking_.setPropertyString("for", radioWorking_.getId());
    labelMineConflict_.setPropertyString("for", radioMineConflict_.getId());
    labelTheirsConflict_.setPropertyString("for", radioTheirsConflict_.getId());
    labelMineAll_.setPropertyString("for", radioMineAll_.getId());
    labelTheirsAll_.setPropertyString("for", radioTheirsAll_.getId());
    return widget;
}
Also used : UiBinder(com.google.gwt.uibinder.client.UiBinder) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel)

Example 4 with HTMLPanel

use of com.google.gwt.user.client.ui.HTMLPanel in project opennms by OpenNMS.

the class NodeMapWidget method addSearchControl.

private void addSearchControl() {
    LOG.info("NodeMapWidget.addSearchControl()");
    m_searchControl = new SearchControl(m_markerContainer, this, m_eventManager, m_componentTracker);
    final String id = m_searchControl.getElement().getId();
    if (id == null || "".equals(id)) {
        m_searchControl.getElement().setId("search-control");
    } else {
        LOG.info("NodeMapWidget.addSearchControl(): id = " + id);
    }
    final HTMLPanel mapParent = HTMLPanel.wrap(m_mapPanel.getParent().getElement());
    final Style searchStyle = m_searchControl.getElement().getStyle();
    searchStyle.setPosition(Position.ABSOLUTE);
    searchStyle.setTop(5, Unit.PX);
    searchStyle.setLeft(5, Unit.PX);
    searchStyle.setZIndex(1000);
    mapParent.add(m_searchControl);
}
Also used : Style(com.google.gwt.dom.client.Style) SearchControl(org.opennms.features.vaadin.nodemaps.internal.gwt.client.ui.controls.search.SearchControl) HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel)

Example 5 with HTMLPanel

use of com.google.gwt.user.client.ui.HTMLPanel in project gwt-test-utils by gwt-test-utils.

the class HTMLPanelTest method getInnerHTML.

@Test
public void getInnerHTML() {
    // Given
    HTMLPanel panel = new HTMLPanel("<p>you can <b>test</b><a href=\"somelink\">here</a> and everything will be different</p>");
    // When & Then
    assertThat(panel.getElement().getInnerHTML()).isEqualTo("<p>you can <b>test</b><a href=\"somelink\">here</a> and everything will be different</p>");
}
Also used : HTMLPanel(com.google.gwt.user.client.ui.HTMLPanel) Test(org.junit.Test)

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