Example usage for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel

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

Introduction

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

Prototype

public HorizontalSplitPanel() 

Source Link

Document

Creates an empty horizontal split panel.

Usage

From source file:org.vaadin.spring.samples.sidebar.SideBarUI.java

License:Apache License

@Override
protected void init(VaadinRequest vaadinRequest) {
    getPage().setTitle("Vaadin4Spring Side Bar Sample");
    final HorizontalSplitPanel rootLayout = new HorizontalSplitPanel();
    rootLayout.setStyleName(Reindeer.SPLITPANEL_SMALL);
    rootLayout.setSizeFull();//ww w . ja  v a  2  s .c  o m
    setContent(rootLayout);

    final Navigator navigator = new Navigator(this, new ViewDisplay() {
        @Override
        public void showView(View view) {
            System.out.println("Showing view " + view);
            rootLayout.setSecondComponent((com.vaadin.ui.Component) view);
        }
    });
    navigator.setErrorView(new ErrorView());
    navigator.addProvider(viewProvider);
    setNavigator(navigator);

    rootLayout.setFirstComponent(sideBar);
    rootLayout.setSplitPosition(150, Unit.PIXELS);
}

From source file:pl.altkom.ecommerce.vaadin.view.ProductListView.java

private void initLayout() {
    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    addComponent(splitPanel);/*  w ww . j  a  v  a 2 s. c om*/

    VerticalLayout leftLayout = new VerticalLayout();
    splitPanel.addComponent(leftLayout);
    splitPanel.addComponent(editorLayout);
    leftLayout.addComponent(contactList);
    HorizontalLayout bottomLeftLayout = new HorizontalLayout();
    leftLayout.addComponent(bottomLeftLayout);
    bottomLeftLayout.addComponent(searchField);
    bottomLeftLayout.addComponent(addNewContactButton);
    leftLayout.setSizeFull();
    leftLayout.setExpandRatio(contactList, 1);
    contactList.setSizeFull();
    bottomLeftLayout.setWidth("100%");
    searchField.setWidth("100%");
    bottomLeftLayout.setExpandRatio(searchField, 1);
    editorLayout.setMargin(true);
    editorLayout.setVisible(false);

}

From source file:pt.yellowduck.ramboia.RamboiaApplication.java

License:Open Source License

private void buildMainLayout() {

    VerticalSplitPanel vSplit = new VerticalSplitPanel();
    vSplit.setSplitPosition(15, Sizeable.UNITS_PERCENTAGE);
    vSplit.setSizeFull();/*from  w  w w  . ja  v  a  2s  . c  o m*/

    HorizontalSplitPanel hSplit_top = new HorizontalSplitPanel();
    hSplit_top.setSizeFull();
    hSplit_top.setSplitPosition(50, Sizeable.UNITS_PERCENTAGE);
    hSplit_top.setFirstComponent(viewPlayer);
    hSplit_top.setSecondComponent(viewUpload);
    hSplit_top.setLocked(true);

    vSplit.setFirstComponent(hSplit_top);

    HorizontalSplitPanel hSplit_bottom = new HorizontalSplitPanel();
    hSplit_bottom.setSizeFull();
    hSplit_bottom.setSplitPosition(75, Sizeable.UNITS_PERCENTAGE);
    hSplit_bottom.setFirstComponent(viewLibrary);
    hSplit_bottom.setSecondComponent(viewPlaylist);
    hSplit_bottom.setLocked(true);

    vSplit.setSecondComponent(hSplit_bottom);

    mainWindow.setContent(vSplit);
}

From source file:rs.pupin.jpo.esta_ld.EstaLdComponent.java

private void createGUI() {
    mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();//from ww w  .j a  v a  2s  . com
    mainLayout.setSpacing(false);
    mainLayout.setDebugId("l-main");

    if (indAnimatorEnabled) {
        animator = new AnimatorProxy();
        mainLayout.addComponent(animator);
        indSettingsVisible = true;
    }

    brandLayout = new HorizontalLayout();
    brandLayout.setSpacing(true);
    brandLayout.setMargin(true);
    brandLayout.setWidth("100%");
    brandLayout.setDebugId("l-brand");
    Label brandSpan = new Label("<span id='brand'>ESTA-LD</span>", Label.CONTENT_XHTML);
    brandLayout.addComponent(brandSpan);
    brandLayout.setExpandRatio(brandSpan, 2.0f);
    brandLayout.setComponentAlignment(brandSpan, Alignment.MIDDLE_LEFT);
    Button btnEndpoint = new Button("Endpoint");
    brandLayout.addComponent(btnEndpoint);
    brandLayout.setComponentAlignment(btnEndpoint, Alignment.MIDDLE_RIGHT);
    btnEndpoint.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            final EndpointWindow.EndpointState state = new EndpointWindow.EndpointState();
            state.endpoint = endpoint;
            Window w = new EndpointWindow(state);
            w.addListener(new Window.CloseListener() {
                @Override
                public void windowClose(Window.CloseEvent e) {
                    try {
                        if (!endpoint.equals(state.endpoint))
                            repository.shutDown();
                    } catch (RepositoryException ex) {
                        Logger.getLogger(EstaLdComponent.class.getName()).log(Level.SEVERE, null, ex);
                    }
                    if (state.repository != null && state.repository.isInitialized()) {
                        repository = state.repository;
                        endpoint = state.endpoint;
                        endpointChanged();
                    }
                }
            });
            getWindow().addWindow(w);
        }
    });
    btnInspect = new Button("Inspect");
    if (indShowInspect) {
        brandLayout.addComponent(btnInspect);
        brandLayout.setExpandRatio(btnInspect, 0.0f);
    }
    Button btnSettings = new Button("Parameters");
    brandLayout.addComponent(btnSettings);
    brandLayout.setComponentAlignment(btnSettings, Alignment.MIDDLE_RIGHT);
    btnSettings.addListener(new Button.ClickListener() {
        public void buttonClick(Button.ClickEvent event) {
            //                getWindow().executeJavaScript("$('#l-dataset').parent().parent().slideToggle(function(){ vaadin.forceLayout(); })");

            if (!indAnimatorEnabled) {
                getWindow().executeJavaScript("$('#l-settings').parent().parent().slideToggle()");
                settingsLayout.setVisible(!settingsLayout.isVisible());
            } else {
                //                    if (indSettingsVisible) {
                //                        animator.animate(settingsLayout, VAnimatorProxy.AnimType.ROLL_UP_CLOSE);
                //                    } else {
                //                        animator.animate(settingsLayout, VAnimatorProxy.AnimType.ROLL_DOWN_OPEN_POP);
                //                    }
                //                    indSettingsVisible = !indSettingsVisible;
            }

            //                getWindow().executeJavaScript("setTimeout(function(){ vaadin.forceSync(); map.invalidateSize(); }, 0)");
            //                getWindow().executeJavaScript("setTimeout(function(){ runSparqlDimensionValueChangedVuk(); map.invalidateSize() }, 200)");
            //                getWindow().executeJavaScript("setTimeout(function(){ currentChart.reflow(); map.invalidateSize() }, 200)");
        }
    });

    settingsLayout = new VerticalLayout();
    settingsLayout.setDebugId("l-settings");
    settingsLayout.setSpacing(true);
    settingsLayout.setMargin(true);
    settingsLayout.setWidth("100%");

    datasetLayout = new HorizontalLayout();
    datasetLayout.setSpacing(true);
    datasetLayout.setWidth("100%");
    datasetLayout.setDebugId("l-dataset");

    mainLayout.addComponent(brandLayout);
    mainLayout.setExpandRatio(brandLayout, 0.0f);
    settingsLayout.addComponent(datasetLayout);
    Label lblSettingsSeparator = new Label("<hr/>", Label.CONTENT_XHTML);
    lblSettingsSeparator.addStyleName("settings-separator");
    settingsLayout.addComponent(lblSettingsSeparator);
    mainLayout.addComponent(settingsLayout);
    mainLayout.setExpandRatio(settingsLayout, 0.0f);

    // in place of this divide borders and shadows will be added
    //        Label lblDivider = new Label("<hr/>", Label.CONTENT_XHTML);
    //        mainLayout.addComponent(lblDivider);
    //        mainLayout.setExpandRatio(lblDivider, 0.0f);

    //        contentLayout = new HorizontalLayout();
    contentLayout = new HorizontalSplitPanel();
    contentLayout.setMargin(true);
    contentLayout.setSizeFull();
    contentLayout.setWidth("100%");
    //        contentLayout.setSpacing(true);
    contentLayout.setSplitPosition(50, UNITS_PERCENTAGE);
    contentLayout.setDebugId("l-content");
    mainLayout.addComponent(contentLayout);
    mainLayout.setExpandRatio(contentLayout, 2.0f);

    createDataSetLayout();
}

From source file:rs.pupin.jpo.validation.gui.ValidationComponent.java

private void createUI() {
    rootLayout.removeAllComponents();//from  www  .  ja  va2 s  .c o  m
    icHash.clear();
    createHeader();

    splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();
    rootLayout.addComponent(splitPanel);
    rootLayout.setExpandRatio(splitPanel, 2.0f);

    criteriaTree = new Tree("Validation criteria");
    criteriaTree.setNullSelectionAllowed(false);
    criteriaTree.setImmediate(true);
    criteriaTree.setWidth("100%");
    splitPanel.setFirstComponent(criteriaTree);
    createConstraints();
    splitPanel.setSplitPosition(400, Unit.PIXELS);
    contentLayout = new VerticalLayout();
    contentLayout.setSizeUndefined();
    contentLayout.setWidth("100%");
    contentLayout.setSpacing(true);
    contentLayout.addStyleName("content");
    splitPanel.setSecondComponent(contentLayout);
    createListeners();
}

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

License:Mozilla Public License

TableGroup(String typeGroup) {
    setSizeFull();/*from  w w w  .jav a2s. co  m*/
    this.typeGroup = typeGroup;
    setMargin(false, false, false, true);
    table = new FilterTable();
    table.setSizeFull();
    table.setSelectable(true);
    table.setMultiSelect(false);
    table.addListener(this);
    table.setImmediate(true);
    table.addContainerProperty("", String.class, "");
    table.addContainerProperty("?", String.class, "");
    table.setFilterBarVisible(true);
    table.setFilterDecorator(new FilterDecorator_());
    Set<String> groupNames = null;
    if (typeGroup.equals(GroupTab.ORGANIZATION)) {
        groupNames = AdminServiceProvider.get().getOrgGroupNames();
    } else if (typeGroup.equals(GroupTab.EMPLOYEE)) {
        groupNames = AdminServiceProvider.get().getEmpGroupNames();
    }
    for (String groupName : groupNames) {
        List<Group> groups = AdminServiceProvider.get().findGroupByName(groupName);
        for (Group group : groups) {
            table.addItem(new Object[] { groupName, group.getTitle() }, groupName);
        }
    }

    panel.setStyleName(Reindeer.PANEL_LIGHT);
    panel.setSizeFull();

    final HorizontalSplitPanel horiz = new HorizontalSplitPanel();
    horiz.setSplitPosition(35); // percent
    horiz.setSizeFull();
    addComponent(horiz);
    horiz.addComponent(table);
    horiz.addComponent(panel);
}

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

License:Mozilla Public License

public TreeTableOrganization() {
    setSizeFull();//  w w  w . j av  a2s . com
    treetable = new TreeTable();
    treetable.setSizeFull();
    treetable.setSelectable(true);
    treetable.setMultiSelect(false);
    treetable.addListener(this);
    treetable.setImmediate(true);
    treetable.setValue(null);
    setMargin(true);
    // Add Table columns
    treetable.addContainerProperty(NAME_PROPERTY, String.class, "");

    fillTable(treetable);

    treetable.addListener(new ExpandListener() {

        private static final long serialVersionUID = 1L;

        public void nodeExpand(ExpandEvent event) {
            if (lockExpandListener) {
                return;
            }
            Object valuePropertyEvent = event.getItemId();
            Organization org = AdminServiceProvider.get().findOrganizationById((Long) valuePropertyEvent);
            Set<Organization> childs = org.getOrganizations();
            if (!(childs.isEmpty())) {
                treetable.setChildrenAllowed((Long) valuePropertyEvent, true);

                for (Organization o : childs) {
                    treetable.addItem(new Object[] { o.getName() }, o.getId());
                    treetable.setCollapsed(o.getId(), true);
                }

                for (Organization o : childs) {
                    treetable.setParent(o.getId(), (Long) valuePropertyEvent);
                }

                for (Organization o : childs) {
                    treetable.setChildrenAllowed(o.getId(), !(o.getOrganizations().isEmpty()));
                }
            }

        }
    });

    treetable.addListener(new CollapseListener() {

        private static final long serialVersionUID = 1L;

        public void nodeCollapse(CollapseEvent event) {
            if (lockExpandListener) {
                return;
            }
            Set<Object> delete = new HashSet<Object>();
            Collection<?> children = treetable.getChildren(event.getItemId());
            if (children != null) {
                for (Object child : children) {
                    removeRecursively(child, delete);
                }
            }
            for (Object o : delete) {
                treetable.setCollapsed(o, true);
                treetable.removeItem(o);
            }
        }

        private void removeRecursively(Object object, Set<Object> delete) {
            Collection<?> children = treetable.getChildren(object);
            if (children != null) {
                for (Object child : children) {
                    removeRecursively(child, delete);
                }
            }
            delete.add(object);
        }
    });

    panel.setStyleName(Reindeer.PANEL_LIGHT);
    panel.setSizeFull();
    panel.addComponent(new ButtonCreateOrganization(treetable));

    final HorizontalSplitPanel horiz = new HorizontalSplitPanel();
    horiz.setSplitPosition(25); // percent
    horiz.setSizeFull();
    addComponent(horiz);
    TextField orgFilter = new TextField();
    orgFilter.setImmediate(true);
    orgFilter.setWidth(100, UNITS_PERCENTAGE);
    orgFilter.setInputPrompt("  ");
    orgFilter.addListener(new FieldEvents.TextChangeListener() {

        List<Organization> organizations;
        List<Long> organizationIds;

        @Override
        public void textChange(FieldEvents.TextChangeEvent event) {
            String name = StringUtils.trimToNull(event.getText());
            if (name != null) {
                lockExpandListener = true;
                organizations = AdminServiceProvider.get().findOrganizationIdsByName(name);
                treetable.removeAllItems();
                organizationIds = new ArrayList<Long>();
                for (Organization org : organizations) {
                    for (Organization o1 : getPath(org)) {
                        if (!treetable.containsId(o1.getId())) {
                            treetable.addItem(new Object[] { o1.getName() }, o1.getId());
                            if (o1.getParent() != null) {
                                treetable.setParent(o1.getId(), o1.getParent().getId());
                            }
                            treetable.setChildrenAllowed(o1.getId(), !(o1.getOrganizations().isEmpty()));
                            treetable.setCollapsed(o1.getId(), false);
                        }
                    }
                    organizationIds.add(org.getId());
                }

                treetable.setCellStyleGenerator(new Table.CellStyleGenerator() {
                    @Override
                    public String getStyle(Object itemId, Object propertyId) {
                        if (propertyId == null) {
                            if (!organizationIds.contains(itemId)) {
                                return "gray";
                            }
                        }
                        return null;
                    }
                });

            } else {
                lockExpandListener = false;
                treetable.removeAllItems();
                fillTable(treetable);
                treetable.setCellStyleGenerator(new Table.CellStyleGenerator() {
                    @Override
                    public String getStyle(Object itemId, Object propertyId) {
                        return null;
                    }
                });
            }
        }

        private List<Organization> getPath(Organization org) {
            List<Organization> list = new LinkedList<Organization>();
            while (org != null) {
                list.add(0, org);
                org = org.getParent();
            }
            return list;
        }
    });
    VerticalLayout vl = new VerticalLayout();
    vl.setSpacing(true);
    vl.setSizeFull();
    vl.addComponent(orgFilter);
    vl.addComponent(treetable);
    vl.setExpandRatio(treetable, 0.9f);
    horiz.addComponent(vl);
    horiz.addComponent(panel);
}

From source file:ru.codeinside.gses.webui.executor.ExecutorFactory.java

License:Mozilla Public License

public static Component create(final Changer changer, final TabSheet tabs) {

    final ItemBuilder<Task> assigneeBuilder = new BatchItemBuilder<Task>() {
        private static final long serialVersionUID = 1L;

        transient Durations durations;

        @Override//w w  w  .  j a  v  a  2 s  .  co m
        public void batchStart() {
            durations = new Durations();
        }

        @Override
        public void batchFinish() {
            durations = null;
        }

        @Override
        public Item createItem(final Task task) {
            final String taskId = task.getId();
            final ProcessDefinition def = ActivitiBean.get().getProcessDefinition(task.getProcessDefinitionId(),
                    Flash.login());
            String procedureName = Flash.flash().getExecutorService()
                    .getProcedureNameByDefinitionId(def.getId());
            final PropertysetItem item = new PropertysetItem();
            final Bid bid = getBid(task);
            final String bidId = bid.getId() == null ? "" : bid.getId().toString();
            item.addItemProperty("id", buttonProperty(bidId, new TaskGraphListener(changer, task)));
            item.addItemProperty("name", stringProperty(task.getName()));
            item.addItemProperty("startDate", stringProperty(formatter.format(bid.getDateCreated())));
            item.addItemProperty("declarant", stringProperty(bid.getDeclarant()));
            if (bid.getTag() == null || bid.getTag().isEmpty()) {
                item.addItemProperty("process", stringProperty(procedureName));
            } else {
                item.addItemProperty("process", stringProperty(bid.getTag() + " - " + procedureName));
            }
            item.addItemProperty("version", stringProperty(bid.getVersion()));
            final Button b = new Button("", new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        showForm(tabs, taskId);
                    } catch (Exception e) {
                        Components.showException(event.getButton().getWindow(), e);
                    }
                }
            });
            b.setStyleName(Reindeer.BUTTON_SMALL);
            item.addItemProperty("claim", new ObjectProperty<Component>(b));
            item.addItemProperty("priority", stringProperty(String.valueOf(task.getPriority())));
            TaskDates td = AdminServiceProvider.get().getTaskDatesByTaskId(taskId);
            durations.fillBidAndTask(bid, td, item);
            return item;
        }

        private Bid getBid(final Task task) {
            Bid bid = AdminServiceProvider.get().getBidByTask(task.getId());

            if (bid == null) {
                bid = new Bid();
                bid.setDeclarant("");
                bid.setVersion("");
                bid.setStatus(BidStatus.Execute);
            }
            return bid;
        }

    };
    final AssigneeTaskListQuery assigneeTaskQuery = new AssigneeTaskListQuery(assigneeBuilder);
    final TableForExecutor assignee = new TableForExecutor(assigneeTaskQuery);
    assignee.setCaption("?? ?");
    assignee.addContainerProperty("id", Component.class, null);
    assignee.addContainerProperty("name", String.class, null);
    assignee.addContainerProperty("startDate", String.class, null);
    assignee.addContainerProperty("declarant", String.class, null);
    assignee.addContainerProperty("process", String.class, null);
    assignee.addContainerProperty("version", String.class, null);
    assignee.addContainerProperty("status", String.class, null);
    assignee.addContainerProperty("claim", Component.class, null);
    assignee.addContainerProperty("priority", String.class, null);
    assignee.addContainerProperty("bidDays", String.class, null);
    assignee.addContainerProperty("taskDays", String.class, null);
    assignee.setVisibleColumns(new Object[] { "id", "name", "startDate", "declarant", "process", "version",
            "claim", "bidDays", "taskDays" });
    assignee.setColumnHeaders(new String[] { "?", "", "  ?",
            "?", "", "v", "", "..", ".?." });
    assignee.setSelectable(false);
    assignee.setSortDisabled(true);

    assignee.setColumnAlignment("id", Table.ALIGN_RIGHT);
    assignee.setColumnExpandRatio("id", 0.3f);
    assignee.setColumnExpandRatio("name", 1f);
    assignee.setColumnExpandRatio("process", 1.2f);
    assignee.setColumnExpandRatio("bidDays", 0.2f);
    assignee.setColumnExpandRatio("taskDays", 0.2f);

    assignee.setCellStyleGenerator(new TaskStylist(assignee));

    final ItemBuilder<Task> claimBuilder = new BatchItemBuilder<Task>() {
        private static final long serialVersionUID = 1L;

        Durations durations;

        @Override
        public void batchStart() {
            durations = new Durations();
        }

        @Override
        public void batchFinish() {
            durations = null;
        }

        @Override
        public Item createItem(final Task task) {
            final String taskId = task.getId();
            final ProcessDefinition def = ActivitiBean.get().getProcessDefinition(task.getProcessDefinitionId(),
                    Flash.login());
            String procedureName = Flash.flash().getExecutorService()
                    .getProcedureNameByDefinitionId(def.getId());
            PropertysetItem item = new PropertysetItem();
            final Bid bid = getBid(task);
            ObjectProperty idProperty;
            if (bid.getId() == null) {
                idProperty = new ObjectProperty<String>("");
            } else {
                idProperty = buttonProperty(bid.getId().toString(), new TaskGraphListener(changer, task));
            }
            item.addItemProperty("id", idProperty);
            item.addItemProperty("name", stringProperty(task.getName()));
            item.addItemProperty("startDate", stringProperty(formatter.format(bid.getDateCreated())));
            item.addItemProperty("declarant", stringProperty(bid.getDeclarant()));
            if (bid.getTag() == null || bid.getTag().isEmpty()) {
                item.addItemProperty("process", stringProperty(procedureName));
            } else {
                item.addItemProperty("process", stringProperty(bid.getTag() + " - " + procedureName));
            }
            item.addItemProperty("version", stringProperty(bid.getVersion()));
            item.addItemProperty("status", stringProperty(bid.getStatus().getName()));
            final Button b = new Button("", new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    final String login = Flash.login();
                    final String errMessage = ActivitiBean.get().claim(taskId, login, login, false);
                    if (!StringUtils.isEmpty(errMessage)) {
                        event.getButton().getWindow().showNotification("", errMessage,
                                Notification.TYPE_ERROR_MESSAGE);
                    }
                    fireTaskChangedEvent(taskId, this);
                }
            });
            b.setStyleName(Reindeer.BUTTON_SMALL);
            item.addItemProperty("claim", new ObjectProperty<Component>(b));
            item.addItemProperty("priority", stringProperty(String.valueOf(task.getPriority())));
            TaskDates td = AdminServiceProvider.get().getTaskDatesByTaskId(taskId);
            durations.fillBidAndTask(bid, td, item);
            return item;
        }

        private Bid getBid(final Task task) {
            Bid bid = AdminServiceProvider.get().getBidByTask(task.getId());

            if (bid == null) {
                bid = new Bid();
                bid.setDeclarant("");
                bid.setVersion("");
                bid.setStatus(BidStatus.Execute);
            }
            return bid;
        }

    };
    final CandidateTaskListQuery candidateTaskQuery = new CandidateTaskListQuery(claimBuilder, Flash.login());
    final TableForExecutor candidate = new TableForExecutor(candidateTaskQuery);
    candidate.setCaption(" ?");
    candidate.addContainerProperty("id", Component.class, null);
    candidate.addContainerProperty("name", String.class, null);
    candidate.addContainerProperty("startDate", String.class, null);
    candidate.addContainerProperty("declarant", String.class, null);
    candidate.addContainerProperty("process", String.class, null);
    candidate.addContainerProperty("version", String.class, null);
    candidate.addContainerProperty("status", String.class, null);
    candidate.addContainerProperty("claim", Component.class, null);
    candidate.addContainerProperty("priority", String.class, null);
    candidate.addContainerProperty("bidDays", String.class, null);
    candidate.addContainerProperty("taskDays", String.class, null);
    candidate.setVisibleColumns(new Object[] { "id", "name", "startDate", "declarant", "process", "version",
            "status", "claim", "bidDays", "taskDays" });
    candidate.setColumnHeaders(new String[] { "?", "", "  ?",
            "?", "", "v", "?", "", "..", ".?." });
    candidate.setSelectable(false);
    candidate.setSortDisabled(true);

    candidate.setColumnAlignment("id", Table.ALIGN_RIGHT);
    candidate.setColumnExpandRatio("name", 1f);
    candidate.setColumnExpandRatio("process", 1f);

    candidate.setCellStyleGenerator(new TaskStylist(candidate));

    final Form filter = new TaskFilter(candidateTaskQuery, candidate, assigneeTaskQuery, assignee,
            TaskFilter.Mode.Executor);

    HorizontalLayout asigneeLayout = new HorizontalLayout();
    asigneeLayout.setSizeFull();
    asigneeLayout.setMargin(true);
    asigneeLayout.setSpacing(true);
    asigneeLayout.addComponent(assignee);

    Panel filterPanel = new Panel();
    filterPanel.setHeight("100%");
    filterPanel.addComponent(filter);
    final HorizontalSplitPanel hSplitter = new HorizontalSplitPanel();
    hSplitter.setSizeFull();
    hSplitter.setFirstComponent(filterPanel);
    hSplitter.setSecondComponent(asigneeLayout);
    hSplitter.setSplitPosition(35);

    VerticalLayout candidateLayout = new VerticalLayout();
    candidateLayout.setSizeFull();
    candidateLayout.setMargin(true);
    candidateLayout.addComponent(candidate);

    final TasksSplitter vSplitter = new TasksSplitter(assignee, candidate);
    vSplitter.setSizeFull();
    vSplitter.setFirstComponent(hSplitter);
    vSplitter.setSecondComponent(candidateLayout);
    vSplitter.setSplitPosition(57);
    return vSplitter;
}

From source file:ru.codeinside.gses.webui.manager.DirectoryPanel.java

License:Mozilla Public License

static Component createDirectoryPanel() {
    HorizontalSplitPanel horSplit = new HorizontalSplitPanel();
    horSplit.setSizeFull();/*from  w ww .j  av  a2 s. c o m*/
    horSplit.setMargin(true);

    Panel panel00 = new Panel();
    Panel panel01 = new Panel();

    Panel panel10 = new Panel();

    horSplit.setFirstComponent(panel00);

    VerticalLayout vl = new VerticalLayout();
    horSplit.setSecondComponent(vl);

    vl.addComponent(panel01);
    vl.addComponent(panel10);

    vl.setSpacing(true);

    horSplit.setWidth("100%");
    vl.setHeight("100%");

    panel00.setHeight("100%");
    panel00.setWidth("100%");

    panel01.setWidth("100%");
    panel01.setHeight("100%");
    panel10.setHeight("100%");
    horSplit.setSplitPosition(35);
    vl.setExpandRatio(panel01, 0.25f);
    vl.setExpandRatio(panel10, 0.75f);

    final Table dirMapTable = ManagerWorkplace.createDirectoryMapTable();
    final FilterTable directoryTable = ManagerWorkplace.createDirectoryTable();
    dirMapTable.setVisible(false);

    final Form createFieldForm = new Form();
    createFieldForm.setCaption(" ?  ?");

    final TextField keyField = new TextField("");
    keyField.setRequired(true);
    keyField.setMaxLength(254);
    createFieldForm.addField("key", keyField);

    final TextField valField = new TextField("");
    valField.setRequired(true);
    valField.setMaxLength(1022);
    createFieldForm.addField("val", valField);
    createFieldForm.setVisible(false);

    Button addButton = new Button("",
            new AddTupleButtonListener(createFieldForm, directoryTable, keyField, valField, dirMapTable));
    createFieldForm.addField("submit", addButton);

    directoryTable.addListener(new DirectoryTableChangeListener(createFieldForm, directoryTable, dirMapTable));

    ManagerWorkplace.buildContainer(directoryTable, createFieldForm, dirMapTable);
    directoryTable.setColumnHeaders(new String[] { "?", "", "" });

    final Form createDirectory = new Form();
    createDirectory.setCaption(" ?");
    final TextField field = new TextField("?");
    field.setRequired(true);
    field.setMaxLength(255);
    field.setRequiredError("  ?");
    createDirectory.addField("name", field);
    Button createButton = new Button("",
            new CreateDirectoryButtonListener(field, createDirectory, directoryTable));
    createDirectory.addField("submit", createButton);

    Panel loadPanel = new Panel();
    loadPanel.setCaption(" ?");

    UploadDirectory events = new UploadDirectory(directoryTable, dirMapTable);

    Upload c = new Upload("", events);
    c.addListener(events);

    c.setButtonCaption("");
    loadPanel.addComponent(c);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSizeFull();
    verticalLayout.setSpacing(true);
    verticalLayout.addComponent(loadPanel);
    verticalLayout.addComponent(createDirectory);
    verticalLayout.addComponent(directoryTable);

    panel00.addComponent(verticalLayout);

    panel01.addComponent(createFieldForm);

    dirMapTable.setSizeFull();
    dirMapTable.setPageLength(13);
    panel10.addComponent(dirMapTable);

    return horSplit;
}

From source file:uk.co.q3c.v7.base.view.StandardPageViewBase.java

License:Apache License

@Override
protected void buildUI() {
    layout = new HorizontalSplitPanel();
    label = new Label("This is the " + this.getClass().getSimpleName());
    label.setHeight("100px");
    grid = new GridLayout(3, 3);

    grid.addComponent(label, 1, 1);/* w ww.  j a v a 2 s. c  o m*/
    grid.setSizeFull();
    grid.setColumnExpandRatio(0, 0.33f);
    grid.setColumnExpandRatio(1, 0.33f);
    grid.setColumnExpandRatio(2, 0.33f);

    grid.setRowExpandRatio(0, 0.4f);
    grid.setRowExpandRatio(1, 0.2f);
    grid.setRowExpandRatio(2, 0.4f);

    label.setSizeFull();
    layout.setSplitPosition(200f, Unit.PIXELS);
    layout.setFirstComponent(navtree);
    layout.setSecondComponent(grid);

}