本文整理汇总了Java中com.vaadin.ui.Button.setImmediate方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setImmediate方法的具体用法?Java Button.setImmediate怎么用?Java Button.setImmediate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Button
的用法示例。
在下文中一共展示了Button.setImmediate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSubHeader
import com.vaadin.ui.Button; //导入方法依赖的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;
}
示例2: buildHeader
import com.vaadin.ui.Button; //导入方法依赖的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);
}