Example usage for com.vaadin.ui Panel setContent

List of usage examples for com.vaadin.ui Panel setContent

Introduction

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

Prototype

@Override
public void setContent(Component content) 

Source Link

Document

Sets the content of this container.

Usage

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildLeftPanel() {
    // common part: create layout
    Panel leftPanel = new Panel();
    leftPanel.setImmediate(false);/*  w w  w .j  a v a  2 s  .co m*/
    leftPanel.setWidth("100.0%");
    leftPanel.setHeight("100.0%");

    // vlLeftPanel
    VerticalLayout vlLeftPanel = buildVlLeftPanel();
    leftPanel.setContent(vlLeftPanel);

    return leftPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildDirectMembersPanel() {
    // common part: create layout
    Panel directMembersPanel = new Panel();
    directMembersPanel.setImmediate(false);
    directMembersPanel.setWidth("100.0%");
    directMembersPanel.setHeight("100.0%");
    directMembersPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlDirectMember
    VerticalLayout vlDirectMember = new VerticalLayout();
    vlDirectMember.setImmediate(false);/*from   ww  w. j a v  a2  s  . c om*/
    vlDirectMember.setWidth("100.0%");
    vlDirectMember.setHeight("100.0%");
    vlDirectMember.setMargin(false);
    directMembersPanel.setContent(vlDirectMember);

    return directMembersPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildRightPanel() {
    // common part: create layout
    Panel rightPanel = new Panel();
    rightPanel.setImmediate(false);//w  ww  .  ja v a 2  s.  c o  m
    rightPanel.setWidth("100.0%");
    rightPanel.setHeight("100.0%");

    // vlRightPanel
    VerticalLayout vlRightPanel = buildVlRightPanel();
    rightPanel.setContent(vlRightPanel);

    return rightPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildResourcePropertiesPanel() {
    // common part: create layout
    Panel resourcePropertiesPanel = new Panel();
    resourcePropertiesPanel.setImmediate(false);
    resourcePropertiesPanel.setWidth("100.0%");
    resourcePropertiesPanel.setHeight("100%");
    resourcePropertiesPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlResourceProperties
    resourcePropertiesPanel.setContent(buildVlResourceProperties());

    return resourcePropertiesPanel;
}

From source file:org.escidoc.browser.controller.ContentModelView.java

License:Open Source License

private Panel buildBreadCrumpPanel() {
    // common part: create layout
    Panel breadCrumpPanel = new Panel();
    breadCrumpPanel.setImmediate(false);
    breadCrumpPanel.setWidth("100.0%");
    breadCrumpPanel.setHeight("30px");
    breadCrumpPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlBreadCrump
    VerticalLayout vlBreadCrump = new VerticalLayout();
    vlBreadCrump.setImmediate(false);/*from   w w w  . j  a v a 2  s.c  o m*/
    vlBreadCrump.setWidth("100.0%");
    vlBreadCrump.setHeight("100.0%");
    vlBreadCrump.setMargin(false);
    breadCrumpPanel.setContent(vlBreadCrump);

    // BreadCreumb
    new BreadCrumbMenu(breadCrumpPanel, resourceProxy.getName().toString());

    return breadCrumpPanel;
}

From source file:org.escidoc.browser.ekinematixmodule.views.RechercheView.java

License:Open Source License

private Panel buildBreadCrumpPanel() {
    // common part: create layout
    Panel breadCrumpPanel = new Panel();
    breadCrumpPanel.setImmediate(false);
    breadCrumpPanel.setWidth("100.0%");
    breadCrumpPanel.setHeight("30px");
    breadCrumpPanel.setStyleName(Runo.PANEL_LIGHT);

    // vlBreadCrump
    VerticalLayout vlBreadCrump = new VerticalLayout();
    vlBreadCrump.setImmediate(false);//from   w w  w . ja  v a  2 s .  com
    vlBreadCrump.setWidth("100.0%");
    vlBreadCrump.setHeight("100.0%");
    vlBreadCrump.setMargin(false);
    breadCrumpPanel.setContent(vlBreadCrump);

    // BreadCreumb
    new BreadCrumbMenu(breadCrumpPanel, resourceProxy);

    return breadCrumpPanel;
}

From source file:org.escidoc.browser.elabsmodul.views.AddNewEndpointURIWindow.java

License:Open Source License

@SuppressWarnings("serial")
private Component buildGUI() {
    final VerticalLayout rootLayout = new VerticalLayout();
    final HorizontalLayout inputLayout = new HorizontalLayout();
    inputLayout.setSpacing(true);//from  w  w  w  . j  a va  2 s. c o  m
    endpointURITextField = new TextField();
    endpointURITextField.setEnabled(true);
    endpointURITextField.setVisible(true);
    endpointURITextField.setNullRepresentation("");
    endpointURITextField.setValue("http://");
    endpointURITextField.setImmediate(true);
    endpointURITextField.setRequired(true);
    endpointURITextField.setRequiredError("URI cannot be empty!");
    endpointURITextField.setWidth("350px");
    endpointURITextField.focus();

    if (isEsyncURI) {
        inputLayout.addComponent(new Label("New eSync-endpoint URI:"), 0);
    } else {
        inputLayout.addComponent(new Label("New deposit-endpoint URI:"), 0);
    }
    inputLayout.addComponent(endpointURITextField, 1);

    final HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    okButton = new Button(OK_BUTTON_TEXT, this);
    okButton.setIcon(ELabsViewContants.ICON_16_OK);
    okButton.setEnabled(true);
    cancelButton = new Button(CANCEL_BUTTON_TEXT, this);
    cancelButton.setIcon(ELabsViewContants.ICON_16_CANCEL);
    buttonLayout.addComponent(cancelButton);
    buttonLayout.addComponent(okButton);

    rootLayout.addComponent(inputLayout);
    rootLayout.addComponent(buttonLayout);

    Panel panel = new Panel();
    panel.setContent(rootLayout);

    panel.addActionHandler(new Action.Handler() {
        private final Action action_ok = new ShortcutAction("Enter key", ShortcutAction.KeyCode.ENTER, null);

        private final Action action_esc = new ShortcutAction("Escape key", ShortcutAction.KeyCode.ESCAPE, null);

        @Override
        public void handleAction(Action action, Object sender, Object target) {
            if (action.equals(action_ok)) {
                AddNewEndpointURIWindow.this.closeMe(true);
            } else if (action.equals(action_esc)) {
                AddNewEndpointURIWindow.this.closeMe(false);
            }
        }

        @Override
        public Action[] getActions(Object target, Object sender) {
            return new Action[] { action_ok, action_esc };
        }
    });
    return panel;
}

From source file:org.escidoc.browser.elabsmodul.views.AddNewStudyPublicationWindow.java

License:Open Source License

@SuppressWarnings("serial")
private Component buildGUI() {
    final VerticalLayout rootLayout = new VerticalLayout();
    final HorizontalLayout inputLayout = new HorizontalLayout();
    inputLayout.setSpacing(true);//from  w w w.j  a v  a 2 s  .c o  m
    publicationTextField = new TextField();
    publicationTextField.setEnabled(true);
    publicationTextField.setVisible(true);
    publicationTextField.setNullRepresentation("");
    publicationTextField.setValue("http://");
    publicationTextField.setImmediate(true);
    publicationTextField.setRequired(true);
    publicationTextField.setRequiredError("Document URL cannot be empty!");
    publicationTextField.setWidth("350px");
    publicationTextField.focus();

    if (isMotPub) {
        inputLayout.addComponent(new Label("New motivating publication's URL:"), 0);
    } else {
        inputLayout.addComponent(new Label("New resulting publication's URL:"), 0);
    }
    inputLayout.addComponent(publicationTextField, 1);

    final HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setSpacing(true);
    okButton = new Button(OK_BUTTON_TEXT, this);
    okButton.setIcon(ELabsViewContants.ICON_16_OK);
    okButton.setEnabled(true);
    cancelButton = new Button(CANCEL_BUTTON_TEXT, this);
    cancelButton.setIcon(ELabsViewContants.ICON_16_CANCEL);
    buttonLayout.addComponent(cancelButton);
    buttonLayout.addComponent(okButton);

    rootLayout.addComponent(inputLayout);
    rootLayout.addComponent(buttonLayout);

    Panel panel = new Panel();
    panel.setContent(rootLayout);

    panel.addActionHandler(new Action.Handler() {
        private final Action action_ok = new ShortcutAction("Enter key", ShortcutAction.KeyCode.ENTER, null);

        private final Action action_esc = new ShortcutAction("Escape key", ShortcutAction.KeyCode.ESCAPE, null);

        @Override
        public void handleAction(Action action, Object sender, Object target) {
            if (action.equals(action_ok)) {
                AddNewStudyPublicationWindow.this.closeMe(true);
            } else if (action.equals(action_esc)) {
                AddNewStudyPublicationWindow.this.closeMe(false);
            }
        }

        @Override
        public Action[] getActions(Object target, Object sender) {
            return new Action[] { action_ok, action_esc };
        }
    });
    return panel;
}

From source file:org.escidoc.browser.elabsmodul.views.InvestigationSeriesView.java

License:Open Source License

private void leftCell() throws EscidocClientException {
    Panel leftPanel = new Panel();
    leftPanel.setStyleName("directmembers floatleft");
    leftPanel.setScrollable(false);/*w w  w  . ja v  a2  s  .  c  o m*/
    leftPanel.setSizeFull();

    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(false);
    vl.setSizeFull();
    leftPanel.setContent(vl);
    new DirectMember(this.router.getServiceLocation(), this.router, this.containerProxy.getId(),
            this.router.getMainWindow(), router.getRepositories(), leftPanel, ResourceType.CONTAINER.toString())
                    .containerAsTree();
    this.directMemberInvSeriesContainer.addComponent(leftPanel);
    this.directMemberInvSeriesContainer.setExpandRatio(leftPanel, 3.0f);
}

From source file:org.escidoc.browser.elabsmodul.views.InvestigationView.java

License:Open Source License

private void leftCell() throws EscidocClientException {
    final Panel leftPanel = new Panel();
    leftPanel.setStyleName("directmembers floatleft");
    leftPanel.setScrollable(false);/*  www. ja va  2 s .co m*/
    leftPanel.setSizeFull();

    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(false);
    vl.setSizeFull();
    leftPanel.setContent(vl);
    new DirectMember(this.router.getServiceLocation(), this.router, containerProxy.getId(),
            this.router.getMainWindow(), this.router.getRepositories(), leftPanel,
            ResourceType.CONTAINER.toString()).containerAsTree();
    directMemberInvestigationContainer.addComponent(leftPanel);
    directMemberInvestigationContainer.setExpandRatio(leftPanel, 3.0f);
}