當前位置: 首頁>>代碼示例>>Java>>正文


Java Button.setDescription方法代碼示例

本文整理匯總了Java中com.vaadin.ui.Button.setDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.setDescription方法的具體用法?Java Button.setDescription怎麽用?Java Button.setDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.Button的用法示例。


在下文中一共展示了Button.setDescription方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: buildToolbarButton

import com.vaadin.ui.Button; //導入方法依賴的package包/類
/**
 * @param toolbar
 *            HorizontalLayout which contains all the action Buttons
 * @param toolbarButton
 *            Which Tool bar button to create (Provided using ENUM constant)
 * @param listner
 *            Click listener called when this button is clicked
 * @return
 */

public static Button buildToolbarButton(HorizontalLayout toolbar, ToolbarButtons toolbarButton,
        ClickListener listner) {
    Button button = new Button(toolbarButton.getText());
    button.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    button.setDescription(toolbarButton.getTooltip());
    button.setStyleName(ValoTheme.BUTTON_LINK);
    if (StringUtils.isNotEmpty(toolbarButton.getImageLocation())) {
        button.setIcon(new ThemeResource(toolbarButton.getImageLocation()), toolbarButton.toString());
    }
    button.setEnabled(false);
    button.setId(toolbarButton.getId());
    button.addClickListener(listner);
    toolbar.addComponent(button);
    return button;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:26,代碼來源:ViewUtil.java

示例2: createHeader

import com.vaadin.ui.Button; //導入方法依賴的package包/類
@SuppressWarnings("serial")
private HorizontalLayout createHeader(String title) {
    HorizontalLayout header = ViewUtil.createSubHeader(title, getSubViewHelpGuid());
    Button refresh = new Button();
    refresh.setStyleName(Reindeer.BUTTON_LINK);
    refresh.setDescription("Refresh");
    refresh.setIcon(new ThemeResource("img/Refresh.png"));
    refresh.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            populateTable();
        }
    });
    header.addComponent(refresh);
    return header;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:CRUDBaseSubView.java

示例3: buildLogout

import com.vaadin.ui.Button; //導入方法依賴的package包/類
private Button buildLogout() {
    Button exit = new Button("Logout");
    exit.setDescription("Logout");
    exit.setWidth("100%");
    exit.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            getSession().setAttribute("user", null);
            for (UI ui : getSession().getUIs()) {
                ui.close();
            }
        }
    });
    return exit;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:16,代碼來源:MainUI.java

示例4: createHeader

import com.vaadin.ui.Button; //導入方法依賴的package包/類
@SuppressWarnings("serial")
private HorizontalLayout createHeader(String title, final boolean isChildTable) {

    HorizontalLayout header = null;
    if (isChildTable) {
        header = ViewUtil.createSubHeader(title, getChildHelpGuid());
    } else {
        header = ViewUtil.createSubHeader(title, getParentHelpGuid());
    }

    Button refresh = new Button();
    refresh.setStyleName(Reindeer.BUTTON_LINK);
    refresh.setDescription("Refresh");
    refresh.setIcon(new ThemeResource("img/Refresh.png"));
    refresh.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            if (isChildTable) {
                populateChildTable(getParentItem());
            } else {
                populateParentTable();
            }
        }
    });
    header.addComponent(refresh);
    return header;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:28,代碼來源:CRUDBaseView.java

示例5: createHeaderForSslList

import com.vaadin.ui.Button; //導入方法依賴的package包/類
private HorizontalLayout createHeaderForSslList() {
    HorizontalLayout header = ViewUtil.createSubHeader("List of available certificates", null);

    Button refresh = new Button();
    refresh.setStyleName(Reindeer.BUTTON_LINK);
    refresh.setDescription("Refresh");
    refresh.setIcon(new ThemeResource("img/Refresh.png"));
    refresh.addClickListener((Button.ClickListener) event -> buildSslConfigurationTable());
    header.addComponent(refresh);
    return header;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:12,代碼來源:SslConfigurationLayout.java

示例6: 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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:36,代碼來源:ViewUtil.java

示例7: 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);
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:55,代碼來源:MainUI.java


注:本文中的com.vaadin.ui.Button.setDescription方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。