示例#1
0
  @Override
  public void initUI() {

    this.setSizeFull();
    this.setSpacing(true);

    HorizontalSplitPanel hl = new HorizontalSplitPanel();
    hl.setSplitPosition(20, Unit.PERCENTAGE);
    hl.setSizeFull();
    hl.setLocked(false);
    hl.addStyleName(Runo.SPLITPANEL_SMALL);

    getProjectsList().setSizeFull();

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setSpacing(true);
    vl.setMargin(true);

    vl.addComponent(getDateSelector());
    vl.addComponent(getReportsComponent());
    vl.setExpandRatio(getReportsComponent(), 1.0f);

    hl.addComponent(getProjectsList());
    hl.addComponent(vl);

    this.addComponent(hl);
  }
  private HorizontalSplitPanel createBrowserPanel() {
    VerticalSplitPanel contentPanel = createContentPanel();

    HorizontalSplitPanel browserPanel = new HorizontalSplitPanel();
    browserPanel.setSplitPosition(30);
    browserPanel.addComponent(mTreeView);
    browserPanel.addComponent(contentPanel);

    browserPanel.setSizeFull();
    return browserPanel;
  }
  public BalanceSheetMain() {
    hsp = new HorizontalSplitPanel();
    hsp.setSplitPosition(12, Sizeable.UNITS_PERCENTAGE);
    hsp.setSizeFull();
    hsp.setLocked(true);
    addComponent(hsp);

    VerticalLayout vl = new VerticalLayout();
    vl.setSpacing(true);
    vl.setStyleName("side-panel");

    addNewBalanceSheet = new Button();
    addNewBalanceSheet.setStyleName(BaseTheme.BUTTON_LINK);
    addNewBalanceSheet.setIcon(IconManager.getIcon(IconManager.ADD_NEW_BALANCE_SHEET));
    addNewBalanceSheet.addListener(
        new Button.ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            AccountsApplication.getInstance()
                .getMainWindow()
                .addWindow(new CreateNewBalanceSheet());
          }
        });
    vl.addComponent(addNewBalanceSheet);
    vl.setComponentAlignment(addNewBalanceSheet, Alignment.MIDDLE_CENTER);

    closeBalanceSheet = new Button();
    closeBalanceSheet.setStyleName(BaseTheme.BUTTON_LINK);
    closeBalanceSheet.setIcon(IconManager.getIcon(IconManager.CLOSE_BALANCE_SHEET));
    closeBalanceSheet.addListener(
        new Button.ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            AccountsApplication.getInstance().getMainWindow().addWindow(new CloseBalanceSheet());
          }
        });
    vl.addComponent(closeBalanceSheet);
    vl.setComponentAlignment(closeBalanceSheet, Alignment.MIDDLE_CENTER);

    hsp.addComponent(vl);
    hsp.addComponent(generateMyBalanceSheetContent());

    hsp.setSizeFull();
    addComponent(hsp);
    setExpandRatio(hsp, 1);

    buildStringsFromLocale();
  }
  @AutoGenerated
  private HorizontalSplitPanel buildForgotTab() {
    // common part: create layout
    forgotTab = new HorizontalSplitPanel();
    forgotTab.setImmediate(false);
    forgotTab.setWidth("100.0%");
    forgotTab.setHeight("100.0%");
    forgotTab.setMargin(false);

    // verticalLayout_1
    verticalLayout_1 = buildVerticalLayout_1();
    forgotTab.addComponent(verticalLayout_1);

    // forgotUserNameDiv
    forgotUserNameDiv = buildForgotUserNameDiv();
    forgotTab.addComponent(forgotUserNameDiv);

    return forgotTab;
  }
  public LookAndFeelLayout(BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);
    addComponent(splitLayout);

    chartSplit.addComponent(chartContainer);
    chartSplit.addComponent(btnPreview);

    btnPreview.setIcon(FontAwesome.PLAY);
    chartSplit.setComponentAlignment(chartContainer, Alignment.MIDDLE_CENTER);
    chartSplit.setExpandRatio(chartContainer, 1f);

    chartSplit.setSizeFull();
    colourContainer.setSizeFull();

    splitLayout.setSizeFull();
    splitLayout.addComponent(chartSplit);
    splitLayout.setSplitPosition(70f);
    splitLayout.addComponent(colourContainer);

    bindHandlers();
  }
  /*
   * In this example layouts are programmed in Java. You may choose use a
   * visual editor, CSS or HTML templates for layout instead.
   */
  private void initLayout() {

    /* Root of the user interface component tree is set */
    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    setContent(splitPanel);

    /* Build the component tree */
    VerticalLayout leftLayout = new VerticalLayout();
    splitPanel.addComponent(leftLayout);
    splitPanel.addComponent(editorLayout);
    leftLayout.addComponent(contactList);
    HorizontalLayout bottomLeftLayout = new HorizontalLayout();
    leftLayout.addComponent(bottomLeftLayout);
    bottomLeftLayout.addComponent(searchField);
    bottomLeftLayout.addComponent(addNewContactButton);

    /* Set the contents in the left of the split panel to use all the space */
    leftLayout.setSizeFull();

    /*
     * On the left side, expand the size of the contactList so that it uses
     * all the space left after from bottomLeftLayout
     */
    leftLayout.setExpandRatio(contactList, 1);
    contactList.setSizeFull();

    /*
     * In the bottomLeftLayout, searchField takes all the width there is
     * after adding addNewContactButton. The height of the layout is defined
     * by the tallest component.
     */
    bottomLeftLayout.setWidth("100%");
    searchField.setWidth("100%");
    bottomLeftLayout.setExpandRatio(searchField, 1);

    /* Put a little margin around the fields in the right side editor */
    editorLayout.setMargin(true);
    editorLayout.setVisible(false);
  }
  @AutoGenerated
  private HorizontalSplitPanel buildProductSearchSplit() {
    // common part: create layout
    productSearchSplit = new HorizontalSplitPanel();
    productSearchSplit.setStyleName("productSearchSplit");
    productSearchSplit.setImmediate(false);
    productSearchSplit.setWidth("90%");
    productSearchSplit.setHeight("90%");
    productSearchSplit.setSplitPosition(70);

    productSearchSplit.addComponent(buildProductTable());

    return productSearchSplit;
  }
  @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);
  }
  public TradeTab() {
    HorizontalSplitPanel mainPanel = new HorizontalSplitPanel();
    mainPanel.setHeight("100%");

    VerticalLayout leftPanel = new VerticalLayout();
    leftPanel.setMargin(true);
    leftPanel.setSpacing(true);
    leftPanel.setHeight("100%");

    itemContainer.addContainerProperty("auction", AuctionService.class, null);
    itemContainer.addContainerProperty("id", String.class, null);
    itemContainer.addContainerProperty("description", String.class, null);
    itemContainer.addContainerProperty("startingPrice", Long.class, null);
    itemContainer.addContainerProperty("item", AuctionItem.class, null);

    itemTable.addStyleName("h1");
    //		itemTable.addStyleName("noheader");
    itemTable.setSelectable(true);
    itemTable.setImmediate(true);
    itemTable.setVisibleColumns(new String[] {"description", "startingPrice"});
    itemTable.setColumnHeaders(new String[] {"Description", "Starting Price"});
    itemTable.setSizeFull();

    itemTable.addListener(
        new Property.ValueChangeListener() {
          public void valueChange(ValueChangeEvent event) {
            Application application = getApplication();
            if (application instanceof UriFragmentService)
              ((UriFragmentService) application).setUriFragment(getCurrentUriFragment(), false);

            Object itemId = itemTable.getValue();
            AuctionItem item =
                itemId != null
                    ? (AuctionItem) itemTable.getContainerProperty(itemId, "item").getValue()
                    : null;
            for (Iterator<Component> iter = dynamicLayout.getComponentIterator();
                iter.hasNext(); ) {
              Component component = iter.next();
              if (component instanceof SelectionListener<?>) {
                ((SelectionListener<AuctionItem>) component).selectionChanged(item);
              }
            }
          }
        });

    leftPanel.addComponent(itemTable);
    leftPanel.setExpandRatio(itemTable, 1f);

    // Button panel
    VerticalLayout buttonBarLayout = new VerticalLayout();
    buttonBar = new DynamicContainer(buttonBarLayout);
    buttonBar.setWidth("100%");
    leftPanel.addComponent(buttonBar);

    // Progress Indicator (hidden)
    ProgressIndicator progress = new ProgressIndicator(ProgressIndicator.SIZE_UNDEFINED);
    progress.addStyleName("hidden");
    progress.setPollingInterval(POLL_INTERVAL);
    leftPanel.addComponent(progress);
    leftPanel.setExpandRatio(progress, 0f);

    mainPanel.addComponent(leftPanel);
    mainPanel.addComponent(container);

    Table table = new Table();
    table.setSizeFull();

    setCompositionRoot(mainPanel);
    setCaption("Trade");
    setSizeFull();
  }
示例#10
0
  public TreeTableOrganization() {
    setSizeFull();
    treetable = new TreeTable();
    treetable.setSizeFull();
    treetable.setSelectable(true);
    treetable.setMultiSelect(false);
    treetable.addListener(this);
    treetable.setImmediate(true);
    treetable.setValue(null);
    setMargin(true);
    // Add Table columns
    treetable.addContainerProperty(NAME_PROPERTY, String.class, "");

    fillTable(treetable);

    treetable.addListener(
        new ExpandListener() {

          private static final long serialVersionUID = 1L;

          public void nodeExpand(ExpandEvent event) {
            Object valuePropertyEvent = event.getItemId();
            Organization org =
                AdminServiceProvider.get().findOrganizationById((Long) valuePropertyEvent);
            Set<Organization> childs = org.getOrganizations();
            if (!(childs.isEmpty())) {
              treetable.setChildrenAllowed((Long) valuePropertyEvent, true);

              for (Organization o : childs) {
                treetable.addItem(new Object[] {o.getName()}, o.getId());
              }

              for (Organization o : childs) {
                treetable.setParent(o.getId(), (Long) valuePropertyEvent);
              }

              for (Organization o : childs) {
                treetable.setChildrenAllowed(o.getId(), !(o.getOrganizations().isEmpty()));
              }
            }
          }
        });

    treetable.addListener(
        new CollapseListener() {

          private static final long serialVersionUID = 1L;

          public void nodeCollapse(CollapseEvent event) {
            Set<Object> delete = new HashSet<Object>();
            Collection<?> children = treetable.getChildren(event.getItemId());
            if (children != null) {
              for (Object child : children) {
                removeRecursively(child, delete);
              }
            }
            for (Object o : delete) {
              treetable.setCollapsed(o, true);
              treetable.removeItem(o);
            }
          }

          private void removeRecursively(Object object, Set<Object> delete) {
            Collection<?> children = treetable.getChildren(object);
            if (children != null) {
              for (Object child : children) {
                removeRecursively(child, delete);
              }
            }
            delete.add(object);
          }
        });

    panel.setStyleName(Reindeer.PANEL_LIGHT);
    panel.setSizeFull();
    panel.addComponent(new ButtonCreateOrganization(treetable));

    final HorizontalSplitPanel horiz = new HorizontalSplitPanel();
    horiz.setSplitPosition(25); // percent
    horiz.setSizeFull();
    addComponent(horiz);
    horiz.addComponent(treetable);
    horiz.addComponent(panel);
  }