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


Java HorizontalLayout.addComponents方法代碼示例

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


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

示例1: getButtons

import com.vaadin.ui.HorizontalLayout; //導入方法依賴的package包/類
private HorizontalLayout getButtons(Component... components) {
	Button backButton = new Button("Go Back", VaadinIcons.BACKSPACE_A);
	backButton.setId("back-btn");
	backButton.addClickListener(e -> getUI().getNavigator().navigateTo(PersephoneViews.APPLICATIONS));

	HorizontalLayout layout = new HorizontalLayout();
	layout.addComponent(backButton);
	layout.addComponents(components);
	return layout;
}
 
開發者ID:vianneyfaivre,項目名稱:Persephone,代碼行數:11,代碼來源:PageHeader.java

示例2: addVoltronCommandsControls

import com.vaadin.ui.HorizontalLayout; //導入方法依賴的package包/類
private void addVoltronCommandsControls() {
  serverControls = new GridLayout();
  serverControls.setWidth(50, Unit.PERCENTAGE);
  voltronControlLayout.addComponentsAndExpand(serverControls);

  HorizontalLayout row1 = new HorizontalLayout();

  Button clusterStartBtn = new Button();
  clusterStartBtn.setCaption("Start all servers");
  clusterStartBtn.addStyleName("align-bottom");
  clusterStartBtn.addClickListener(event -> {
    for (Component child : serverControls) {
      if (child instanceof Button && "START".equals(child.getCaption()) && child.isEnabled()) {
        ((Button) child).click();
      }
    }
  });
  row1.addComponents(clusterStartBtn);

  if (kitAwareClassLoaderDelegator.isEEKit()) {
    clusterNameTF = new TextField();
    clusterNameTF.setCaption("Cluster name");
    clusterNameTF.setValue("MyCluster");

    Button clusterConfigBtn = new Button();
    clusterConfigBtn.addStyleName("align-bottom");
    clusterConfigBtn.setCaption("Configure");
    clusterConfigBtn.setData("configure");
    clusterConfigBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterReConfigBtn = new Button();
    clusterReConfigBtn.addStyleName("align-bottom");
    clusterReConfigBtn.setCaption("Reconfigure");
    clusterReConfigBtn.setData("reconfigure");
    clusterReConfigBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterBackupBtn = new Button();
    clusterBackupBtn.addStyleName("align-bottom");
    clusterBackupBtn.setCaption("Backup");
    clusterBackupBtn.setData("backup");
    clusterBackupBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterDumpBtn = new Button();
    clusterDumpBtn.addStyleName("align-bottom");
    clusterDumpBtn.setCaption("Dump");
    clusterDumpBtn.setData("dump");
    clusterDumpBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    Button clusterStopBtn = new Button();
    clusterStopBtn.addStyleName("align-bottom");
    clusterStopBtn.setCaption("Stop cluster");
    clusterStopBtn.setData("stop");
    clusterStopBtn.addClickListener((Button.ClickListener) this::executeClusterToolCommand);

    row1.addComponents(clusterNameTF, clusterConfigBtn, clusterReConfigBtn, clusterBackupBtn, clusterDumpBtn, clusterStopBtn);
  }

  voltronControlLayout.addComponentsAndExpand(row1);

  consoles = new TabSheet();
  mainConsole = addConsole("Main", "main");
  voltronControlLayout.addComponentsAndExpand(consoles);
}
 
開發者ID:Terracotta-OSS,項目名稱:tinypounder,代碼行數:64,代碼來源:TinyPounderMainUI.java


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