Example usage for com.vaadin.ui TabSheet setSizeFull

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

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:org.vaadin.arborgraph.demo.DemoApplication.java

License:Open Source License

@SuppressWarnings("serial")
@Override/*  w  ww.j av  a2 s .  c  o m*/
public void init() {
    VerticalLayout aboutLayout = new VerticalLayout();
    aboutLayout.setSizeFull();
    aboutLayout.addComponent(new Label(getBlah(), Label.CONTENT_XHTML));

    final ArborGraph graph = new ArborGraph();
    graph.setSizeFull();

    Button exampleGraphButton = new Button("Show Example", new ClickListener() {

        public void buttonClick(ClickEvent event) {
            graph.showGraph(getDemoBranch());
        }
    });

    Label orLabel = new Label("<i>or</i>", Label.CONTENT_XHTML);
    orLabel.setSizeUndefined();

    final TextField jsonTextfield = new TextField();
    jsonTextfield.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    jsonTextfield.setNullRepresentation("");

    Button jsonBranchButton = new Button("Display Json Branch", new ClickListener() {

        public void buttonClick(ClickEvent event) {
            graph.showGraph(jsonTextfield.getValue().toString());
        }
    });

    Label helpLabel = getHelpLabel(getBranchExplanation());

    HorizontalLayout graphButtonLayout = new HorizontalLayout();
    graphButtonLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE);
    graphButtonLayout.setSpacing(true);
    graphButtonLayout.setMargin(false, false, true, false);
    graphButtonLayout.addComponent(exampleGraphButton);
    graphButtonLayout.addComponent(orLabel);
    graphButtonLayout.setComponentAlignment(orLabel, Alignment.MIDDLE_CENTER);
    graphButtonLayout.addComponent(jsonBranchButton);
    graphButtonLayout.addComponent(helpLabel);
    graphButtonLayout.setComponentAlignment(helpLabel, Alignment.MIDDLE_CENTER);
    graphButtonLayout.addComponent(jsonTextfield);
    graphButtonLayout.setExpandRatio(jsonTextfield, .9f);

    VerticalLayout graphLayout = new VerticalLayout();
    graphLayout.setSizeFull();
    graphLayout.setMargin(true, false, false, false);
    graphLayout.setSpacing(true);
    graphLayout.addComponent(graphButtonLayout);
    graphLayout.addComponent(graph);
    graphLayout.setExpandRatio(graph, .9f);

    TabSheet tabSheet = new TabSheet();
    tabSheet.setStyleName(Reindeer.TABSHEET_MINIMAL);
    tabSheet.setSizeFull();
    tabSheet.addTab(aboutLayout, "About");
    tabSheet.addTab(graphLayout, "Graph");

    VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setMargin(true);
    mainLayout.addComponent(tabSheet);
    mainLayout.setExpandRatio(tabSheet, .9f);

    Window mainWindow = new Window("Arbor-Vaadin");
    mainWindow.setSizeFull();
    mainWindow.setContent(mainLayout);

    setTheme("arbor");

    setMainWindow(mainWindow);
}

From source file:org.vaadin.spinkit.demo.DemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    tabSheet.addStyleName(ValoTheme.TABSHEET_CENTERED_TABS);
    tabSheet.addTab(spinnersContainer()).setCaption("Spinners");
    tabSheet.addTab(spinnerSizesContainer()).setCaption("Sizes");
    tabSheet.addTab(spinnersContainer("greenspin")).setCaption("Themed Spinners");
    tabSheet.addTab(new RichText().withMarkDown(getClass().getResourceAsStream("source.md")))
            .setCaption("Source code");
    //layout.addComponent(tabSheet);
    //layout.expand(tabSheet);
    RichText info = new RichText().withMarkDown(getClass().getResourceAsStream("about.md"));

    MVerticalLayout layout = new MVerticalLayout().withMargin(true).with(info).expand(tabSheet).withFullHeight()
            .withFullWidth();/*from   w  ww  .  j  a  v  a  2 s .co  m*/

    //layout.setExpandRatio(info, 1);
    //layout.setExpandRatio(tabSheet, 4);

    setContent(layout);
}

From source file:pl.exsio.plupload.examples.ui.PluploadExamplesUI.java

License:Open Source License

@Override
protected void init(VaadinRequest request) {

    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSpacing(true);/*from  w  w w.j a  va 2  s. c o m*/
    mainLayout.setMargin(true);
    this.setSizeFull();

    TabSheet container = new TabSheet();
    container.addTab(new Home(), "Home");
    container.addTab(new SimpleUploaderExample(), "Simple \"Plupload\"");
    container.addTab(new AdvancedUploaderExample(), "Advanced \"Plupload\"");
    container.addTab(new SimpleUploadManagerExample(), "Simple \"PluploadManager\"");
    container.addTab(new UploadManagerWithFileFilterExample(),
            "\"PluploadManager\" with file filter and drop zone");
    container.addTab(new UploadManagerWithImageResizeExample(), "\"PluploadManager\" with image resize");
    container.addTab(new FileUploaderFieldExample(), "\"PluploadField\" with File value");
    container.addTab(new ValidationByteArrayUploaderFieldExample(),
            "\"PluploadField\" with byte[] value and form validation");

    mainLayout.addComponent(container);
    container.setSizeFull();
    mainLayout.setSizeFull();

    this.setContent(mainLayout);

}

From source file:ru.codeinside.adm.ui.AdminApp.java

License:Mozilla Public License

@Override
public void init() {
    setUser(Flash.login());//from w  w w .  j  a va2s  .  co m
    setTheme("custom");

    TabSheet t = new TabSheet();
    t.addStyleName(Reindeer.TABSHEET_MINIMAL);
    t.setSizeFull();
    t.setCloseHandler(new DelegateCloseHandler());
    UserInfoPanel.addClosableToTabSheet(t, getUser().toString());
    TreeTableOrganization treeTableOrganization = new TreeTableOrganization();
    CrudNews showNews = new CrudNews();
    table = treeTableOrganization.getTreeTable();
    Tab orgsTab = t.addTab(treeTableOrganization, "");
    t.setSelectedTab(orgsTab);
    t.addTab(new GroupTab(), "");

    GwsSystemTab systemTab = new GwsSystemTab();
    t.addTab(systemTab, " ??");
    t.addListener(systemTab);

    GwsLazyTab gwsLazyTab = new GwsLazyTab();
    t.addTab(gwsLazyTab, "?  ??");
    t.addListener(gwsLazyTab);

    t.addTab(createEmployeeWidget(), "");
    RefreshableTab settings = createSettings();
    t.addTab(settings, "??");
    t.addListener(settings);

    Component businessCalendar = createBusinessCalendar();
    t.addTab(businessCalendar, "? ");

    LogTab logTab = new LogTab();
    t.addListener(logTab);
    t.addTab(logTab, "");
    t.addTab(showNews, "??");
    t.addTab(registryTab(), "?");
    setMainWindow(new Window(
            getUser() + " |  | -" + Activator.getContext().getBundle().getVersion(),
            t));
    AdminServiceProvider.get().createLog(Flash.getActor(), "Admin application", (String) getUser(), "login",
            null, true);
}

From source file:ru.codeinside.adm.ui.AdminApp.java

License:Mozilla Public License

private Component createEmployeeWidget() {
    final TabSheet tabSheet = new TabSheet();
    tabSheet.addStyleName(Reindeer.TABSHEET_MINIMAL);
    tabSheet.setSizeFull();
    tabSheet.addTab(new EmployeeWidget(false, table), "?");
    tabSheet.addTab(new EmployeeWidget(true, table), "");
    tabSheet.addListener(new TabSheet.SelectedTabChangeListener() {

        @Override//from   www .  j  av  a 2  s  .  c  o m
        public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
            EmployeeWidget currentTab = (EmployeeWidget) tabSheet.getSelectedTab();
            currentTab.refreshList();
        }
    });
    return tabSheet;
}

From source file:ru.codeinside.adm.ui.GroupTab.java

License:Mozilla Public License

public GroupTab() {
    setSizeFull();//  w ww .  j av  a2s .  co  m
    setSpacing(true);
    TabSheet t = new TabSheet();
    t.addStyleName(Reindeer.TABSHEET_MINIMAL);
    addComponent(t);
    t.setSizeFull();
    showGroupTab(t, ORGANIZATION);
    showGroupTab(t, EMPLOYEE);
}

From source file:ru.codeinside.gses.webui.declarant.DeclarantFactory.java

License:Mozilla Public License

public static Component create() {

    // TODO: ??   ??!
    final ServiceQueryDefinition amSQ = new ServiceQueryDefinition(ProcedureType.Administrative);
    final LazyQueryContainer amSC = new LazyQueryContainer(amSQ, new ServiceQueryFactory(false));
    final ProcedureQueryDefinition amPQ = new ProcedureQueryDefinition(ProcedureType.Administrative);
    final LazyQueryContainer amPC = new LazyQueryContainer(amPQ,
            new ProcedureQueryFactory(Flash.login(), false));

    final ProcedureQueryDefinition mmQ = new ProcedureQueryDefinition(ProcedureType.Interdepartmental);
    final LazyQueryContainer mmC = new LazyQueryContainer(mmQ, new ProcedureQueryFactory(Flash.login(), false));

    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();/* www.  ja  v  a  2 s .com*/
    layout.setMargin(true);
    final Label header = new Label(
            " ?  ?? ?? ?");
    header.addStyleName("h1");
    layout.addComponent(header);

    final Select amS = new Select("", amPC);
    String selectWidth = "400px";
    amS.setWidth(selectWidth);
    amS.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    amS.setItemCaptionPropertyId("name");
    amS.setFilteringMode(AbstractSelect.Filtering.FILTERINGMODE_CONTAINS);
    amS.setNullSelectionAllowed(true);
    amS.setNewItemsAllowed(false);
    amS.setImmediate(true);

    final Select amSS = new Select("?", amSC);
    amSS.setWidth(selectWidth);
    amSS.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    amSS.setItemCaptionPropertyId("name");
    amSS.setFilteringMode(AbstractSelect.Filtering.FILTERINGMODE_CONTAINS);
    amSS.setNullSelectionAllowed(true);
    amSS.setNewItemsAllowed(false);
    amSS.setImmediate(true);

    final FormLayout amLayout = new FormLayout();

    final Panel amPanel = new Panel();
    amLayout.addComponent(amSS);
    amLayout.addComponent(amS);
    amPanel.addComponent(amLayout);

    final Select mmS = new Select("", mmC);
    mmS.setFilteringMode(Select.FILTERINGMODE_OFF);
    mmS.setWidth(selectWidth);
    mmS.setItemCaptionPropertyId("name");
    mmS.setFilteringMode(AbstractSelect.Filtering.FILTERINGMODE_CONTAINS);
    mmS.setNullSelectionAllowed(true);
    mmS.setNewItemsAllowed(false);
    mmS.setImmediate(true);

    final FormLayout mmLayout = new FormLayout();
    final Panel mmPanel = new Panel();
    //    mmLayout.addComponent(mmSS);
    mmLayout.addComponent(mmS);
    mmPanel.addComponent(mmLayout);

    final VerticalLayout amWrapper = new VerticalLayout();
    amWrapper.setSizeFull();
    amWrapper.addComponent(amPanel);

    final VerticalLayout imWrapper = new VerticalLayout();
    imWrapper.setSizeFull();
    imWrapper.addComponent(mmPanel);

    final TabSheet typeSheet = new TabSheet();
    typeSheet.setSizeFull();
    typeSheet.addTab(amWrapper, "?? ");
    typeSheet.addTab(imWrapper, "? ");
    layout.addComponent(typeSheet);
    layout.setExpandRatio(typeSheet, 1);

    // 

    amSS.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            final Property prop = event.getProperty();
            if (prop.getValue() == null) {
                amPQ.serviceId = -1;
            } else {
                amPQ.serviceId = (Long) amSC.getItem(prop.getValue()).getItemProperty("id").getValue();
            }
            amS.select(null);
            amPC.refresh();
        }
    });

    final ProcedureSelectListener administrativeProcedureSelectListener = new ProcedureSelectListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectProcedure(long id) {
            if (amWrapper.getComponentCount() > 1) {
                amWrapper.removeComponent(amWrapper.getComponent(1));
            }
            if (id > 0) {
                final Component cmp = createStartEventForm(id, this, layout);
                if (cmp != null) {
                    amWrapper.addComponent(cmp);
                    amWrapper.setExpandRatio(cmp, 1f);
                } else {
                    amS.select(null);
                    amPC.refresh();
                    amSC.refresh();
                }
            }
        }
    };
    final ProcedureSelectListener interdepartamentalProcedureSelectListener = new ProcedureSelectListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void selectProcedure(long id) {
            if (imWrapper.getComponentCount() > 1) {
                imWrapper.removeComponent(imWrapper.getComponent(1));
            }
            if (id > 0) {
                final Component cmp = createStartEventForm(id, this, layout);
                if (cmp != null) {
                    imWrapper.addComponent(cmp);
                    imWrapper.setExpandRatio(cmp, 1f);
                }
            }
        }
    };
    amS.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            final Object itemId = event.getProperty().getValue();
            final long procedureId = itemId == null ? -1
                    : (Long) amPC.getItem(itemId).getItemProperty("id").getValue();
            administrativeProcedureSelectListener.selectProcedure(procedureId);
        }
    });
    mmS.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            final Object itemId = event.getProperty().getValue();
            final long procedureId = itemId == null ? -1
                    : (Long) mmC.getItem(itemId).getItemProperty("id").getValue();
            interdepartamentalProcedureSelectListener.selectProcedure(procedureId);
        }
    });

    return layout;
}

From source file:ru.codeinside.gses.webui.Workplace.java

License:Mozilla Public License

public Workplace(String login, Set<Role> roles, boolean production) {

    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    tabSheet.setStyleName(Reindeer.TABSHEET_BORDERLESS);
    tabSheet.setCloseHandler(new DelegateCloseHandler());

    if (!production) {
        new MemoryUsage(tabSheet);
    }/*from  w w w  .  j a v a2  s  .  c om*/

    UserInfoPanel.addClosableToTabSheet(tabSheet, login);

    if (roles.contains(Role.Executor)) {
        TabChanger archiveChanger = new TabChanger(tabSheet);
        archiveChanger.set(ArchiveFactory.create(), "?");

        TabChanger executorChanger = new TabChanger(tabSheet);
        executorChanger.set(ExecutorFactory.create(executorChanger, tabSheet), "?");
    }

    if (roles.contains(Role.Declarant)) {
        new TabChanger(tabSheet).set(DeclarantFactory.create(), " ?");
    }

    if (roles.contains(Role.Supervisor) || roles.contains(Role.SuperSupervisor)) {
        new TabChanger(tabSheet).set(new SupervisorWorkplace(), " ??");
    }

    if (roles.contains(Role.SuperSupervisor)) {
        new TabChanger(tabSheet).set(new TaskManager(), "?? ??");
    }

    if (roles.contains(Role.Manager)) {
        new TabChanger(tabSheet).set(new ManagerWorkplace(), " ");
    }

    if (roles.contains(Role.Executor) || roles.contains(Role.Declarant) || roles.contains(Role.Supervisor)
            || roles.contains(Role.SuperSupervisor)) {
        SmevTasksPanel smevTasksPanel = new SmevTasksPanel();
        tabSheet.addTab(smevTasksPanel, "  ");
        tabSheet.addListener(smevTasksPanel);
    }

    setCompositionRoot(tabSheet);

    setSizeFull();
}