private void addNavigation() {

    userLabel = new Label();
    userLabel.setSizeFull();
    HorizontalLayout informtaion = new HorizontalLayout();
    informtaion.addComponent(userLabel);

    HorizontalLayout navigation = new HorizontalLayout();
    navigation.addComponents(
        btnAdverts,
        btnLogin,
        btnRegistration,
        btnAdvertReg,
        btnMyAccout,
        btnAdminAccount,
        btnLogout);

    HorizontalLayout languages = new HorizontalLayout();
    languages.addComponents(btnHun, btnEng);

    HorizontalLayout headersplitter = new HorizontalLayout();
    headersplitter.addComponents(informtaion, navigation, languages);
    headersplitter.setWidth(i18Helper.getMessage("size_100"));
    headersplitter.setComponentAlignment(informtaion, Alignment.TOP_LEFT);
    headersplitter.setComponentAlignment(navigation, Alignment.TOP_CENTER);
    headersplitter.setComponentAlignment(languages, Alignment.TOP_RIGHT);

    header.addComponent(headersplitter);
    header.setComponentAlignment(headersplitter, Alignment.TOP_CENTER);
  }
 public AppLayout() {
   super();
   i18Helper = new I18Helper(AppBundle.currentBundle());
   loggedIn = i18Helper.getMessage("loggedIn");
   buildHeader();
   addListeners();
 }
 private void updateStrings() {
   btnAdverts.setCaption(i18Helper.getMessage("Adverts"));
   btnLogin.setCaption(i18Helper.getMessage("Login"));
   btnRegistration.setCaption(i18Helper.getMessage("Registration"));
   btnAdvertReg.setCaption(i18Helper.getMessage("AdvertRegistration"));
   btnMyAccout.setCaption(i18Helper.getMessage("Account"));
   btnLogout.setCaption(i18Helper.getMessage("Logout"));
   btnAdminAccount.setCaption(i18Helper.getMessage("AdminAccount"));
   loggedIn = i18Helper.getMessage("LoggedIn");
   reloadWindow();
 }
 private void addNavButtons() {
   btnAdverts = navButton(i18Helper.getMessage("Adverts"));
   btnLogin = navButton(i18Helper.getMessage("Login"));
   btnRegistration = navButton(i18Helper.getMessage("Registration"));
   btnAdvertReg = navButton(i18Helper.getMessage("AdvertRegistration"));
   btnMyAccout = navButton(i18Helper.getMessage("Account"));
   btnLogout = navButton(i18Helper.getMessage("Logout"));
   btnAdminAccount = navButton(i18Helper.getMessage("AdminAccount"));
   hidebuttons();
 }
  private void addEnglishButton() {
    btnEng = new Button(i18Helper.getMessage("locale_en"));
    btnEng.addClickListener(
        new Button.ClickListener() {

          @Override
          public void buttonClick(Button.ClickEvent event) {
            localeSetting(Global.Locale_EN);
            i18Helper = new I18Helper(AppBundle.currentBundle());
            updateStrings();
          }
        });
  }
  private void addHungarianButton() {
    btnHun = new Button(i18Helper.getMessage("locale_hu"));
    btnHun.addClickListener(
        new Button.ClickListener() {

          @Override
          public void buttonClick(Button.ClickEvent event) {
            localeSetting(Global.Locale_HU);
            i18Helper = new I18Helper(AppBundle.currentBundle());
            updateStrings();
          }
        });
  }