Example usage for com.vaadin.ui CustomLayout addComponent

List of usage examples for com.vaadin.ui CustomLayout addComponent

Introduction

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

Prototype

public void addComponent(Component c, String location) 

Source Link

Document

Adds the component into this container to given location.

Usage

From source file:org.fossa.rolp.ui.schueler.SchuelerlisteAnzeigen.java

License:Open Source License

public SchuelerlisteAnzeigen(RolpApplication app) {
    super(app);//from   w  w  w.  j  a v a2  s  .  c o m
    this.app = app;
    this.klasseLaso = KlasseContainer.getKlasseByLehrer(app.getLoginLehrer());

    setCaption(" - Anzeige der Schlerliste - ");
    setWidth("800px");
    center();

    VerticalLayout layoutVertical = new VerticalLayout();
    setContent(layoutVertical);

    CustomLayout layout = new CustomLayout("./listeAnzeigen/listeAnzeigen");
    HorizontalLayout buttonBattery = new HorizontalLayout();
    buttonBattery.setSpacing(true);
    HorizontalLayout buttonBatteryBearbeiten = new HorizontalLayout();
    buttonBatteryBearbeiten.setSpacing(true);

    buttonBatteryBearbeiten.addComponent(schuelerHinzufuegenButton);
    schuelerHinzufuegenButton.setWidth("150px");
    buttonBatteryBearbeiten.addComponent(schuelerBearbeitenButton);
    schuelerBearbeitenButton.setWidth("150px");
    buttonBatteryBearbeiten.addComponent(schuelerEntfernenButton);
    schuelerEntfernenButton.setWidth("150px");

    layout.addComponent(buttonBatteryBearbeiten, "buttonBatteryBearbeiten");
    layout.addComponent(buttonBattery, "buttonBattery");

    layout.addComponent(windowCloseButton, "windowCloseButton");
    windowCloseButton.setWidth("100%");

    schuelerList = getSchuelerList();
    schuelerList.addStyleName("schuelerList");

    layoutVertical.addComponent(schuelerList);
    layoutVertical.addComponent(layout);
}

From source file:org.fossa.rolp.ui.schueler.SchuelerVerwalten.java

License:Open Source License

public SchuelerVerwalten(FossaApplication app, SchuelerLaso schueler) {
    super(app);//from  ww w  .j  a v a2  s.  co  m
    this.schuelerLaso = schueler;
    setCaption(" - Schlerdaten - ");
    setWidth("500px");
    center();
    CustomLayout layout = new CustomLayout("./subWindows/formAnlegen");
    setContent(layout);

    getSchuelerAnlegenForm();
    layout.addComponent(formSchuelerAnlegen, "form");
}

From source file:org.fossa.rolp.ui.schueler.versetzungsvermerk.VersetzungsvermerkBearbeiten.java

License:Open Source License

public VersetzungsvermerkBearbeiten(FossaApplication app, SchuelerLaso schueler) {
    super(app);//w w w.j  a  v  a 2  s.c  o m
    this.schuelerLaso = schueler;
    setCaption(" - Versetzungsvermerk - ");
    setWidth("500px");
    center();
    CustomLayout layout = new CustomLayout("./subWindows/formAnlegen");
    setContent(layout);

    getVersetzungsvermerkBearbeitenForm();
    layout.addComponent(formVersetzungsvermerkBearbeiten, "form");
}

From source file:org.fossa.rolp.ui.schueler.versetzungsvermerk.VersetzungsvermerklisteAnzeigen.java

License:Open Source License

public VersetzungsvermerklisteAnzeigen(RolpApplication app) {
    super(app);/*from w  w w .j  a  v  a 2  s  . co m*/
    this.app = app;
    this.klasseLaso = KlasseContainer.getKlasseByLehrer(app.getLoginLehrer());

    setCaption(" - Anzeige der Versetzungsvermerkliste - ");
    setWidth("800px");
    center();

    VerticalLayout layoutVertical = new VerticalLayout();
    setContent(layoutVertical);

    CustomLayout layout = new CustomLayout("./listeAnzeigen/listeAnzeigen");
    HorizontalLayout buttonBattery = new HorizontalLayout();
    buttonBattery.setSpacing(true);
    HorizontalLayout buttonBatteryBearbeiten = new HorizontalLayout();
    buttonBatteryBearbeiten.setSpacing(true);

    buttonBatteryBearbeiten.addComponent(versetzungsvermerkBearbeitennButton);
    versetzungsvermerkBearbeitennButton.setWidth("250px");

    layout.addComponent(buttonBatteryBearbeiten, "buttonBatteryBearbeiten");
    layout.addComponent(buttonBattery, "buttonBattery");

    layout.addComponent(windowCloseButton, "windowCloseButton");
    windowCloseButton.setWidth("100%");

    schuelerList = getSchuelerList();
    schuelerList.addStyleName("schuelerList");

    layoutVertical.addComponent(schuelerList);
    layoutVertical.addComponent(layout);
}

From source file:org.fossa.rolp.ui.zuordnung.fachschueler.FachschuelerlisteAnzeigen.java

License:Open Source License

public FachschuelerlisteAnzeigen(RolpApplication app, FachLaso fach, FachschuelerList fachschuelerListe) {
    super(app);//from   ww  w  .  j  a va  2  s.com
    this.app = app;
    this.fach = fach;
    this.fachschuelerList = fachschuelerListe;
    if (fach.getKlasse().equals(" - ")) {
        setCaption("Facheinschtzungen fr das Fach " + fach.getFachdefinition().getFachbezeichnung());
    } else {
        setCaption("Facheinschtzungen fr das Fach " + fach.getFachdefinition().getFachbezeichnung()
                + " in Klasse " + fach.getKlasse());
    }
    setWidth("550px");

    VerticalLayout layoutVertical = new VerticalLayout();
    setContent(layoutVertical);

    CustomLayout layout = new CustomLayout("./listeAnzeigen/listeAnzeigen");
    HorizontalLayout buttonBatteryBearbeiten = new HorizontalLayout();
    buttonBatteryBearbeiten.setSpacing(true);

    buttonBatteryBearbeiten.addComponent(facheinschaetzungSchreibenButton);
    facheinschaetzungSchreibenButton.setWidth("250px");
    buttonBatteryBearbeiten.addComponent(windowCloseButton);
    windowCloseButton.setWidth("250px");

    layout.addComponent(buttonBatteryBearbeiten, "buttonBatteryBearbeiten");

    fachschuelerList.addStyleName("schuelerList");

    layoutVertical.addComponent(fachschuelerList);
    layoutVertical.addComponent(layout);
}

From source file:org.fossa.rolp.ui.zuordnung.fachschueler.FachSchuelerZuordnen.java

License:Open Source License

public FachSchuelerZuordnen(RolpApplication app, FachSchuelerZuordnenList fachSchuelerZuordnenList,
        String caption) {/*from  w  ww.j a  v  a 2 s . c o  m*/
    super(app);
    setCaption(" - " + caption + " - ");
    setWidth("500px");
    center();

    VerticalLayout layoutVertical = new VerticalLayout();
    setContent(layoutVertical);

    CustomLayout layout = new CustomLayout("./listeAnzeigen/listeAnzeigen");
    HorizontalLayout buttonBattery = new HorizontalLayout();
    buttonBattery.setSpacing(true);
    HorizontalLayout buttonBatteryBearbeiten = new HorizontalLayout();
    buttonBatteryBearbeiten.setSpacing(true);

    layout.addComponent(buttonBatteryBearbeiten, "buttonBatteryBearbeiten");
    layout.addComponent(buttonBattery, "buttonBattery");

    layout.addComponent(windowCloseButton, "windowCloseButton");
    windowCloseButton.setWidth("100%");

    this.fachSchuelerZuordnenList = fachSchuelerZuordnenList;

    layoutVertical.addComponent(fachSchuelerZuordnenList);
    layoutVertical.addComponent(layout);
}

From source file:org.fossa.rolp.ui.zuordnung.fachschueler.SchuelerfachlisteAnzeigen.java

License:Open Source License

public SchuelerfachlisteAnzeigen(RolpApplication app, SchuelerfachList schuelerfachList) {
    super(app);//  w  w  w . jav  a 2s  . c  o m
    this.app = app;
    this.schuelerfachList = schuelerfachList;
    setWidth("550px");

    VerticalLayout layoutVertical = new VerticalLayout();
    setContent(layoutVertical);

    CustomLayout layout = new CustomLayout("./listeAnzeigen/listeAnzeigen");
    HorizontalLayout buttonBatteryBearbeiten = new HorizontalLayout();
    buttonBatteryBearbeiten.setSpacing(true);

    buttonBatteryBearbeiten.addComponent(facheinschaetzungBearbeitenButton);
    facheinschaetzungBearbeitenButton.setWidth("250px");

    buttonBatteryBearbeiten.addComponent(windowCloseButton);
    windowCloseButton.setWidth("250px");

    layout.addComponent(buttonBatteryBearbeiten, "buttonBatteryBearbeiten");

    schuelerfachList.addStyleName("schuelerList");

    layoutVertical.addComponent(schuelerfachList);
    layoutVertical.addComponent(layout);
}

From source file:org.fossa.vaadin.auth.ui.FossaLoginScreen.java

License:Open Source License

public FossaLoginScreen(FossaApplication app, FossaAuthorizer authorizer, String error) {
    super(app);/*from   www  .j av  a 2s  . c  om*/
    setStyleName("login");

    this.authorizer = authorizer;
    setCaption("Bitte melden Sie sich an!");
    setWidth("500px");
    center();
    CustomLayout layout = new CustomLayout("./login/loginScreen");
    setContent(layout);

    Label errorlabel = new Label(error);
    formLoginScreen = new Form();

    formLoginScreen.addField(username, username);
    username.focus();
    formLoginScreen.addField(password, password);
    formLoginScreen.getField(username).setRequired(true);
    formLoginScreen.getField(password).setRequired(true);

    layout.addComponent(formLoginScreen, "form");
    layout.addComponent(errorlabel, "errorlabel");

    Button login = new Button("Anmelden");
    layout.addComponent(login, "login");
    login.addListener((Button.ClickListener) this);
    login.setClickShortcut(KeyCode.ENTER);

}

From source file:org.metawidget.example.vaadin.addressbook.ContactDialog.java

License:BSD License

public ContactDialog(AddressBook addressBook, final Contact contact) {

    mAddressBook = addressBook;// ww w.j a  v a2s.  c  o m

    setHeight("600px");
    setWidth("800px");
    ((Layout) getContent()).setMargin(false);

    CustomLayout body = new CustomLayout("contact");
    addComponent(body);

    // Bundle

    ResourceBundle bundle = ResourceBundle
            .getBundle("org.metawidget.example.shared.addressbook.resource.Resources");

    // Title

    StringBuilder builder = new StringBuilder(contact.getFullname());

    if (builder.length() > 0) {
        builder.append(" - ");
    }

    // Personal/business icon

    if (contact instanceof PersonalContact) {
        builder.append(bundle.getString("personalContact"));
        body.addComponent(new Embedded(null, new ThemeResource("../addressbook/img/personal.gif")), "icon");
    } else {
        builder.append(bundle.getString("businessContact"));
        body.addComponent(new Embedded(null, new ThemeResource("../addressbook/img/business.gif")), "icon");
    }

    setCaption(builder.toString());

    // Metawidget

    mContactMetawidget = new VaadinMetawidget();
    mContactMetawidget.setWidth("100%");
    mContactMetawidget.setConfig("org/metawidget/example/vaadin/addressbook/metawidget.xml");
    mContactMetawidget.setReadOnly(contact.getId() != 0);
    mContactMetawidget.setToInspect(contact);

    // Communications override

    final TableDataSource<Communication> tableDataSource = new TableDataSource<Communication>(
            Communication.class, contact.getCommunications(), "type", "value");
    mCommunicationsTable = new Table();
    mCommunicationsTable.setWidth("100%");
    mCommunicationsTable.setHeight("170px");

    final Button deleteButton = new Button("Delete");
    deleteButton.setEnabled(false);
    deleteButton.addListener(new ClickListener() {

        @SuppressWarnings("unchecked")
        public void buttonClick(ClickEvent event) {

            Communication communication = tableDataSource.getDataRow(mCommunicationsTable.getValue());
            contact.removeCommunication(communication);

            ((TableDataSource<Communication>) mCommunicationsTable.getContainerDataSource())
                    .importCollection(contact.getCommunications());
        }
    });

    Button addNewButton = new Button("Add");
    addNewButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {

            mCommunicationsTable.setValue(null);
            deleteButton.setEnabled(false);

            CommunicationDialog communicationDialog = new CommunicationDialog(ContactDialog.this,
                    new Communication());
            communicationDialog.setModal(true);
            getParent().addWindow(communicationDialog);
        }
    });

    mCommunicationsTable.setSelectable(false);
    mCommunicationsTable.addListener(new ItemClickListener() {

        public void itemClick(ItemClickEvent event) {

            if (!mCommunicationsTable.isSelectable()) {
                return;
            }

            if (!event.isDoubleClick()) {
                deleteButton.setEnabled(true);
                return;
            }

            deleteButton.setEnabled(false);

            Communication communication = tableDataSource.getDataRow(event.getItemId());
            CommunicationDialog communicationDialog = new CommunicationDialog(ContactDialog.this,
                    communication);
            communicationDialog.setModal(true);
            getParent().addWindow(communicationDialog);
        }
    });

    mCommunicationsButtons = new com.vaadin.ui.HorizontalLayout();
    mCommunicationsButtons.setVisible(!mContactMetawidget.isReadOnly());
    mCommunicationsButtons.setMargin(false);
    mCommunicationsButtons.setSpacing(true);
    mCommunicationsButtons.addComponent(addNewButton);
    mCommunicationsButtons.addComponent(deleteButton);

    VerticalLayout wrapper = new VerticalLayout();
    wrapper.setData("communications");
    wrapper.addComponent(mCommunicationsTable);
    wrapper.addComponent(mCommunicationsButtons);
    wrapper.setComponentAlignment(mCommunicationsButtons, Alignment.MIDDLE_CENTER);
    mContactMetawidget.addComponent(wrapper);

    mCommunicationsTable.setContainerDataSource(tableDataSource);
    body.addComponent(mContactMetawidget, "pagebody");

    // Embedded buttons

    Facet facetButtons = new Facet();
    facetButtons.setData("buttons");
    facetButtons.setWidth("100%");
    mContactMetawidget.addComponent(facetButtons);

    mButtonsMetawidget = new VaadinMetawidget();
    mButtonsMetawidget.setWidth(null);
    mButtonsMetawidget.setConfig("org/metawidget/example/vaadin/addressbook/metawidget.xml");
    mButtonsMetawidget.setLayout(new HorizontalLayout());
    mButtonsMetawidget.setToInspect(this);
    facetButtons.addComponent(mButtonsMetawidget);
    ((com.vaadin.ui.VerticalLayout) facetButtons.getContent()).setComponentAlignment(mButtonsMetawidget,
            Alignment.MIDDLE_CENTER);
}