Java Code Examples for com.vaadin.ui.HorizontalLayout.addComponents()

The following are Jave code examples for showing how to use addComponents() of the com.vaadin.ui.HorizontalLayout class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Persephone   File: PageHeader.java   Source Code and License Vote up 5 votes
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;
}
 
Example 2
Project: tinypounder   File: TinyPounderMainUI.java   Source Code and License Vote up 4 votes
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);
}