Example usage for com.vaadin.ui HorizontalLayout HorizontalLayout

List of usage examples for com.vaadin.ui HorizontalLayout HorizontalLayout

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalLayout HorizontalLayout.

Prototype

public HorizontalLayout() 

Source Link

Document

Constructs an empty HorizontalLayout.

Usage

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getTimeView(SettingTime sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());/* w ww .  j  av  a  2 s. c o m*/
    box.addComponent(label);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getStringArrayView(SettingStringArray sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());//from  ww  w . j  a  v a  2 s. c  om
    box.addComponent(label);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getIntArrayView(SettingIntArray sB, int backgroundChanger) {
    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());//from   www .j a  va  2  s  .  co  m
    box.addComponent(label);

    return box;
}

From source file:cb_server.SettingsWindow.java

License:Open Source License

private Component getBoolView(SettingBool sB, int backgroundChanger) {

    com.vaadin.ui.HorizontalLayout box = new HorizontalLayout();
    com.vaadin.ui.Label label = new com.vaadin.ui.Label();
    label.setCaption(sB.getName());/* www  .  jav  a  2s  . com*/
    box.addComponent(label);

    return box;
}

From source file:ch.bfh.ti.soed.hs16.srs.green.view.MyUI.java

License:Open Source License

/**
 * Method which actually creates the whole UI.
 *///from  w  w  w  . j  a v  a2  s.  co m
@Override
protected void init(VaadinRequest vaadinRequest) {

    VerticalLayout layout = new VerticalLayout();

    Panel panel = new Panel("Login");
    panel.setSizeUndefined();

    FormLayout content = new FormLayout();
    userName = new TextField("Username");
    content.addComponent(userName);

    PasswordField password = new PasswordField("Password");
    content.addComponent(password);

    Button login = new Button("Login");
    register = new Button("Register");
    CheckBox askBox = new CheckBox("Are you a Roommanager?");

    login.setStyleName(Reindeer.BUTTON_SMALL);
    login.setWidth("86px");

    register.setStyleName(Reindeer.BUTTON_SMALL);
    register.setWidth("86px");
    askBox.setStyleName(Reindeer.BUTTON_SMALL);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    hl.addComponent(login);
    hl.addComponent(register);
    hl.addComponent(askBox);

    content.addComponent(hl);
    content.setSizeUndefined();
    content.setMargin(true);

    panel.setContent(content);

    login.addClickListener(e -> {
        System.out.println(userName.getValue());
        System.out.println(password.getValue());
        try {
            if (controller.login(userName.getValue(), password.getValue())
                    || userName.equals(userName.getValue()) && password.equals(password.getValue())) {
                setContent(new ReservationUI());
            }
        } catch (Throwable e1) {
            e1.printStackTrace();
        }
    });

    register.addClickListener(e -> {
        try {
            Role x = askBox.getValue() ? Role.ROOMMANAGER : Role.CUSTOMER;
            controller.register(userName.getValue(), password.getValue(), x);
        } catch (Throwable e1) {
            e1.printStackTrace();
        }
    });

    layout.setMargin(true);
    layout.setSpacing(true);
    layout.addComponent(panel);
    setContent(layout);
}

From source file:ch.bfh.ti.soed.hs16.srs.red.ui.helper.Menu.java

License:Open Source License

public Menu(Navigator nav) {

    /*---------------------------------
    initalize Objects//ww w  .  j a  v a  2 s  . c  o m
    ---------------------------------*/
    this.navigator = nav;
    this.menu = new HorizontalLayout();
    this.myReservationButton = new Button("my reservation");

    /*-------------------------------
    add to css
    -------------------------------*/
    menu.setPrimaryStyleName(CLASSNAME);
    myReservationButton.setPrimaryStyleName(CLASSNAME + "-button");

    /*-------------------------------
    add Buttons to Layout
    --------------------------------*/
    menu.addComponent(myReservationButton);

    /*------------------------------
    Event Handling Buttons
    ------------------------------*/
    myReservationButton
            .addClickListener((Button.ClickListener) event -> navigator.navigateTo("my Reservation"));

}

From source file:ch.bfh.ti.soed.hs16.srs.view.views.helpers.Footer.java

License:Open Source License

public Footer(String enterprise, String city, String country) {

    /* init objects */
    this.footerLayout = new HorizontalLayout();
    StringBuilder stringBuilder = new StringBuilder();

    /* create String */
    stringBuilder.append(" 2015 by ");
    stringBuilder.append(enterprise);/*from w  w w . j  a v  a2  s  .c om*/
    stringBuilder.append(", ");
    stringBuilder.append(city);
    stringBuilder.append(", ");
    stringBuilder.append(country);

    /* add to textfield */
    this.txtFld = new Label(stringBuilder.toString());

    /* add components to layout */
    this.footerLayout.addComponent(this.txtFld);
}

From source file:ch.bfh.ti.soed.hs16.srs.view.views.helpers.Menu.java

License:Open Source License

public Menu(Navigator nav) {

    /* init objects */
    this.navigator = nav;
    this.layout = new HorizontalLayout();
    this.bookerBtn = new Button("booker");
    this.roomBtn = new Button("room");

    /* add to css */
    this.layout.setPrimaryStyleName(CLASSNAME);
    this.bookerBtn.setPrimaryStyleName(CLASSNAME + "-button");
    this.roomBtn.setPrimaryStyleName(CLASSNAME + "-button");

    /* add components to layout */
    this.layout.addComponent(roomBtn);
    this.layout.addComponent(bookerBtn);

    /* event handling */
    this.bookerBtn.addClickListener((Button.ClickListener) e -> navigator.navigateTo("BookerView"));
    this.roomBtn.addClickListener((Button.ClickListener) e -> navigator.navigateTo("RoomView"));

}

From source file:ch.bfh.ti.soed.hs16.srs.view.views.helpers.Template.java

License:Open Source License

public Template(Navigator nav) {

    /* init objects */
    // this.navigator = nav;
    this.layout = new HorizontalLayout();

    /* add to css */
    this.layout.setPrimaryStyleName(CLASSNAME);

    /* add components to layout */

    /* event handling */
}

From source file:ch.bfh.ti.soed.hs16.srs.white.view.AdminView.java

License:Open Source License

@Override
public Component load() {
    HorizontalLayout layout = new HorizontalLayout();
    UsersView usersView = new UsersView(this);
    RoomsView roomsView = new RoomsView(this);

    usersView.loadController();/* w w  w . j a v  a  2  s  .  c o m*/
    roomsView.loadController();

    VerticalMenu menuLayout = new VerticalMenu();
    menuLayout.setStyleName("menu-container");

    CustomMenuItem item1 = new CustomMenuItem("Users", "users");
    item1.addClickListener(event -> changeContent(usersView));

    CustomMenuItem item2 = new CustomMenuItem("Rooms", null);
    item2.addClickListener(event -> changeContent(roomsView));

    menuLayout.addMenuItem(item1);
    menuLayout.addMenuItem(item2);

    changeableContent = new VerticalLayout();
    changeContent(usersView);
    changeableContent.setStyleName("changeable-container");
    changeableContent.setResponsive(true);

    layout.addComponents(menuLayout, changeableContent);

    return layout;
}