本文整理匯總了Java中com.google.gwt.user.client.ui.HTMLPanel.addStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java HTMLPanel.addStyleName方法的具體用法?Java HTMLPanel.addStyleName怎麽用?Java HTMLPanel.addStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.HTMLPanel
的用法示例。
在下文中一共展示了HTMLPanel.addStyleName方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: showInfo
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
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);
}
示例2: onLoad
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
@Override
public void onLoad (PreloadedImage image) {
image.addStyleName("img-rounded");
image.addStyleName("col-xs-" + (int) (12 / IMAGES_PER_ROW));
if ((resources.size() - 1) % IMAGES_PER_ROW == 0) {
currentResourceRow = new HTMLPanel(
SafeHtmlUtils.EMPTY_SAFE_HTML);
currentResourceRow.addStyleName("row");
pnlImagePreviews.add(currentResourceRow);
}
currentResourceRow.add(image);
}
示例3: initInfoPanel
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
/**
* 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();
}
示例4: initLayerLegend
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
/**
* 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);
}
示例5: showError
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public static void showError (HTMLPanel pnl, HTMLPanel note, String error) {
pnl.addStyleName(HAS_ERROR_STYLE);
note.getElement().setInnerHTML(error);
note.setVisible(true);
}
示例6: DonationViewImpl
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public DonationViewImpl(DonationViewPresenter presenter) {
this.presenter = presenter;
DonationTemplate templates = GWT.create(DonationTemplate.class);
mainContainer = new HtmlLayoutContainer(templates.getTemplate());
btcAddressLabel = new Label("BTC: " + DEFAULT_BTC_ADDRESS);
ImageTip tip = new ImageTip(btcAddressLabel, ClientResources.INSTANCE.donateQRCode());
tip.setClosable(true);
tip.setAnchor(ImageTip.Anchor.BOTTOM_LEFT);
tip.setBottomOffset(-50);
tip.setShowDelay(700);
donationProgressLabel = new Label("Current month donations (used for the server rent): ");
notAvailablePanel = new HTMLPanel("Not Available.");
notAvailablePanel.addStyleName("notAvailableLabel");
progressBar = new ProgressBar(new ProgressBarCell() {
private Set<String> consumedEvents = new HashSet<String>();
public Set<String> getConsumedEvents() {
Set<String> superEvents = super.getConsumedEvents();
if (superEvents != null) {
consumedEvents.addAll(superEvents);
}
return consumedEvents;
}
});
progressBar.setIncrement(100);
tooltipConfig = new ToolTipConfig();
tooltipConfig.setHideDelay(1000);
tooltipConfig.setDismissDelay(0);
progressBar.setToolTipConfig(tooltipConfig);
contactAnchor = new Anchor();
contactAnchor.setText("Contact");
contactAnchor.setHref("https://bitcointalk.org/index.php?action=profile;u=214653");
contactAnchor.setTarget("_blank");
openStratehmTwitterTimelineButton = new TextButton("Open timeline @Stratehm");
openStratehmTwitterTimelineButton.setIcon(ClientResources.INSTANCE.twitterBlue());
openStratehmTwitterTimelineButton.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
openStratehmTwitterWindow();
}
});
mainContainer.add(btcAddressLabel, new HtmlData(".donationLabel"));
mainContainer.add(donationProgressLabel, new HtmlData(".donationProgressLabel"));
mainContainer.add(notAvailablePanel, new HtmlData(".donationProgressBar"));
mainContainer.add(openStratehmTwitterTimelineButton, new HtmlData(".twitterButton"));
mainContainer.add(contactAnchor, new HtmlData(".contactAnchor"));
}
示例7: BattleModeDialog
import com.google.gwt.user.client.ui.HTMLPanel; //導入方法依賴的package包/類
public BattleModeDialog(int playerFleetId, int enemyFleetId, boolean bombing) {
super("Combat", true, true, true);
this.playerFleetId = playerFleetId;
this.enemyFleetId = enemyFleetId;
this.bombing = bombing;
JSLabel titleLabel = new JSLabel("<span class=\"title\" style=\"font-size: 14px;\"> Mode de combat</span>");
// Description des modes de combat
HTMLPanel skirmishDescription = new HTMLPanel("<b unselectable=\"on\">Escarmouche :</b> exécute les 5 actions que vous avez défini pour le mode escarmouche, immobilise votre flotte 2h.");
skirmishDescription.setWidth("290px");
skirmishDescription.getElement().setAttribute("unselectable", "on");
skirmishDescription.addStyleName("justify");
skirmishDescription.getElement().getStyle().setProperty("padding", "5px");
OpenJWT.setElementFloat(skirmishDescription.getElement(), "left");
HTMLPanel battleDescription = new HTMLPanel("<b unselectable=\"on\">Bataille :</b> exécute les 15 actions que vous avez défini pour le mode bataille, immobilise votre flotte 4h.");
battleDescription.setWidth("290px");
battleDescription.getElement().setAttribute("unselectable", "on");
battleDescription.addStyleName("justify");
battleDescription.getElement().getStyle().setProperty("padding", "5px");
OpenJWT.setElementFloat(battleDescription.getElement(), "left");
// Choix du mode de combat
tacticsBt = new JSButton("Voir les options tactiques");
tacticsBt.setPixelWidth(220);
tacticsBt.addClickListener(this);
skirmishBt = new JSButton("Escarmouche");
skirmishBt.setPixelWidth(150);
skirmishBt.addClickListener(this);
battleBt = new JSButton("Bataille");
battleBt.setPixelWidth(150);
battleBt.addClickListener(this);
// Mise en forme des composants
JSRowLayout layout = new JSRowLayout();
layout.addRowSeparator(8);
layout.addComponent(titleLabel);
layout.addRowSeparator(12);
layout.addComponent(skirmishDescription);
layout.addRowSeparator(5);
layout.addComponent(battleDescription);
layout.addRowSeparator(10);
layout.setRowAlignment(JSRowLayout.ALIGN_CENTER);
layout.addComponent(tacticsBt);
layout.addRowSeparator(15);
layout.addComponent(skirmishBt);
layout.addComponent(battleBt);
layout.getElement().getStyle().setProperty("background",
"url('" + Config.getMediaUrl() + "images/misc/battle.png') 0 0 no-repeat");
setComponent(layout);
setDefaultCloseOperation(DESTROY_ON_CLOSE);
centerOnScreen();
}