本文整理匯總了Java中com.vaadin.ui.HorizontalLayout.setStyleName方法的典型用法代碼示例。如果您正苦於以下問題:Java HorizontalLayout.setStyleName方法的具體用法?Java HorizontalLayout.setStyleName怎麽用?Java HorizontalLayout.setStyleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.HorizontalLayout
的用法示例。
在下文中一共展示了HorizontalLayout.setStyleName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: buildMainLayout
import com.vaadin.ui.HorizontalLayout; //導入方法依賴的package包/類
private Component buildMainLayout() {
// top-level component properties
setWidth("100.0%");
setHeight("-1px");
setStyleName(StyleConstants.PAGE_INFO_COMPONENT_COMMON);
// infoLabel
this.titleLabel = new Label();
initializeLabel(this.titleLabel);
final Button collapseButton = new Button();
collapseButton.setStyleName(Reindeer.BUTTON_LINK);
collapseButton.setIcon(new ThemeResource(StyleConstants.EXPAND_IMAGE));
collapseButton.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
PageInformationComponent.this.contentLabel.setVisible(!PageInformationComponent.this.contentLabel
.isVisible());
if (PageInformationComponent.this.contentLabel.isVisible()) {
collapseButton.setIcon(new ThemeResource(StyleConstants.COLLAPSE_IMAGE));
} else {
collapseButton.setIcon(new ThemeResource(StyleConstants.EXPAND_IMAGE));
}
}
});
HorizontalLayout titleLayout = new HorizontalLayout();
initializeLayout(titleLayout);
titleLayout.setStyleName(StyleConstants.PAGE_INFO_TITLE_LAYOUT);
titleLayout.addComponent(this.titleLabel);
titleLayout.addComponent(collapseButton);
titleLayout.setExpandRatio(this.titleLabel, 1.0f);
this.contentLabel = new Label();
initializeLabel(this.contentLabel);
this.contentLabel.setVisible(false);
this.contentLabel.setStyleName(StyleConstants.PAGE_INFO_CONTENT_LABEL);
this.contentLabel.setContentMode(ContentMode.HTML);
VerticalLayout mainLayout = new VerticalLayout();
initializeLayout(mainLayout);
mainLayout.addComponent(titleLayout);
mainLayout.addComponent(this.contentLabel);
return mainLayout;
}