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;
}
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;
}
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;
}
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);
}
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>");
}
Aggregations