Java Code Examples for com.google.gwt.user.client.ui.HTMLPanel#addStyleName()

The following examples show how to use com.google.gwt.user.client.ui.HTMLPanel#addStyleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ContentBox.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ContentBox(final String id, final String title, final SafeHtml body, final String linkTitle,
                  final String linkTarget) {

    dp = new DisclosurePanel();
    dp.setHeader(new HTML(TEMPLATES.header(IdHelper.asId(id + "_", getClass(), "_" + "header"), title)));
    dp.addOpenHandler(this);
    dp.addCloseHandler(this);
    dp.setOpen(true);

    String linkId = IdHelper.asId(id + "_", getClass(), "_" + "link");
    HTMLPanel panel = new HTMLPanel(TEMPLATES.body(body, linkId));
    panel.addStyleName("homepage-content-box-body");
    InlineHyperlink hyperlink = new InlineHyperlink(linkTitle, linkTarget);
    hyperlink.addStyleName("homepage-link");
    panel.add(hyperlink, linkId);
    dp.add(panel);

    initWidget(dp);
    setStyleName("homepage-content-box");
}
 
Example 2
Source File: ContentBox.java    From core with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ContentBox(final String id, final String title, final SafeHtml body, Widget widget) {

        dp = new DisclosurePanel();
        dp.setHeader(new HTML(TEMPLATES.header(IdHelper.asId(id + "_", getClass(), "_" + "header"), title)));
        dp.addOpenHandler(this);
        dp.addCloseHandler(this);
        dp.setOpen(true);

        String linkId = HTMLPanel.createUniqueId();
        HTMLPanel panel = new HTMLPanel(TEMPLATES.body(body, linkId));
        panel.addStyleName("homepage-content-box-body");
        panel.add(widget, linkId);
        dp.add(panel);

        initWidget(dp);
        setStyleName("homepage-content-box");
    }
 
Example 3
Source File: MaterialInfo.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
public void showInfo(HTMLPanel panel, ImageResource resource, String message) {
    panel.clear();

    HTMLPanel container = new HTMLPanel("");
    container.addStyleName(CssName.MATERIAL_INFO);
    container.add(new Image(resource));
    container.add(new Label(message));
    panel.add(container);
}
 
Example 4
Source File: InfoPanel.java    From geomajas-gwt2-quickstart-application with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Init the info panel.
 */
private void initInfoPanel() {

	infoPopupPanel.addStyleName(ApplicationResource.INSTANCE.css().infoPopupPanel());

	HTMLPanel infoPopupPanelWrapper = new HTMLPanel("");

	closeInfoPopupPanelButton.addStyleName(ApplicationResource.INSTANCE.css().closePopupPanelButton());
	closeInfoPopupPanelButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			infoPopupPanel.hide();
			ApplicationService.getInstance().setTooltipShowingAllowed(true);
		}
	});

	HTMLPanel closeInfoButtonContainer = new HTMLPanel("");
	closeInfoButtonContainer.addStyleName(ApplicationResource.INSTANCE.css().popupPanelHeader());
	Label infoTitle = new Label(msg.infoPanelTitle());
	closeInfoButtonContainer.add(infoTitle);
	closeInfoButtonContainer.add(closeInfoPopupPanelButton);
	infoPopupPanelWrapper.add(closeInfoButtonContainer);

	infoPopupPanelContent = new HTMLPanel("");
	infoPopupPanelContent.addStyleName(ApplicationResource.INSTANCE.css().infoPopupPanelContent());

	ScrollPanel infoPopupPanelScroll = new ScrollPanel();
	infoPopupPanelScroll.addStyleName(ApplicationResource.INSTANCE.css().infoPopupPanelScroll());
	infoPopupPanelScroll.add(infoPopupPanelContent);

	infoPopupPanelWrapper.add(infoPopupPanelScroll);

	infoPopupPanel.add(infoPopupPanelWrapper);

	infoPopupPanel.hide();
}
 
Example 5
Source File: LayerLegend.java    From geomajas-gwt2-quickstart-application with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Init the layer legend panel.
 */
private void initLayerLegend() {

		HTMLPanel layerPopupPanelWrapper = new HTMLPanel("");

		closeLayerPopupPanelButton.addStyleName(ApplicationResource.INSTANCE.css().closePopupPanelButton());
		closeLayerPopupPanelButton.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				layerLegendPanel.hide();
				ApplicationService.getInstance().setTooltipShowingAllowed(true);
			}
		});

		HTMLPanel closeLayerButtonContainer = new HTMLPanel("");
		closeLayerButtonContainer.addStyleName(ApplicationResource.INSTANCE.css().popupPanelHeader());
		Label layerTitle = new Label(msg.layerLegendPanelTitle());
		closeLayerButtonContainer.add(layerTitle);
		closeLayerButtonContainer.add(closeLayerPopupPanelButton);
		layerPopupPanelWrapper.add(closeLayerButtonContainer);

		HTMLPanel layerPopupPanelContent = new HTMLPanel("");
		layerPopupPanelContent.addStyleName(ApplicationResource.INSTANCE.css().layerPopupPanelContent());

		// Add a generated layers legend.
		layerPopupPanelWrapper.add(
				getLayersLegend(layerPopupPanelContent, mapPresenter.getLayersModel())
		);

		layerLegendPanel.add(layerPopupPanelWrapper);

}