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:annis.gui.docbrowser.DocBrowserController.java

License:Apache License

public void openDocVis(String corpus, String doc, Visualizer visConfig, Button btn) {

    final String canonicalTitle = corpus + " > " + doc + " - " + "Visualizer: " + visConfig.getDisplayName();
    final String tabCaption = StringUtils.substring(canonicalTitle, 0, 15) + "...";

    if (visibleVisHolder.containsKey(canonicalTitle)) {
        Panel visHolder = visibleVisHolder.get(canonicalTitle);
        ui.getSearchView().getTabSheet().setSelectedTab(visHolder);
        return;//from  w  w w. j  av a2 s  .c o  m
    }

    Panel visHolder = new Panel();
    visHolder.setSizeFull();
    visHolder.addDetachListener(new ClientConnector.DetachListener() {
        @Override
        public void detach(ClientConnector.DetachEvent event) {
            visibleVisHolder.remove(canonicalTitle);
        }
    });

    // first set loading indicator
    ProgressBar progressBar = new ProgressBar(1.0f);
    progressBar.setIndeterminate(true);
    progressBar.setSizeFull();
    VerticalLayout layoutProgress = new VerticalLayout(progressBar);
    layoutProgress.setSizeFull();
    layoutProgress.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER);

    visHolder.setContent(layoutProgress);

    Tab visTab = ui.getSearchView().getTabSheet().addTab(visHolder, tabCaption);
    visTab.setDescription(canonicalTitle);
    visTab.setIcon(EYE_ICON);
    visTab.setClosable(true);
    ui.getSearchView().getTabSheet().setSelectedTab(visTab);

    // register visible visHolder
    this.visibleVisHolder.put(canonicalTitle, visHolder);

    Background.run(new DocVisualizerFetcher(corpus, doc, canonicalTitle, visConfig.getType(), visHolder,
            visConfig, btn, UI.getCurrent()));
}

From source file:annis.gui.resultview.ResultViewPanel.java

License:Apache License

public ResultViewPanel(AnnisUI ui, PluginSystem ps, InstanceConfig instanceConfig,
        DisplayedResultQuery initialQuery) {
    this.sui = ui;
    this.tokenAnnoVisible = new TreeMap<>();
    this.ps = ps;
    this.controller = ui.getQueryController();
    this.initialQuery = initialQuery;

    cacheResolver = Collections/*from  w ww.j a va2s  .c om*/
            .synchronizedMap(new HashMap<HashSet<SingleResolverRequest>, List<ResolverEntry>>());

    resultPanelList = Collections.synchronizedList(new LinkedList<SingleResultPanel>());

    resultLayout = new CssLayout();
    resultLayout.addStyleName("result-view-css");
    Panel resultPanel = new Panel(resultLayout);
    resultPanel.setSizeFull();
    resultPanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
    resultPanel.addStyleName("result-view-panel");

    this.instanceConfig = instanceConfig;

    setSizeFull();
    setMargin(false);

    MenuBar mbResult = new MenuBar();
    mbResult.setWidth("100%");
    mbResult.addStyleName("menu-hover");
    addComponent(mbResult);

    miSegmentation = mbResult.addItem("Base text", null);
    miTokAnnos = mbResult.addItem("Token Annotations", null);

    addComponent(resultPanel);

    setExpandRatio(mbResult, 0.0f);
    setExpandRatio(resultPanel, 1.0f);

    paging = new PagingComponent();

    addComponent(paging, 1);

    setComponentAlignment(paging, Alignment.TOP_CENTER);
    setExpandRatio(paging, 0.0f);
}

From source file:annis.visualizers.component.RawTextVisualizer.java

License:Apache License

@Override
public Panel createComponent(VisualizerInput visInput, VisualizationToggle visToggle) {

    // get config for alignment
    boolean vertical = Boolean.parseBoolean(visInput.getMappings().getProperty("vertical", "true"));

    // get the texts
    RawTextWrapper texts = visInput.getRawText();

    // create the main panel
    Panel p = new Panel();
    p.setSizeFull();

    // some layout configuration
    p.addStyleName(ChameleonTheme.PANEL_BORDERLESS);
    p.addStyleName(PANEL_CLASS);//from   w w w  . java 2  s  . c  om

    // enable webfonts
    p.addStyleName(Helper.CORPUS_FONT_FORCE);

    Layout l;

    // if no text available inform user and exit
    if (texts == null) {
        Label text = new Label(NO_TEXT);
        text.addStyleName(LABEL_CLASS);
        text.setSizeFull();
        p.setContent(text);
        return p;
    }

    if (texts.hasMultipleTexts()) {

        // set the aligmnent
        if (vertical) {
            l = new VerticalLayout();
        } else {
            l = new GridLayout(texts.getTexts().size(), 1);
        }

        // limit the size to the parent panel.
        l.setSizeFull();

        // add the texts to the layout
        for (int i = 0; i < texts.getTexts().size(); i++) {

            String s = texts.getTexts().get(i);
            Label lblText;

            // check if the text is empty
            if (s == null || hasOnlyWhiteSpace(s)) {
                lblText = new Label(NO_TEXT);
            } else {
                lblText = new Label(s, ContentMode.TEXT);
            }

            lblText.setCaption("text " + (i + 1));
            lblText.addStyleName(LABEL_CLASS);
            lblText.setWidth(98, Sizeable.Unit.PERCENTAGE);

            l.addComponent(lblText);
        }

        // apply the panel
        p.setContent(l);
        return p;
    }

    Label lblText;
    if (texts.hasTexts() && !hasOnlyWhiteSpace(texts.getFirstText())) {
        lblText = new Label(texts.getFirstText(), ContentMode.TEXT);
    } else {
        lblText = new Label(NO_TEXT);
    }

    lblText.setSizeFull();
    lblText.addStyleName(LABEL_CLASS);
    p.setContent(lblText);

    return p;
}

From source file:annis.visualizers.htmlvis.HTMLVis.java

License:Apache License

@Override
public Panel createComponent(VisualizerInput vi, VisualizationToggle vt) {
    Panel scrollPanel = new Panel();
    scrollPanel.setSizeFull();
    Label lblResult = new Label("ERROR", ContentMode.HTML);
    lblResult.setSizeUndefined();/*from   www .j a v a2s  .com*/

    List<String> corpusPath = CommonHelper.getCorpusPath(vi.getDocument().getGraph(), vi.getDocument());
    String corpusName = corpusPath.get(corpusPath.size() - 1);
    corpusName = urlPathEscape.escape(corpusName);

    String wrapperClassName = "annis-wrapped-htmlvis-" + corpusName.replaceAll("[^0-9A-Za-z-]", "_");

    scrollPanel.addStyleName(wrapperClassName);

    String visConfigName = vi.getMappings().getProperty("config");
    String hitMarkConfig = vi.getMappings().getProperty("hitmark", "true");
    hitMark = Boolean.parseBoolean(hitMarkConfig);
    mc = vi.getMarkedAndCovered();

    VisualizationDefinition[] definitions = parseDefinitions(corpusName, vi.getMappings());

    if (definitions != null) {

        lblResult.setValue(createHTML(vi.getSResult().getDocumentGraph(), definitions));

        String labelClass = vi.getMappings().getProperty("class", "htmlvis");
        lblResult.addStyleName(labelClass);

        InputStream inStreamCSSRaw = null;
        if (visConfigName == null) {
            inStreamCSSRaw = HTMLVis.class.getResourceAsStream("htmlvis.css");
        } else {
            WebResource resBinary = Helper.getAnnisWebResource().path("query/corpora/").path(corpusName)
                    .path(corpusName).path("binary").path(visConfigName + ".css");

            ClientResponse response = resBinary.get(ClientResponse.class);
            if (response.getStatus() == ClientResponse.Status.OK.getStatusCode()) {
                inStreamCSSRaw = response.getEntityInputStream();
            }
        }
        if (inStreamCSSRaw != null) {
            try (InputStream inStreamCSS = inStreamCSSRaw) {
                String cssContent = IOUtils.toString(inStreamCSS);
                UI currentUI = UI.getCurrent();
                if (currentUI instanceof AnnisBaseUI) {
                    // do not add identical CSS files
                    ((AnnisBaseUI) currentUI).injectUniqueCSS(cssContent, wrapperClassName);
                }
            } catch (IOException ex) {
                log.error("Could not parse the HTML visualizer CSS file", ex);
                Notification.show("Could not parse the HTML visualizer CSS file", ex.getMessage(),
                        Notification.Type.ERROR_MESSAGE);
            }
        }

    }

    if (vi.getMappings().containsKey("debug")) {
        TextArea txtDebug = new TextArea();
        txtDebug.setValue(lblResult.getValue());
        txtDebug.setReadOnly(true);
        txtDebug.setWidth("100%");
        Label sep = new Label("<hr/>", ContentMode.HTML);
        VerticalLayout layout = new VerticalLayout(txtDebug, sep, lblResult);
        layout.setSizeUndefined();
        scrollPanel.setContent(layout);
    } else {
        scrollPanel.setContent(lblResult);
    }

    return scrollPanel;
}

From source file:at.peppol.webgui.app.components.InvoiceForm.java

License:Mozilla Public License

private void initElements() {

    final GridLayout grid = new GridLayout(4, 4);
    final VerticalLayout outerLayout = new VerticalLayout();

    final Panel outerPanel = new Panel("Invoice Header");

    outerPanel.addComponent(grid);// w w w  .ja  va 2 s .  c o m
    outerPanel.setScrollable(true);
    outerLayout.addComponent(outerPanel);
    setLayout(outerLayout);

    final Panel invoiceDetailsPanel = new Panel("Invoice Details");
    invoiceDetailsPanel.setStyleName("light");
    invoiceDetailsPanel.setSizeFull();
    invoiceDetailsPanel.addComponent(createInvoiceTopForm());
    grid.addComponent(invoiceDetailsPanel, 0, 0, 3, 0);
    grid.setSizeUndefined();

    outerPanel.requestRepaintAll();
}

From source file:at.peppol.webgui.app.components.PartyDetailForm.java

License:Mozilla Public License

private Panel createLegalEntityPanel(Button removeButton) {
    Panel legalEntityPanel = new Panel("Legal Entity");
    legalEntityPanel.setStyleName("light");
    legalEntityPanel.setSizeFull();

    PropertysetItem legalEntityItemSet = new PropertysetItem();

    PartyLegalEntityType legalEntity;/*from  w  w  w .  ja va 2s  . c  o  m*/
    if (partyBean.getPartyLegalEntity().size() == 0) {
        legalEntity = new PartyLegalEntityType();
        legalEntity.setRegistrationName(new RegistrationNameType());
        legalEntity.setCompanyID(new CompanyIDType());
        legalEntity.setRegistrationAddress(new AddressType());
        legalEntity.getRegistrationAddress().setCityName(new CityNameType());
        legalEntity.getRegistrationAddress().setCountrySubentity(new CountrySubentityType());
        legalEntity.getRegistrationAddress().setCountry(new CountryType());
        legalEntity.getRegistrationAddress().getCountry().setIdentificationCode(new IdentificationCodeType());
    } else {
        legalEntity = partyBean.getPartyLegalEntity().get(0);
    }
    //make fields
    legalEntityItemSet.addItemProperty("Registration Name",
            new NestedMethodProperty(legalEntity, "registrationName.value"));
    legalEntityItemSet.addItemProperty("Company ID", new NestedMethodProperty(legalEntity, "companyID.value"));
    legalEntityItemSet.addItemProperty("City Name",
            new NestedMethodProperty(legalEntity.getRegistrationAddress(), "cityName.value"));
    legalEntityItemSet.addItemProperty("Country Subentity",
            new NestedMethodProperty(legalEntity.getRegistrationAddress(), "countrySubentity.value"));
    legalEntityItemSet.addItemProperty("Country ID",
            new NestedMethodProperty(legalEntity.getRegistrationAddress(), "country.identificationCode.value"));

    legalEntityForm = new Form();
    legalEntityForm.setFormFieldFactory(new PartyFieldFactory());
    legalEntityForm.setItemDataSource(legalEntityItemSet);
    legalEntityForm.setImmediate(true);
    legalEntityPanel.addComponent(legalEntityForm);
    legalEntityPanel.addComponent(removeButton);

    //add the legal entity
    partyBean.getPartyLegalEntity().add(legalEntity);

    return legalEntityPanel;
}

From source file:at.peppol.webgui.app.components.TabInvoiceDelivery.java

License:Mozilla Public License

private void initElements() {
    deliveryList = parent.getInvoice().getDelivery();
    if (deliveryList.size() == 0) {
        deliveryItem = createDeliveryItem();
        deliveryList.add(deliveryItem);/*w w w .jav a 2  s  .c o  m*/
    } else {
        deliveryItem = deliveryList.get(0);
        deliveryAddress = deliveryItem.getDeliveryLocation().getAddress();
        prepareForms();
    }

    final GridLayout grid = new GridLayout(2, 2);
    final VerticalLayout outerLayout = new VerticalLayout();

    final Panel outerPanel = new Panel("Delivery");
    outerPanel.addComponent(grid);
    outerPanel.setScrollable(true);
    outerLayout.addComponent(outerPanel);

    final Panel invoiceDetailsPanel = new Panel("Delivery Details");
    invoiceDetailsPanel.setStyleName("light");
    invoiceDetailsPanel.setSizeFull();
    invoiceDetailsPanel.addComponent(createInvoiceDeliveryTopForm());
    invoiceDetailsPanel.addComponent(deliveryAddressForm);
    grid.addComponent(invoiceDetailsPanel, 0, 0);
    grid.setSizeUndefined();

    setLayout(outerLayout);
    outerPanel.requestRepaintAll();
}

From source file:at.peppol.webgui.app.components.TabInvoiceMonetaryTotal.java

License:Mozilla Public License

private void initElements() {
    // monetaryTotal = parent.getInvoice().getLegalMonetaryTotal ();
    monetaryTotal = createMonetaryTotal();
    parent.getInvoice().setLegalMonetaryTotal(monetaryTotal);

    final GridLayout grid = new GridLayout(4, 4);
    final VerticalLayout outerLayout = new VerticalLayout();

    final Panel outerPanel = new Panel("Monetary Total");
    outerPanel.addComponent(grid);/*from   www  . j  av  a  2s  . c o m*/
    outerPanel.setScrollable(true);
    outerLayout.addComponent(outerPanel);

    final Panel invoiceDetailsPanel = new Panel("Monetary Total Details");
    invoiceDetailsPanel.setStyleName("light");
    invoiceDetailsPanel.setSizeFull();
    invoiceMonetaryTotalTopForm = createInvoiceMonetaryTotalTopForm();
    invoiceDetailsPanel.addComponent(invoiceMonetaryTotalTopForm);
    //invoiceDetailsPanel.addComponent (createInvoiceMonetaryTotalTopForm ());
    grid.addComponent(invoiceDetailsPanel, 0, 0, 3, 0);
    grid.setSizeUndefined();

    //Add the Total Line Extension Amount Listener

    setLayout(outerLayout);
    outerPanel.requestRepaintAll();
}

From source file:at.peppol.webgui.app.components.TabInvoicePayment.java

License:Mozilla Public License

@SuppressWarnings("serial")
private void initElements() {
    editMode = false;/*from   w  w  w.  j  a v  a  2 s  .  c  om*/
    paymentMeansList = parent.getInvoice().getPaymentMeans();
    //paymentMeansItem = createPaymentMeansItem();
    //paymentMeansList.add (paymentMeansItem);

    //paymentTermsList = parent.getInvoice().getPaymentTerms ();
    //PaymentTermsType pt = new PaymentTermsType();
    //paymentTermsList.add (pt);

    if (parent.getInvoice().getPaymentTerms().size() == 0) {
        paymentTermsItem = new PaymentTermsType();
        paymentTermsItem.getNote().add(new NoteType());
        parent.getInvoice().getPaymentTerms().add(paymentTermsItem);
    } else {
        paymentTermsItem = parent.getInvoice().getPaymentTerms().get(0);
    }

    //payeeParty = parent.getInvoice().getPayeeParty ();
    if (parent.getInvoice().getPayeeParty() == null) {
        payeeParty = createPayeePartyItem();
        parent.getInvoice().setPayeeParty(payeeParty);
    } else {
        payeeParty = parent.getInvoice().getPayeeParty();
    }
    //payeeParty = new PartyType();
    //payeeParty.setParty(new PartyType());

    hiddenContent = new VerticalLayout();
    hiddenContent.setSpacing(true);
    hiddenContent.setMargin(true);

    final GridLayout grid = new GridLayout(2, 2);
    grid.setSpacing(true);
    //grid.setMargin(true);
    final VerticalLayout outerLayout = new VerticalLayout();

    final Panel outerPanel = new Panel("Payment");
    outerPanel.addComponent(grid);
    outerPanel.setScrollable(true);
    outerLayout.addComponent(outerPanel);

    final Panel invoiceDetailsPanel = new Panel("Payment Details");
    invoiceDetailsPanel.setStyleName("light");
    invoiceDetailsPanel.setSizeFull();
    //invoiceDetailsPanel.addComponent(createInvoicePaymentTopForm());
    //grid.addComponent(invoiceDetailsPanel, 0, 0);

    final Panel payeePartyPanel = new Panel("Payee Details");
    payeePartyPanel.setStyleName("light");
    payeePartyPanel.setSizeFull();
    payeePartyPanel.addComponent(createInvoicePayeePartyForm());
    //payeeForm = new PartyDetailForm("Payee", payeeParty);
    //payeePartyPanel.addComponent(payeeForm);
    grid.addComponent(payeePartyPanel, 0, 0);

    final Panel paymentTermsPanel = new Panel("Payment Terms");
    paymentTermsPanel.setStyleName("light");
    paymentTermsPanel.setSizeFull();
    paymentTermsPanel.addComponent(createInvoicePaymentTermsForm());
    grid.addComponent(paymentTermsPanel, 1, 0);

    final Panel paymentMeansPanel = new Panel("Payment Means");
    VerticalLayout paymentMeansLayout = new VerticalLayout();
    paymentMeansPanel.setContent(paymentMeansLayout);
    paymentMeansPanel.setStyleName("light");
    paymentMeansPanel.setSizeFull();
    paymentMeansLayout.setSpacing(true);
    paymentMeansLayout.setMargin(true);

    table = new PaymentMeansTable(paymentMeansList);
    table.setSelectable(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setHeight(200, UNITS_PIXELS);
    table.setSizeFull();
    table.setWidth("80%");
    table.setFooterVisible(false);
    table.addStyleName("striped strong");

    HorizontalLayout tableLayout = new HorizontalLayout();
    paymentMeansLayout.addComponent(tableLayout);
    paymentMeansLayout.addComponent(hiddenContent);
    hiddenContent.setVisible(false);

    VerticalLayout tableButtonsLayout = new VerticalLayout();
    tableButtonsLayout.setSpacing(true);
    tableButtonsLayout.setMargin(true);
    final Button addButton = new Button("Add new");
    final Button editButton = new Button("Edit selected");
    final Button deleteButton = new Button("Delete selected");
    tableButtonsLayout.addComponent(addButton);
    tableButtonsLayout.addComponent(editButton);
    tableButtonsLayout.addComponent(deleteButton);

    tableLayout.addComponent(table);
    tableLayout.addComponent(tableButtonsLayout);

    outerPanel.addComponent(paymentMeansPanel);

    grid.setSizeUndefined();

    PaymentMeansTableEditor editor = new PaymentMeansTableEditor(editMode, parent.getInvoice());
    Label label = new Label("<h3>Adding new payments means</h3>", Label.CONTENT_XHTML);
    addButton.addListener(
            editor.addButtonListener(editButton, deleteButton, hiddenContent, table, paymentMeansList, label));
    label = new Label("<h3>Edit payment means line</h3>", Label.CONTENT_XHTML);
    editButton.addListener(
            editor.editButtonListener(addButton, deleteButton, hiddenContent, table, paymentMeansList, label));
    deleteButton.addListener(editor.deleteButtonListener(table));

    setLayout(outerLayout);
    outerPanel.requestRepaintAll();
}

From source file:at.peppol.webgui.app.components.TabInvoiceTaxTotal.java

License:Mozilla Public License

@SuppressWarnings("serial")
private void initElements() {
    taxTotalList = parent.getInvoice().getTaxTotal();
    if (taxTotalList.size() == 0) {
        taxTotalItem = createTaxTotalItem();
        taxTotalList.add(taxTotalItem);//ww  w  .j a  va  2 s . co  m
    } else {
        taxTotalItem = taxTotalList.get(0);
    }

    //taxSubtotalList = parent.getInvoice ().getTaxTotal ().get (0).getTaxSubtotal ();
    taxSubtotalList = taxTotalItem.getTaxSubtotal();

    final GridLayout grid = new GridLayout(4, 4);
    final VerticalLayout outerLayout = new VerticalLayout();
    hiddenContent = new VerticalLayout();
    hiddenContent.setSpacing(true);
    hiddenContent.setMargin(true);

    final Panel outerPanel = new Panel("Tax Total");
    outerPanel.addComponent(grid);
    outerPanel.setScrollable(true);
    outerLayout.addComponent(outerPanel);

    table = new InvoiceTaxSubtotalTable(taxTotalList.get(0).getTaxSubtotal());
    table.setSelectable(true);
    table.setImmediate(true);
    table.setNullSelectionAllowed(false);
    table.setHeight(150, UNITS_PIXELS);
    table.setFooterVisible(true);
    table.addStyleName("striped strong");
    final VerticalLayout tableContainer = new VerticalLayout();
    tableContainer.addComponent(table);
    tableContainer.setMargin(false, true, false, false);

    Button addButton = new Button("Add new");
    Button editButton = new Button("Edit selected");
    Button deleteButton = new Button("Delete selected");

    final VerticalLayout buttonsContainer = new VerticalLayout();
    buttonsContainer.setSpacing(true);
    buttonsContainer.addComponent(addButton);
    buttonsContainer.addComponent(editButton);
    buttonsContainer.addComponent(deleteButton);

    InvoiceTaxSubtotalTableEditor editor = new InvoiceTaxSubtotalTableEditor(editMode);
    Label label = new Label("<h3>Adding new tax subtotal</h3>", Label.CONTENT_XHTML);
    addButton.addListener(
            editor.addButtonListener(editButton, deleteButton, hiddenContent, table, taxSubtotalList, label));
    label = new Label("<h3>Edit tax subtotal</h3>", Label.CONTENT_XHTML);
    editButton.addListener(
            editor.editButtonListener(addButton, deleteButton, hiddenContent, table, taxSubtotalList, label));
    deleteButton.addListener(editor.deleteButtonListener(table));

    /*    // buttons Add, Edit, Delete
        final Button addBtn = new Button ("Add New", new Button.ClickListener () {
          @Override
          public void buttonClick (final Button.ClickEvent event) {
            
            addMode = true;
            hiddenContent.removeAllComponents ();
            taxSubtotalItem = createTaxSubtotalItem ();
            
            final Label formLabel = new Label ("<h3>Adding new tax subtotal line</h3>", Label.CONTENT_XHTML);
            
            hiddenContent.addComponent (formLabel);
            hiddenContent.addComponent (createInvoiceTaxSubtotalForm ());
            
            // Save new line button
            final HorizontalLayout buttonLayout = new HorizontalLayout ();
            buttonLayout.setSpacing (true);
            buttonLayout.addComponent (new Button ("Save tax subtotal line", new Button.ClickListener () {
              @Override
              public void buttonClick (final ClickEvent event) {
    // update table (and consequently add new item to taxSubtotalList
    // list)
    table.addTaxSubtotalLine (taxSubtotalItem);
    // hide form
    hiddenContent.setVisible (false);
    addMode = false;
            
    // update Total Tax Amount
    taxTotalItem.getTaxAmount ().setValue (SumTaxSubtotalAmount ());
            
    // update form as well
    // invoiceTaxTotalTopForm.getField("Tax Total Amount").setRequired(true);
    invoiceTaxTotalTopForm.getField ("Tax Total Amount").setValue (taxTotalItem.getTaxAmount ().getValue ());
              }
            }));
            buttonLayout.addComponent (new Button ("Cancel", new Button.ClickListener () {
              @Override
              public void buttonClick (final ClickEvent event) {
    hiddenContent.removeAllComponents ();
    // hide form
    hiddenContent.setVisible (false);
    addMode = false;
              }
            }));
            
            hiddenContent.addComponent (buttonLayout);
            
            // hiddenContent.setVisible(!hiddenContent.isVisible());
            hiddenContent.setVisible (true);
            
          }
        });
        final Button editBtn = new Button ("Edit Selected", new Button.ClickListener () {
          @Override
          public void buttonClick (final Button.ClickEvent event) {
            /*
             * Object rowId = table.getValue(); // get the selected rows id if(rowId
             * != null){ if(addMode || editMode){ parent.getWindow
             * ().showNotification("Info", "You cannot edit while in add/edit mode",
             * Window.Notification.TYPE_HUMANIZED_MESSAGE); return; } final String
             * sid =
             * (String)table.getContainerProperty(rowId,"ID.value").getValue(); //
             * TODO: PUT THIS IN FUNCTION BEGINS editMode = true;
             * hiddenContent.removeAllComponents (); //get selected item
             * allowanceChargeItem = (InvoiceAllowanceChargeAdapter)
             * allowanceChargeList.get (table.getIndexFromID (sid)); //clone it to
             * original item originalItem = new InvoiceAllowanceChargeAdapter ();
             * cloneInvoiceAllowanceChargeItem(allowanceChargeItem, originalItem);
             * Label formLabel = new Label("<h3>Editing allowance charge line</h3>",
             * Label.CONTENT_XHTML); hiddenContent.addComponent (formLabel);
             * hiddenContent.addComponent(createInvoiceAllowanceChargeForm());
             * //Save new line button HorizontalLayout buttonLayout = new
             * HorizontalLayout(); buttonLayout.setSpacing (true);
             * buttonLayout.addComponent(new Button("Save changes",new
             * Button.ClickListener(){
             * @Override public void buttonClick (ClickEvent event) { //update table
             * (and consequently edit item to allowanceChargeList list)
             * table.setAllowanceChargeLine (sid, allowanceChargeItem); //hide form
             * hiddenContent.setVisible(false); editMode = false; } }));
             * buttonLayout.addComponent(new Button("Cancel editing",new
             * Button.ClickListener(){
             * @Override public void buttonClick (ClickEvent event) {
             * hiddenContent.removeAllComponents (); table.setAllowanceChargeLine
             * (sid, originalItem); //hide form hiddenContent.setVisible(false);
             * editMode = false; } })); hiddenContent.addComponent(buttonLayout);
             * //hiddenContent.setVisible(!hiddenContent.isVisible());
             * hiddenContent.setVisible(true); // TODO: PUT THIS IN FUNCTION ENDS }
             * else { parent.getWindow ().showNotification("Info",
             * "No table line is selected",
             * Window.Notification.TYPE_HUMANIZED_MESSAGE); }
             */
    /*      }
        });
        editBtn.setEnabled (false);
        final Button deleteBtn = new Button ("Delete Selected", new Button.ClickListener () {
          @Override
          public void buttonClick (final Button.ClickEvent event) {
            
            final Object rowId = table.getValue (); // get the selected rows id
            if (rowId != null) {
              if (addMode || editMode) {
    parent.getWindow ().showNotification ("Info",
                                          "You cannot delete while in add/edit mode",
                                          Window.Notification.TYPE_HUMANIZED_MESSAGE);
    return;
              }
              if (table.getContainerProperty (rowId, "TableLineID").getValue () != null) {
    final String sid = (String) table.getContainerProperty (rowId, "TableLineID").getValue ();
    table.removeTaxSubtotalLine (sid);
            
    // update Total Tax Amount
    taxTotalItem.getTaxAmount ().setValue (SumTaxSubtotalAmount ());
            
    invoiceTaxTotalTopForm.getField ("Tax Total Amount").setValue (taxTotalItem.getTaxAmount ().getValue ());
            
              }
            }
            else {
              parent.getWindow ().showNotification ("Info",
                                        "No table line is selected",
                                        Window.Notification.TYPE_HUMANIZED_MESSAGE);
            
            }
            
          }
        });*/

    final Panel invoiceDetailsPanel = new Panel("Tax Total Details");
    invoiceDetailsPanel.setStyleName("light");
    invoiceDetailsPanel.setSizeFull();
    invoiceDetailsPanel.addComponent(createInvoiceTaxTotalTopForm());

    table.addListener(new ItemSetChangeListener() {

        @Override
        public void containerItemSetChange(ItemSetChangeEvent event) {
            Field f = invoiceTaxTotalTopForm.getField(taxTotalAmount);
            f.setValue(addTaxSubTotals());
        }

    });

    grid.setSpacing(true);
    grid.addComponent(invoiceDetailsPanel, 0, 0);
    grid.addComponent(tableContainer, 0, 1);
    grid.addComponent(buttonsContainer, 1, 1);
    grid.setSizeUndefined();

    // ---- HIDDEN FORM BEGINS -----
    final VerticalLayout formLayout = new VerticalLayout();
    formLayout.addComponent(hiddenContent);
    hiddenContent.setVisible(false);
    outerLayout.addComponent(formLayout);
    // ---- HIDDEN FORM ENDS -----

    setLayout(outerLayout);
    outerPanel.requestRepaintAll();
}