Example #1
0
 @Override
 public Component createContents() {
   VerticalSplitPanel split = new VerticalSplitPanel();
   split.setSizeFull();
   propertyToolArea = createToolArea();
   split.setFirstComponent(createMainArea());
   split.setSecondComponent(propertyToolArea);
   split.setSplitPosition(70);
   return split;
 }
  @Override
  protected void init(VaadinRequest request) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSizeFull();
    setContent(layout);

    HorizontalSplitPanel hPanel = new HorizontalSplitPanel();
    VerticalSplitPanel vPanel = new VerticalSplitPanel();
    Panel playerPanel = new Panel("Player");
    Panel roundsPanel = new Panel("Rounds");
    Panel matchesPanel = new Panel("Matches");
    Table playersTable = new Table("PlayersTable");
    playersTable.addContainerProperty("Id", Integer.class, null);
    playersTable.addContainerProperty("Name", String.class, null);
    playersTable.addContainerProperty("Score", Integer.class, null);
    playersTable.addContainerProperty("Handicap", Integer.class, null);
    Table roundsTable = new Table("RoundsTable");
    Table matchesTable = new Table("MatchesTable");
    playerPanel.setContent(playersTable);
    HorizontalLayout newPlayerLayout = new HorizontalLayout();
    TextField newPlayer = new TextField(null, "newPlayer");
    Button addPlayerButton = new Button("addPlayer");
    newPlayerLayout.addComponent(newPlayer);
    newPlayerLayout.addComponent(addPlayerButton);
    hPanel.addComponent(newPlayerLayout);
    roundsPanel.setContent(roundsTable);
    matchesPanel.setContent(matchesTable);

    VerticalLayout playerLayout = new VerticalLayout();
    playerLayout.addComponent(playerPanel);
    playerLayout.addComponent(newPlayerLayout);

    VerticalLayout roundsLayout = new VerticalLayout();
    roundsLayout.addComponent(roundsPanel);
    Button addRoundButton = new Button("addRound");
    roundsLayout.addComponent(roundsPanel);
    roundsLayout.addComponent(addRoundButton);

    layout.addComponent(hPanel);
    hPanel.setFirstComponent(playerLayout);
    hPanel.setSecondComponent(vPanel);
    vPanel.setFirstComponent(roundsLayout);
    vPanel.setSecondComponent(matchesPanel);
  }