Example usage for com.vaadin.ui VerticalLayout setExpandRatio

List of usage examples for com.vaadin.ui VerticalLayout setExpandRatio

Introduction

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

Prototype

public void setExpandRatio(Component component, float ratio) 

Source Link

Document

This method is used to control how excess space in layout is distributed among components.

Usage

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

License:Mozilla Public License

static Window createFormWindow(Component su, ActivityImpl ac, String id) {
    VerticalLayout content = new VerticalLayout();
    content.setMargin(true);//from  w  w  w . jav a2 s .  com
    content.addComponent(su);
    Window window = new Window();
    window.setWidth(800 + 50, Sizeable.UNITS_PIXELS);
    window.setHeight(600 + 100, Sizeable.UNITS_PIXELS);
    window.center();
    window.setContent(content);
    window.setCaption(" ? " + ac.getId() + "  ? #" + id);
    if (su instanceof JsonFormIntegration || su instanceof ExpandRequired) {
        content.setSizeFull();
        content.setExpandRatio(su, 1f);
    } else {
        window.setResizable(false); //  ?  
    }
    return window;
}

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

License:Mozilla Public License

static void showTask(final Changer changer, final Task task, final ProcessDefinitionEntity def) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);/*from   www.  j ava 2s  .c o m*/
    layout.setSpacing(true);
    layout.setSizeFull();
    final Button cancel = new Button("?", new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            changer.back();
        }
    });
    cancel.setClickShortcut(KeyCode.ESCAPE, 0);
    layout.addComponent(cancel);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSizeFull();
    hl.setSpacing(true);
    layout.addComponent(hl);
    layout.setExpandRatio(cancel, 0.01f);
    layout.setExpandRatio(hl, 0.99f);

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setSpacing(true);
    hl.addComponent(vl);

    final String procedureName = Flash.flash().getExecutorService().getProcedureNameByDefinitionId(def.getId());
    vl.addComponent(new ProcedureHistoryPanel(task.getId()));

    ShowDiagramComponentParameterObject parameterObject = new ShowDiagramComponentParameterObject();
    final String procVersion = def.getVersion() + "";
    parameterObject.windowHeader = procedureName + "v. " + procVersion;
    parameterObject.width = "600px";
    parameterObject.executionId = task.getExecutionId();
    parameterObject.changer = changer;
    parameterObject.processDefinitionId = def.getId();
    parameterObject.caption = "";
    ShowDiagramComponent showDiagramComponent = new ShowDiagramComponent(parameterObject);
    hl.addComponent(showDiagramComponent);
    hl.setExpandRatio(vl, 0.5f);
    hl.setExpandRatio(showDiagramComponent, 0.5f);

    changer.change(layout);
    cancel.focus();
}

From source file:ru.codeinside.gses.webui.form.EForm.java

License:Mozilla Public License

@Override
public void attach() {
    ActivitiApp app = (ActivitiApp) getApplication();
    hasAnyResult = false;/*from www  . j av a 2s  .  c o m*/

    if (serial == null) {
        serial = app.nextId();
        putFields(formValue.getPropertyValues());
    }

    app.getForms().put(serial, form);

    VerticalLayout layout = (VerticalLayout) getLayout();
    try {
        integration = createIntegration();
        integration.setSizeFull();
        integration.setImmediate(true);
        layout.setSizeFull();
        layout.addComponent(integration);
        layout.setExpandRatio(integration, 1f);
        layout.setImmediate(true);
        integration.setErrorReceiver(new ErrorReceiver());
        integration.setValueReceiver(new ValueReceiver());
    } catch (RuntimeException e) {
        Logger.getLogger(getClass().getName()).log(Level.WARNING,
                "  ", e);
        layout.addComponent(new Label(
                "     " + e.getLocalizedMessage()));
    }
    super.attach();
}

From source file:ru.codeinside.gses.webui.form.JsonForm.java

License:Mozilla Public License

@Override
public void attach() {
    hasAnyResult = false;/*w  w w.  j  a v a 2 s. c  o m*/
    VerticalLayout layout = (VerticalLayout) getLayout();
    try {
        integration = createIntegration();
        layout.addComponent(integration);
        layout.setExpandRatio(integration, 1f);
        integration.setErrorReceiver(new ErrorReceiver());
        integration.setValueReceiver(new ValueReceiver());
    } catch (RuntimeException e) {
        Logger.getLogger(getClass().getName()).log(Level.WARNING,
                "  ", e);
        layout.addComponent(new Label(
                "     " + e.getLocalizedMessage()));
    }

    super.attach();
}

From source file:ru.codeinside.gses.webui.form.PrintPanel.java

License:Mozilla Public License

PrintPanel(FormDataSource dataSource, Application app, String procedureName, String taskId) {
    setSizeFull();//ww  w. j  ava2s . c  o  m
    try {
        String orgName = AdminServiceProvider.get().withEmployee(app.getUser().toString(),
                new Function<Employee, String>() {
                    @Override
                    public String apply(Employee employee) {
                        return employee.getOrganization().getName();
                    }
                });
        htmlFile = Streams.createTempFile("form-", ".html");
        docxFile = Streams.createTempFile("form-", ".docx");
        FormEntry formEntry = dataSource.createFormTree();
        FormData data = new FormData();
        data.orgName = orgName;
        data.serviceName = procedureName;
        if (taskId != null) {
            Bid bid = AdminServiceProvider.get().getBidByTask(taskId);
            data.receiptId = bid.getId();
            data.receiptDate = bid.getDateCreated();
        } else {
            data.receiptDate = new Date();
        }
        data.htmlFile = htmlFile.getAbsolutePath();
        data.docxFile = docxFile.getAbsolutePath();
        data.entries = formEntry.children;
        FormConverterCustomicer.convert(data);

        String classId = "doc" + SERIAL.incrementAndGet();

        Button print = new Button("", new PrintAction(classId));
        print.setStyleName("img-button");
        print.setIcon(PRINT_ICON);
        print.setImmediate(true);

        Button download = new Button("", new DownloadAction(docxFile));
        download.setStyleName("img-button");
        download.setIcon(DOWNLOAD_ICON);
        download.setImmediate(true);

        Panel documentPanel = createDocumentPanel(app, classId);

        HorizontalLayout buttons = new HorizontalLayout();
        buttons.setImmediate(true);
        buttons.setSpacing(true);
        buttons.addComponent(print);
        buttons.addComponent(download);

        VerticalLayout printLayout = new VerticalLayout();
        printLayout.setSizeFull();
        printLayout.addComponent(buttons);
        printLayout.addComponent(documentPanel);
        printLayout.setExpandRatio(documentPanel, 1f);

        setCompositionRoot(printLayout);
    } catch (IOException e) {
        setCompositionRoot(new Label(e.getMessage()));
    }
}

From source file:ru.codeinside.gses.webui.form.PrintPanel.java

License:Mozilla Public License

PrintPanel(String content, Application app) {
    try {// w  ww .  j a va 2s  .c om
        htmlFile = Streams.createTempFile("form-", ".html");
        String classId = "doc" + SERIAL.incrementAndGet();

        Button print = new Button("", new PrintAction(classId));
        print.setStyleName("img-button");
        print.setIcon(PRINT_ICON);
        print.setImmediate(true);

        buildHtmlFile(content);
        Panel documentPanel = createDocumentPanel(app, classId);
        documentPanel.setHeight(500, UNITS_PIXELS);

        HorizontalLayout buttons = new HorizontalLayout();
        buttons.setImmediate(true);
        buttons.setSpacing(true);
        buttons.addComponent(print);

        VerticalLayout printLayout = new VerticalLayout();
        printLayout.setSizeFull();
        printLayout.addComponent(buttons);
        printLayout.addComponent(documentPanel);
        printLayout.setExpandRatio(documentPanel, 1f);

        setCompositionRoot(printLayout);
    } catch (IOException e) {
        e.printStackTrace();
    }
}

From source file:ru.codeinside.gses.webui.form.PrintPanel.java

License:Mozilla Public License

private Panel createDocumentPanel(Application app, String classId) {
    Embedded document = new Embedded(null, new FileResource(htmlFile, app));
    document.setDebugId(classId);/*from w ww  .  j  a  va2 s. c o m*/
    document.setType(Embedded.TYPE_BROWSER);
    document.setSizeFull();

    VerticalLayout documentLayout = new VerticalLayout();
    documentLayout.setMargin(true);
    documentLayout.setSizeFull();
    documentLayout.addComponent(document);
    documentLayout.setExpandRatio(document, 1f);

    Panel documentPanel = new Panel(documentLayout);
    documentPanel.setSizeFull();
    return documentPanel;
}

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

License:Mozilla Public License

static Component createDirectoryPanel() {
    HorizontalSplitPanel horSplit = new HorizontalSplitPanel();
    horSplit.setSizeFull();//  w  w  w.  java 2  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:ru.codeinside.gses.webui.manager.ManagerWorkplace.java

License:Mozilla Public License

private Component createProcedurePanel1() {
    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);/*from www  . j  a va  2s . co  m*/
    hl.setWidth("100%");
    hl.setHeight("100%");
    Panel panel00 = new Panel();
    panel00.setHeight("100%");
    panel00.setWidth("100%");
    Panel panel01 = new Panel();
    panel01.setWidth("100%");
    panel01.setHeight("100%");
    Panel panel10 = new Panel();
    panel10.setSizeFull();
    panel10.setScrollable(false);
    hl.addComponent(panel00);
    hl.addComponent(panel01);

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setMargin(true);
    vl.setSpacing(true);
    vl.addComponent(hl);
    vl.addComponent(panel10);

    hl.setExpandRatio(panel00, 0.33f);
    hl.setExpandRatio(panel01, 0.77f);
    vl.setExpandRatio(hl, 0.6f);
    vl.setExpandRatio(panel10, 0.4f);

    procedureForm = new ProcedureForm();
    procedureTable = new ProcedureTable(procedureForm);
    filter = createFilteringForm(procedureTable);
    panel00.addComponent(filter);
    panel01.addComponent(procedureForm);
    panel10.addComponent(procedureTable);
    ap.addItemSetChangeListener(filter);
    ap.addItemSetChangeListener(procedureForm);
    return vl;
}

From source file:ru.codeinside.gses.webui.supervisor.SupervisorWorkplace.java

License:Mozilla Public License

private void buildListPanel() {
    controlledTasksTable.setHeight("255px");
    controlledTasksTable.setWidth("100%");
    controlledTasksTable.setImmediate(true);
    controlledTasksTable.setSelectable(true);
    controlledTasksTable.setSortDisabled(true);
    controlledTasksTable.addContainerProperty("id", Component.class, null);
    controlledTasksTable.addContainerProperty("dateCreated", String.class, null);
    controlledTasksTable.addContainerProperty("task", String.class, null);
    controlledTasksTable.addContainerProperty("procedure", String.class, null);
    controlledTasksTable.addContainerProperty("declarant", String.class, null);
    controlledTasksTable.addContainerProperty("version", String.class, null);
    controlledTasksTable.addContainerProperty("status", String.class, null);
    controlledTasksTable.addContainerProperty("employee", String.class, null);
    controlledTasksTable.addContainerProperty("priority", String.class, null);
    controlledTasksTable.addContainerProperty("bidDays", String.class, null);
    controlledTasksTable.addContainerProperty("taskDays", String.class, null);
    controlledTasksTable.setVisibleColumns(new Object[] { "id", "dateCreated", "task", "procedure", "declarant",
            "version", "status", "employee", "bidDays", "taskDays" });
    controlledTasksTable.setColumnHeaders(new String[] { "?", "  ?",
            "", "", "?", "??", "?",
            "?", "..", ".?." });
    controlledTasksTable.setColumnExpandRatio("id", 0.05f);
    controlledTasksTable.setColumnExpandRatio("dateCreated", 0.15f);
    controlledTasksTable.setColumnExpandRatio("task", 0.2f);
    controlledTasksTable.setColumnExpandRatio("procedure", 0.25f);
    controlledTasksTable.setColumnExpandRatio("declarant", 0.1f);
    controlledTasksTable.setColumnExpandRatio("version", 0.05f);
    controlledTasksTable.setColumnExpandRatio("status", 0.1f);
    controlledTasksTable.setColumnExpandRatio("employee", 0.1f);
    controlledTasksTable.setCellStyleGenerator(new TaskStylist(controlledTasksTable));
    listPanel.addComponent(controlledTasksTable);
    final Button assignButton = new Button("? ??");
    controlledTasksTable.addListener(new Property.ValueChangeListener() {
        @Override/*from  w w w .  j  a  va  2 s.c om*/
        public void valueChange(Property.ValueChangeEvent event) {
            Table table = (Table) event.getProperty();
            Item item = table.getItem(table.getValue());

            if (item != null && item.getItemProperty("id") != null) {
                final String taskId = item.getItemProperty("taskId").getValue().toString();
                final Component procedureHistoryPanel = new ProcedureHistoryPanel(taskId);
                procedureHistoryPanel.addListener(new Listener() {
                    @Override
                    public void componentEvent(Event event) {
                        HistoricTaskInstance historicTaskInstance = ((ProcedureHistoryPanel.HistoryStepClickedEvent) event)
                                .getHistoricTaskInstance();
                        Date endDateTime = historicTaskInstance.getEndTime();
                        if (endDateTime == null) {
                            taskIdToAssign = findTaskByHistoricInstance(historicTaskInstance);
                            if (taskIdToAssign == null) {
                                alreadyGone();
                                return;
                            }
                            assignButton.setVisible(true);
                        } else {
                            assignButton.setVisible(false);
                        }
                    }
                });
                ((VerticalLayout) item1).removeAllComponents();
                Task task = Flash.flash().getProcessEngine().getTaskService().createTaskQuery().taskId(taskId)
                        .singleResult();
                Bid bid = Flash.flash().getAdminService().getBidByTask(taskId);
                String executionId = task.getExecutionId();
                final ProcessDefinition def = ActivitiBean.get()
                        .getProcessDefinition(task.getProcessDefinitionId(), Flash.login());
                final ShowDiagramComponentParameterObject param = new ShowDiagramComponentParameterObject();
                param.changer = bidChanger;
                param.processDefinitionId = def.getId();
                param.executionId = executionId;
                param.height = "300px";
                param.width = null;
                param.windowHeader = bid == null ? ""
                        : bid.getProcedure().getName() + " v. " + bid.getVersion();
                Button showDiagram = new Button("");
                showDiagram.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        Execution execution = Flash.flash().getProcessEngine().getRuntimeService()
                                .createExecutionQuery().executionId(param.executionId).singleResult();
                        if (execution == null) {
                            alreadyGone();
                            return;
                        }
                        ShowDiagramComponent showDiagramComponent = new ShowDiagramComponent(param);
                        VerticalLayout layout = new VerticalLayout();
                        Button back = new Button("?");
                        back.addListener(new Button.ClickListener() {
                            private static final long serialVersionUID = 4154712522487297925L;

                            @Override
                            public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
                                bidChanger.back();
                            }
                        });
                        layout.addComponent(back);
                        layout.setSpacing(true);
                        layout.addComponent(showDiagramComponent);
                        bidChanger.set(layout, "showDiagram");
                        bidChanger.change(layout);
                    }
                });

                Button deleteBidButton = new Button(" ?");
                deleteBidButton.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        final Window mainWindow = getWindow();
                        final Window rejectWindow = new Window();
                        rejectWindow.setWidth("38%");
                        rejectWindow.center();
                        rejectWindow.setCaption("!");
                        final VerticalLayout verticalLayout = new VerticalLayout();
                        verticalLayout.setSpacing(true);
                        verticalLayout.setMargin(true);
                        final Label messageLabel = new Label(
                                "  ? ?");
                        messageLabel.setStyleName("h2");
                        final TextArea textArea = new TextArea();
                        textArea.setSizeFull();
                        HorizontalLayout buttons = new HorizontalLayout();
                        buttons.setSpacing(true);
                        buttons.setSizeFull();
                        final Button ok = new Button("Ok");
                        Button cancel = new Button("Cancel");

                        buttons.addComponent(ok);
                        buttons.addComponent(cancel);
                        buttons.setExpandRatio(ok, 0.99f);
                        verticalLayout.addComponent(messageLabel);
                        verticalLayout.addComponent(textArea);
                        verticalLayout.addComponent(buttons);
                        verticalLayout.setExpandRatio(textArea, 0.99f);
                        rejectWindow.setContent(verticalLayout);
                        mainWindow.addWindow(rejectWindow);

                        Button.ClickListener ok1 = new Button.ClickListener() {
                            @Override
                            public void buttonClick(Button.ClickEvent event) {
                                ok.setEnabled(false);
                                verticalLayout.removeComponent(messageLabel);
                                verticalLayout.removeComponent(textArea);
                                final byte[] block;
                                final String textAreaValue = (String) textArea.getValue();
                                if (textAreaValue != null) {
                                    block = textAreaValue.getBytes();
                                } else {
                                    block = null;
                                }
                                Label reason = new Label(textAreaValue);
                                reason.setCaption(" :");
                                verticalLayout.addComponent(reason, 0);
                                event.getButton().removeListener(this);

                                SignApplet signApplet = new SignApplet(new SignAppletListener() {

                                    @Override
                                    public void onLoading(SignApplet signApplet) {

                                    }

                                    @Override
                                    public void onNoJcp(SignApplet signApplet) {
                                        verticalLayout.removeComponent(signApplet);
                                        ReadOnly field = new ReadOnly(
                                                "   ?? ?? ?  JCP",
                                                false);
                                        verticalLayout.addComponent(field);

                                    }

                                    @Override
                                    public void onCert(SignApplet signApplet, X509Certificate certificate) {
                                        boolean ok = false;
                                        String errorClause = null;
                                        try {
                                            boolean link = AdminServiceProvider
                                                    .getBoolProperty(CertificateVerifier.LINK_CERTIFICATE);
                                            if (link) {
                                                byte[] x509 = AdminServiceProvider.get()
                                                        .withEmployee(Flash.login(), new CertificateReader());
                                                ok = Arrays.equals(x509, certificate.getEncoded());
                                            } else {
                                                ok = true;
                                            }
                                            CertificateVerifyClientProvider.getInstance()
                                                    .verifyCertificate(certificate);
                                        } catch (CertificateEncodingException e) {
                                        } catch (CertificateInvalid err) {
                                            errorClause = err.getMessage();
                                            ok = false;
                                        }
                                        if (ok) {
                                            signApplet.block(1, 1);
                                        } else {
                                            NameParts subject = X509.getSubjectParts(certificate);
                                            String fieldValue = (errorClause == null)
                                                    ? " " + subject.getShortName()
                                                            + " "
                                                    : errorClause;
                                            ReadOnly field = new ReadOnly(fieldValue, false);
                                            verticalLayout.addComponent(field, 0);
                                        }
                                    }

                                    @Override
                                    public void onBlockAck(SignApplet signApplet, int i) {
                                        logger().fine("AckBlock:" + i);
                                        signApplet.chunk(1, 1, block);
                                    }

                                    @Override
                                    public void onChunkAck(SignApplet signApplet, int i) {
                                        logger().fine("AckChunk:" + i);
                                    }

                                    @Override
                                    public void onSign(SignApplet signApplet, byte[] sign) {
                                        final int i = signApplet.getBlockAck();
                                        logger().fine("done block:" + i);
                                        if (i < 1) {
                                            signApplet.block(i + 1, 1);
                                        } else {
                                            verticalLayout.removeComponent(signApplet);
                                            NameParts subjectParts = X509
                                                    .getSubjectParts(signApplet.getCertificate());
                                            Label field2 = new Label(subjectParts.getShortName());
                                            field2.setCaption("? ?:");
                                            verticalLayout.addComponent(field2, 0);
                                            ok.setEnabled(true);
                                        }
                                    }

                                    private Logger logger() {
                                        return Logger.getLogger(getClass().getName());
                                    }
                                });
                                byte[] x509 = AdminServiceProvider.get().withEmployee(Flash.login(),
                                        new CertificateReader());
                                if (x509 != null) {
                                    signApplet.setSignMode(x509);
                                } else {
                                    signApplet.setUnboundSignMode();
                                }
                                verticalLayout.addComponent(signApplet, 0);

                                ok.addListener(new Button.ClickListener() {
                                    @Override
                                    public void buttonClick(Button.ClickEvent event) {
                                        Task result = Flash.flash().getProcessEngine().getTaskService()
                                                .createTaskQuery().taskId(taskId).singleResult();
                                        if (result == null) {
                                            alreadyGone();
                                            return;
                                        }
                                        ActivitiBean.get().deleteProcessInstance(taskId, textAreaValue);
                                        AdminServiceProvider.get().createLog(Flash.getActor(), "activiti.task",
                                                taskId, "remove", " ?", true);
                                        fireTaskChangedEvent(taskId, SupervisorWorkplace.this);
                                        infoChanger.change(infoComponent);
                                        controlledTasksTable.setValue(null);
                                        controlledTasksTable.refresh();
                                        mainWindow.removeWindow(rejectWindow);
                                    }
                                });
                            }
                        };
                        ok.addListener(ok1);

                        cancel.addListener(new Button.ClickListener() {
                            @Override
                            public void buttonClick(Button.ClickEvent event) {

                                controlledTasksTable.refresh();
                                mainWindow.removeWindow(rejectWindow);
                            }
                        });
                    }
                });

                HorizontalLayout hl = new HorizontalLayout();
                hl.setSizeFull();
                hl.setSpacing(true);
                hl.addComponent(showDiagram);
                hl.addComponent(deleteBidButton);
                hl.setExpandRatio(showDiagram, 0.99f);
                hl.setExpandRatio(deleteBidButton, 0.01f);

                ((VerticalLayout) item1).addComponent(hl);
                ((VerticalLayout) item1).addComponent(procedureHistoryPanel);
                assignButton.setVisible(false);
                assignButton.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        ((Layout) item3).removeAllComponents();
                        if (taskIdToAssign != null) {
                            ((Layout) item3).addComponent(createAssignerToTaskComponent(taskIdToAssign,
                                    (ProcedureHistoryPanel) procedureHistoryPanel, controlledTasksTable));
                            bidChanger.change(item3);
                        } else {
                            alreadyGone();
                        }
                    }
                });
                ((VerticalLayout) item1).addComponent(assignButton);
                infoChanger.change(bidComponent);
                bidChanger.change(item1);
            } else {
                ((VerticalLayout) item1).removeAllComponents();
            }
        }
    });
}