示例#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);
  }
  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();
  }