本文整理汇总了Java中com.vaadin.ui.HorizontalLayout.addStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalLayout.addStyleName方法的具体用法?Java HorizontalLayout.addStyleName怎么用?Java HorizontalLayout.addStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.HorizontalLayout
的用法示例。
在下文中一共展示了HorizontalLayout.addStyleName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractDialog
import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
/**
* Constructor
*/
public AbstractDialog() {
super();
// defaults
setModal(true);
setResizable(false);
setDraggable(false);
setClosable(false);
// style name
addStyleName("h-dialog");
// build
content = new Panel();
content.setWidth("100%");
content.addStyleName(ValoTheme.PANEL_BORDERLESS);
content.addStyleName("h-dialog-content");
actions = new HorizontalLayout();
actions.setWidth("100%");
actions.setSpacing(true);
actions.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
actions.addStyleName("h-dialog-actions");
root = new VerticalLayout();
root.addComponent(content);
root.addComponent(actions);
setContent(root);
}
示例2: createSubHeader
import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
/**
* @param caption
* Caption Text Representing Header
* @param guid
* Help GUID for caller view
* @return
* Horizontal Layout containing Caption text and Help button
*/
public static HorizontalLayout createSubHeader(String caption, String guid) {
HorizontalLayout subHeader = new HorizontalLayout();
subHeader.setWidth("100%");
subHeader.setHeight("35px");
subHeader.setSpacing(true);
subHeader.addStyleName("toolbar");
final Label title = new Label(caption);
title.setSizeUndefined();
subHeader.addComponent(title);
subHeader.setComponentAlignment(title, Alignment.MIDDLE_LEFT);
subHeader.setExpandRatio(title, 1);
// create help button if we have some GUID else do not add this button
if (guid != null) {
Button helpButton = new Button();
helpButton.setImmediate(true);
helpButton.setStyleName(Reindeer.BUTTON_LINK);
helpButton.setDescription("Help");
helpButton.setIcon(new ThemeResource("img/Help.png"));
subHeader.addComponent(helpButton);
helpButton.addClickListener(new HelpButtonListener(guid));
}
return subHeader;
}
示例3: RowLayout
import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
private RowLayout(Step step) {
this.step = step;
label = getLabelProvider().getStepLabel(step);
divider = new CssLayout();
divider.addStyleName(STYLE_DIVIDER);
divider.setHeight(100, Unit.PERCENTAGE);
contentContainer = new Panel();
contentContainer.addStyleName(STYLE_CONTENT_CONTAINER);
contentContainer.addStyleName(ValoTheme.PANEL_BORDERLESS);
contentContainer.setSizeFull();
buttonBar = new HorizontalLayout();
buttonBar.addStyleName(STYLE_BUTTON_BAR);
buttonBar.setMargin(false);
buttonBar.setSpacing(true);
buttonBar.setWidth(100, Unit.PERCENTAGE);
buttonBar.setMargin(new MarginInfo(false, false, !isLastStep(step), false));
rootLayout = new GridLayout(2, 3);
rootLayout.setSizeFull();
rootLayout.setMargin(false);
rootLayout.setSpacing(false);
rootLayout.setColumnExpandRatio(1, 1);
rootLayout.setRowExpandRatio(1, 1);
rootLayout.addComponent(label, 0, 0, 1, 0);
rootLayout.addComponent(divider, 0, 1, 0, 2);
rootLayout.addComponent(contentContainer, 1, 1, 1, 1);
rootLayout.addComponent(buttonBar, 1, 2, 1, 2);
setCompositionRoot(rootLayout);
addStyleName(STYLE_COMPONENT);
setWidth(100, Unit.PERCENTAGE);
setActive(false);
}
示例4: buildHeader
import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
private void buildHeader() {
this.header.addStyleName("branding");
this.header.addStyleName("header");
// product name and information
Label product = new Label(this.server.getProductName() + "<br> <span class='product-version'> Version: "
+ this.server.getVersionStr() + "</span>", ContentMode.HTML);
product.addStyleName("product-label");
product.setSizeUndefined();
HorizontalLayout brandingLayout = new HorizontalLayout();
brandingLayout.addStyleName("header-content");
brandingLayout.addComponent(new Image(null, new ThemeResource("img/logo.png")));
brandingLayout.addComponent(product);
// creating home help button
Button mainHelpButton = new Button();
mainHelpButton.setImmediate(true);
mainHelpButton.setStyleName(Reindeer.BUTTON_LINK);
mainHelpButton.setDescription("Help");
mainHelpButton.setIcon(new ThemeResource("img/headerHelp.png"));
mainHelpButton.addClickListener(new ClickListener() {
private String guid = "";
@Override
public void buttonClick(ClickEvent event) {
ViewUtil.showHelpBrowserWindow(this.guid);
}
});
HorizontalLayout helpLayout = new HorizontalLayout();
helpLayout.addComponent(mainHelpButton);
helpLayout.addStyleName("homeHelpButton");
// Adding current user to header
Label user = new Label("User: " + getCurrent().getSession().getAttribute("user").toString());
// header banner
HorizontalLayout userlayout = new HorizontalLayout();
userlayout.addStyleName("user");
userlayout.addComponent(user);
// create Logout button next to user
userlayout.addComponent(buildLogout());
// Adding help button to the user layout next to logout button
userlayout.addComponent(helpLayout);
this.header.setWidth("100%");
this.header.setHeight("65px");
this.header.addComponent(brandingLayout);
this.header.addComponent(userlayout);
this.header.setExpandRatio(brandingLayout, 1);
this.root.addComponent(this.header);
}
示例5: JobsArchiverPanel
import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
public JobsArchiverPanel(ArchiveLayout parentLayout, ArchiveServiceApi archiveService,
GetJobsArchiveServiceApi getJobsArchiveService, UpdateJobsArchiveServiceApi updateJobsArchiveService) {
super();
this.parentLayout = parentLayout;
this.archiveService = archiveService;
this.getJobsArchiveService = getJobsArchiveService;
this.updateJobsArchiveService = updateJobsArchiveService;
try {
this.dto = populateJobsArchiveDto().getDto();
// create frequency layout component
VerticalLayout freqLayout = new VerticalLayout();
freqLayout.addComponent(createLastTriggerLabel());
freqLayout.addComponent(createAutoSchedCheckBox());
freqLayout.addComponent(createFrequencyOptionGroup());
freqLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
freqLayout.setSpacing(true);
// create triggering panel component
Panel triggerPanel = new Panel();
triggerPanel.setWidth("50%");
triggerPanel.setContent(freqLayout);
// create threshold layout component
HorizontalLayout thresLayout = new HorizontalLayout();
thresLayout.addComponent(this.thresholdLabel);
thresLayout.addComponent(createArchiveThreshold());
thresLayout.addComponent(createThresholdOptionGroup());
thresLayout.addStyleName(StyleConstants.COMPONENT_SPACING);
thresLayout.setSpacing(true);
// add all components to container
this.container = new VerticalLayout();
this.container.addStyleName(StyleConstants.COMPONENT_SPACING);
this.container.addComponent(this.triggerLabel);
this.container.addComponent(triggerPanel);
this.container.addComponent(thresLayout);
// add buttons component to container
HorizontalLayout buttonLayout = new HorizontalLayout();
buttonLayout.addComponent(createOnDemandScheduleButton());
buttonLayout.addComponent(createUpdateScheduleButton());
buttonLayout.setSpacing(true);
this.container.addComponent(buttonLayout);
// add container to root panel
this.container.setSpacing(true);
this.panel.setWidth("100%");
this.panel.setContent(this.container);
setCompositionRoot(this.panel);
} catch (Exception ex) {
log.error("Failed to init archiver panel", ex);
}
}
示例6: NetworkLayout
import com.vaadin.ui.HorizontalLayout; //导入方法依赖的package包/类
public NetworkLayout(GetNetworkSettingsServiceApi getNetworkSettingsService,
CheckNetworkSettingsServiceApi checkNetworkSettingsService,
SetNetworkSettingsServiceApi setNetworkSettingsService,
GetNATSettingsServiceApi getNATSettingsService,
SetNATSettingsServiceApi setNATSettingsService,
ValidationApi validator, ServerApi server) {
super();
this.getNetworkSettingsService = getNetworkSettingsService;
this.checkNetworkSettingsService = checkNetworkSettingsService;
this.setNetworkSettingsService = setNetworkSettingsService;
this.getNATSettingsService = getNATSettingsService;
this.setNATSettingsService = setNATSettingsService;
this.server = server;
try {
// creating layout to hold option group and edit button
HorizontalLayout optionLayout = new HorizontalLayout();
optionLayout.addComponent(createIPSettingsEditButton());
optionLayout.addComponent(createOptionGroup());
optionLayout.addStyleName(StyleConstants.COMPONENT_SPACING_TOP_BOTTOM);
Panel networkPanel = new Panel("IP Details");
VerticalLayout networkLayout = new VerticalLayout();
networkLayout.addComponent(optionLayout);
this.networkTable = createNetworkTable();
networkLayout.addComponent(this.networkTable);
networkPanel.setContent(networkLayout);
Panel natPanel = new Panel("NAT Details");
VerticalLayout natLayout = new VerticalLayout();
HorizontalLayout editNatLayout = new HorizontalLayout();
editNatLayout.addStyleName(StyleConstants.COMPONENT_SPACING_TOP_BOTTOM);
editNatLayout.addComponent(createNATEditButton());
natLayout.addComponent(editNatLayout);
this.natTable = createNATTable();
natLayout.addComponent(this.natTable);
natLayout.addStyleName(StyleConstants.COMPONENT_SPACING_TOP_BOTTOM);
natPanel.setContent(natLayout);
// populating Network Information in the Table
populateNetworkTable();
// populating NAT information in the Table
populateNATTable();
addComponent(networkPanel);
addComponent(natPanel);
} catch (Exception ex) {
log.error("Failed to get network settings", ex);
}
}