Example usage for com.vaadin.ui Panel setSizeFull

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

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:org.lunifera.examples.vaaclipse.demo1.e4.editors.TextEditor.java

License:Open Source License

@Inject
public TextEditor(VerticalLayout container, MInputPart inputPart) {
    super(inputPart.getInputURI());

    Panel e = new Panel();
    e.setSizeFull();
    text = new Label(readContent(), Label.CONTENT_PREFORMATTED);
    e.setContent(text);/*ww  w  .ja v a 2  s  . com*/
    container.addComponent(e);
}

From source file:org.lunifera.vaaclipse.ui.preferences.addon.internal.PreferencesDialog.java

License:Open Source License

public void createWindow() {
    window = new Window();
    window.setCaption("Preferences");
    window.addStyleName("preferences-dialog");
    window.setWidth("800px");
    window.setHeight("600px");

    splitPanel.setSizeFull();//from w  w w .ja  v  a 2  s  .co  m

    dlgButtonPanel = new CssLayout();
    dlgButtonPanel.setWidth("100%");
    dlgButtonPanel.addStyleName("dlg-button-panel");

    // dlgButtonPanel.addComponent(new Label("<hr/>", ContentMode.HTML));

    cancelButton = new Button("Cancel");
    cancelButton.addStyleName("cancel-button");
    dlgButtonPanel.addComponent(cancelButton);
    okButton = new Button("OK");
    okButton.addStyleName("ok-button");
    dlgButtonPanel.addComponent(okButton);

    root = new VerticalLayout();
    root.setSizeFull();
    window.setContent(root);
    root.addComponent(splitPanel);
    root.addComponent(dlgButtonPanel);
    root.setExpandRatio(splitPanel, 10);
    root.setExpandRatio(dlgButtonPanel, 0);

    treePanel = new Panel();
    treePanel.addStyleName("categories-panel");
    treePanel.addStyleName("borderless");
    treePanel.setSizeFull();

    leftSide = new CssLayout();
    leftSide.addStyleName("categories");
    leftSide.setSizeFull();
    // filterField.setWidth("70%");
    filterField.addStyleName("categories-filter");
    leftSide.addComponent(filterField);

    filterButton.setIcon(BundleResource
            .valueOf("platform:/plugin/org.lunifera.vaaclipse.ui.preferences.addon/img/find.png"));
    filterButton.addStyleName("vaaclipsebutton");
    filterButton.addStyleName("icon-only");
    filterButton.addStyleName("filter-category-button");

    clearFilterButton.setIcon(BundleResource
            .valueOf("platform:/plugin/org.lunifera.vaaclipse.ui.preferences.addon/img/clear.png"));
    clearFilterButton.addStyleName("vaaclipsebutton");
    clearFilterButton.addStyleName("icon-only");
    clearFilterButton.addStyleName("clear-filter-button");

    leftSide.addComponent(clearFilterButton);
    leftSide.addComponent(filterButton);
    leftSide.addComponent(treePanel);

    rightSide = new VerticalLayout();
    rightSide.setSizeFull();
    // rightSide.setMargin(new MarginInfo(true, true, false, true));

    pageHeader = new CssLayout();
    pageHeader.addStyleName("page-header-panel");
    pageHeader.setWidth("100%");
    pageHeaderText = new Label("Page");
    pageHeaderText.addStyleName("page-header-text");
    pageHeader.addComponent(pageHeaderText);
    rightSide.addComponent(pageHeader);

    pageContent = new CssLayout();
    // pageContent.setSizeFull();
    Panel pageContentPanel = new Panel(pageContent);// wrap page content to
    // panel - if content is
    // too large, scrolling
    // needed
    pageContentPanel.setSizeFull();
    rightSide.addComponent(pageContentPanel);

    pageBottom = new CssLayout();
    pageBottom.addStyleName("page-bottom-panel");
    pageBottom.setWidth("100%");
    rightSide.addComponent(pageBottom);

    apply = new Button("Apply");
    apply.addStyleName("apply");
    pageBottom.addComponent(apply);

    restoreDefaults = new Button("RestoreDefaults");
    restoreDefaults.addStyleName("restore-defaults");
    pageBottom.addComponent(restoreDefaults);

    splitPanel.addComponent(leftSide);
    splitPanel.addComponent(rightSide);
    splitPanel.setSplitPosition(30, Sizeable.Unit.PERCENTAGE);

    rightSide.setExpandRatio(pageHeader, 0);
    rightSide.setExpandRatio(pageContentPanel, 1);
    rightSide.setExpandRatio(pageBottom, 0);

    clearFilterButton.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            filterField.setValue("");
            refreshTree();
        }
    });

    filterButton.addClickListener(new ClickListener() {

        @Override
        public void buttonClick(ClickEvent event) {
            refreshTree();
        }
    });
}

From source file:org.opencms.ui.components.CmsBasicDialog.java

License:Open Source License

/**
 * Creates new instance.<p>/*from  www . jav  a2s . co m*/
 */
public CmsBasicDialog() {
    addStyleName(OpenCmsTheme.DIALOG);
    setMargin(true);
    setSpacing(true);
    setWidth("100%");

    m_mainPanel = new VerticalLayout();
    m_mainPanel.addStyleName(OpenCmsTheme.DIALOG_CONTENT);
    m_mainPanel.setSpacing(true);
    m_mainPanel.setSizeFull();

    m_contentPanel = new Panel();
    m_contentPanel.setSizeFull();
    m_contentPanel.addStyleName("v-scrollable");

    m_mainPanel.addComponent(m_contentPanel);
    m_mainPanel.setExpandRatio(m_contentPanel, 3);

    Panel panel = new Panel();
    panel.setContent(m_mainPanel);
    panel.setSizeFull();
    addComponent(panel);
    setExpandRatio(panel, 1);
    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setWidth("100%");
    buttons.addStyleName(OpenCmsTheme.DIALOG_BUTTON_BAR);
    addComponent(buttons);
    m_buttonPanelLeft = new HorizontalLayout();
    m_buttonPanelLeft.setSpacing(true);
    buttons.addComponent(m_buttonPanelLeft);
    buttons.setComponentAlignment(m_buttonPanelLeft, Alignment.MIDDLE_LEFT);
    m_buttonPanelLeft.setVisible(false);
    m_buttonPanelRight = new HorizontalLayout();
    m_buttonPanelRight.setSpacing(true);
    buttons.addComponent(m_buttonPanelRight);
    buttons.setComponentAlignment(m_buttonPanelRight, Alignment.MIDDLE_RIGHT);
    enableMaxHeight();
}

From source file:org.opencms.ui.components.CmsBasicDialog.java

License:Open Source License

/**
 * Creates a resource list panel.<p>
 *
 * @param caption the caption to use/*  ww w .  j a  va2s. c  om*/
 * @param resources the resources
 *
 * @return the panel
 */
protected Panel createResourceListPanel(String caption, List<CmsResource> resources) {

    Panel result = new Panel(caption);
    result.addStyleName("v-scrollable");
    result.setSizeFull();
    VerticalLayout resourcePanel = new VerticalLayout();
    result.setContent(resourcePanel);
    resourcePanel.addStyleName(OpenCmsTheme.REDUCED_MARGIN);
    resourcePanel.addStyleName(OpenCmsTheme.REDUCED_SPACING);
    resourcePanel.setSpacing(true);
    resourcePanel.setMargin(true);
    for (CmsResource resource : resources) {
        resourcePanel.addComponent(new CmsResourceInfo(resource));
    }
    return result;
}

From source file:org.opencms.ui.dialogs.history.CmsHistoryDialog.java

License:Open Source License

/**
 * Opens the 'compare' view for the two selected versions of the resource.<p>
 *
 * @throws CmsException if something goes wrong
 *///  ww w  . jav  a 2s  .c o  m
public void tryCompare() throws CmsException {

    CmsObject cms = A_CmsUI.getCmsObject();
    CheckBox check1 = m_group1.getSelected();
    CheckBox check2 = m_group2.getSelected();
    if (!canCompare(check1, check2)) {
        Notification.show(
                CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_SELECT_TWO_DIFFERENT_VERSIONS_0));
    } else {
        CmsHistoryResourceBean bean1 = (CmsHistoryResourceBean) (check1.getData());
        CmsHistoryResourceBean bean2 = (CmsHistoryResourceBean) (check2.getData());
        VerticalLayout diffContainer = new VerticalLayout();
        diffContainer.setSpacing(true);
        for (I_CmsDiffProvider diff : m_diffs) {
            Optional<Component> optionalDiff = diff.diff(cms, bean1, bean2);
            if (optionalDiff.isPresent()) {
                diffContainer.addComponent(optionalDiff.get());
            }
        }
        Panel panel = new Panel();
        panel.setSizeFull();
        diffContainer.setWidth("100%");
        diffContainer.setMargin(true);
        panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
        panel.setContent(diffContainer);
        openChildDialog(CmsHistoryDialog.this, panel,
                CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_COMPARE_0));
    }

}

From source file:org.opencms.ui.editors.messagebundle.CmsMessageBundleEditor.java

License:Open Source License

/**
 * Creates the main component of the editor with all sub-components.
 * @return the completely filled main component of the editor.
 * @throws IOException thrown if setting the table's content data source fails.
 * @throws CmsException thrown if setting the table's content data source fails.
 *///from w ww  . j av a 2  s  . c  o m
private Component createMainComponent() throws IOException, CmsException {

    VerticalLayout mainComponent = new VerticalLayout();
    mainComponent.setSizeFull();
    mainComponent.addStyleName("o-message-bundle-editor");
    m_table = createTable();
    Panel navigator = new Panel();
    navigator.setSizeFull();
    navigator.setContent(m_table);
    navigator.addActionHandler(new CmsMessageBundleEditorTypes.TableKeyboardHandler(m_table));
    navigator.addStyleName("v-panel-borderless");

    mainComponent.addComponent(m_options.getOptionsComponent());
    mainComponent.addComponent(navigator);
    mainComponent.setExpandRatio(navigator, 1f);
    m_options.updateShownOptions(m_model.hasMasterMode(), m_model.canAddKeys());
    return mainComponent;
}

From source file:org.openeos.services.ui.vaadin.internal.abstractform.AbstractFormVaadinTabImpl.java

License:Apache License

@Override
protected void showEdit() {
    if (getActiveObject() == null) {
        List<UIBean> selectedObjects = getSelectedObjectsInList();
        if (selectedObjects.size() > 0) {
            this.setActiveObject(selectedObjects.get(0));
        } else {// w w  w  .  ja  v a  2s  .c  om
            //TODO i18n
            getMainContainer().getWindow().showNotification("Select an intem", "Please select an item to edit",
                    Notification.TYPE_HUMANIZED_MESSAGE);
            showView(View.LIST);
            return;
        }
    }
    Panel panel = new Panel();
    panel.setSizeFull();
    panel.setStyleName("background-default");
    getMainContainer().addComponent(panel);
    if (getActiveObject().isNew()) {
        newForm.setValue(getActiveObject());
        panel.addComponent(newForm.getImplementation());
    } else {
        editForm.setValue(getActiveObject());
        editForm.getBindingContext().updateFields();
        panel.addComponent(editForm.getImplementation());
    }
    modified = false;
}

From source file:org.openeos.services.ui.vaadin.internal.VaadinWindowImpl.java

License:Apache License

@Override
protected ComponentContainer createMainContainer() {
    Panel mainPanel = new Panel();
    mainPanel.setSizeFull();
    if (!multipleLevels) {
        firstContainer = mainPanel;//from www.  j  a v a 2  s . co  m
    } else {
        VerticalSplitPanel vSplit = new VerticalSplitPanel();
        vSplit.setSizeFull();
        mainPanel.setContent(vSplit);
        firstContainer = new Panel();
        firstContainer.setSizeFull();
        vSplit.setFirstComponent(firstContainer);
        secondContainer = new Panel();
        secondContainer.setSizeFull();
        vSplit.setSecondComponent(secondContainer);
        vSplit.setLocked(false);
    }
    return mainPanel;
}

From source file:org.openeos.usertask.ui.internal.vaadin.TasksWindow.java

License:Apache License

private void displayTask(UserTask task) {
    Panel mainPanel = new Panel();
    mainPanel.setStyleName("background-default");
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);/*w w  w  .j a  va2s  . co m*/
    layout.setSpacing(true);
    layout.setWidth(100f, VerticalLayout.UNITS_PERCENTAGE);
    mainPanel.setContent(layout);
    mainPanel.setSizeFull();

    mainPanel.addComponent(createTaskTitle(task));
    mainPanel.addComponent(createTaskSummary(task));

    Component customComponent = createCustomComponent(task);
    if (customComponent != null) {
        mainPanel.addComponent(customComponent);
    }

    mainSplitPanel.setSecondComponent(mainPanel);

}

From source file:org.openeos.usertask.ui.internal.vaadin.TasksWindow.java

License:Apache License

private void displayEmptyTask() {
    Panel panel = new Panel();
    panel.setSizeFull();
    panel.setStyleName("background-default");
    mainSplitPanel.setSecondComponent(panel);
}