Example usage for com.google.gwt.user.client.ui FlexTable getRowCount

List of usage examples for com.google.gwt.user.client.ui FlexTable getRowCount

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui FlexTable getRowCount.

Prototype

@Override
public int getRowCount() 

Source Link

Document

Gets the number of rows.

Usage

From source file:com.square.composant.contrat.square.client.view.ContratContenuViewImpl.java

License:Open Source License

@Override
public void chargerGarantieAjustement(final List<AjustementTarifModel> listesAjustements) {
    // Tableau des ajustements
    final Label lReference = new Label(viewConstants.titreColonneAjustementReference());
    final Label lLibelle = new Label(viewConstants.titreColonneAjustementLibelle());
    final Label lTarif = new Label(viewConstants.titreColonneAjustementTarif());
    final Label lDateDebut = new Label(viewConstants.titreColonneAjustementDateDebut());
    final Label lDateFin = new Label(viewConstants.titreColonneAjustementDateFin());

    final FlexTable panelTableauAjustements = new FlexTable();
    panelTableauAjustements.setWidth(ContratsViewImplConstants.POURCENT_100);
    panelTableauAjustements.setStylePrimaryName(resources.css().tableau());
    panelTableauAjustements.setCellPadding(6);
    panelTableauAjustements.setWidget(0, 0, lReference);
    panelTableauAjustements.setWidget(0, 1, lLibelle);
    panelTableauAjustements.setWidget(0, 2, lTarif);
    panelTableauAjustements.setWidget(0, 3, lDateDebut);
    panelTableauAjustements.setWidget(0, 4, lDateFin);
    panelTableauAjustements.getRowFormatter().setStyleName(0, resources.css().ligneEnteteColonne());
    for (int idxCol = 0; idxCol < 5; idxCol++) {
        panelTableauAjustements.getFlexCellFormatter().setHorizontalAlignment(0, idxCol,
                HasHorizontalAlignment.ALIGN_CENTER);
    }/*from  w w  w .  j av a 2s .  com*/

    for (AjustementTarifModel ajustement : listesAjustements) {
        final ContratGarantieAjustementViewImpl viewAjustement = new ContratGarantieAjustementViewImpl(
                ajustement);
        final int indexSuivant = panelTableauAjustements.getRowCount();
        panelTableauAjustements.setWidget(indexSuivant, 0, viewAjustement.getLabelReference());
        panelTableauAjustements.setWidget(indexSuivant, 1, viewAjustement.getLabelLibelle());
        panelTableauAjustements.setWidget(indexSuivant, 2, viewAjustement.getLabelTarif());
        panelTableauAjustements.setWidget(indexSuivant, 3, viewAjustement.getLabelDateDebut());
        panelTableauAjustements.setWidget(indexSuivant, 4, viewAjustement.getLabelDateFin());
        panelTableauAjustements.getFlexCellFormatter().setHorizontalAlignment(indexSuivant, 2,
                HasHorizontalAlignment.ALIGN_RIGHT);
        panelTableauAjustements.getFlexCellFormatter().setHorizontalAlignment(indexSuivant, 3,
                HasHorizontalAlignment.ALIGN_CENTER);
        panelTableauAjustements.getFlexCellFormatter().setHorizontalAlignment(indexSuivant, 4,
                HasHorizontalAlignment.ALIGN_CENTER);
    }

    // Ajustements
    final CaptionPanel captionPanelAjustements = new CaptionPanel(viewConstants.titreAjustements());
    captionPanelAjustements.add(panelTableauAjustements);
    conteneurGlobal.add(captionPanelAjustements);
}

From source file:com.square.composant.espace.client.square.client.view.espaceadherent.BlocOptionsAdherentViewImpl.java

License:Open Source License

/**
 * Construit le Widget encapsul dans la vue.
 * @return le widget encapsul./*from   w w  w  .  j a  va 2 s .  c o m*/
 */
private Widget construireBlocOptions() {
    lOptionSms = new Label(viewConstants.labelOptionDesactive());
    lOptionMutuellement = new Label(viewConstants.labelOptionDesactive());
    lOptionRelevesPrestation = new Label(viewConstants.labelOptionDesactive());
    rbtnOptionSmsActive = new RadioButton(viewConstants.labelOptionSms());
    rbtnOptionSmsDesactive = new RadioButton(viewConstants.labelOptionSms());
    rbtnOptionSmsDesactive.setValue(true);
    rbtnOptionMutuellementActive = new RadioButton(viewConstants.labelOptionMutuellement());
    rbtnOptionMutuellementDesactive = new RadioButton(viewConstants.labelOptionMutuellement());
    rbtnOptionMutuellementDesactive.setValue(true);
    rbtnOptionRelevesPrestationsActive = new RadioButton(viewConstants.labelOptionRelevesPrestations());
    rbtnOptionRelevesPrestationsDesactive = new RadioButton(viewConstants.labelOptionRelevesPrestations());
    rbtnOptionRelevesPrestationsDesactive.setValue(true);
    lDateModifOptionSms = new Label(viewConstants.aucuneDate());
    lDateModifOptionMensuellement = new Label(viewConstants.aucuneDate());
    lDateModifOptionRelevesPrestations = new Label(viewConstants.aucuneDate());
    btnEnregistrerOptions = new DecoratedButton(viewConstants.captionEnregistrerOptions());

    final FlexTable ftEditionOptions = new FlexTable();
    ftEditionOptions.setStylePrimaryName(EspaceClientPresenter.RESOURCES.css().tableauOptions());
    ftEditionOptions.setCellPadding(6);
    ftEditionOptions.setWidget(0, 1, new Label(viewConstants.labelOptionActive()));
    ftEditionOptions.setWidget(0, 2, new Label(viewConstants.labelOptionDesactive()));
    ftEditionOptions.setWidget(0, 3, new Label(viewConstants.labelDateModification()));
    ftEditionOptions.setWidget(1, 0, new Label(viewConstants.labelOptionSms()));
    ftEditionOptions.setWidget(1, 1, rbtnOptionSmsActive);
    ftEditionOptions.setWidget(1, 2, rbtnOptionSmsDesactive);
    ftEditionOptions.setWidget(1, 3, lDateModifOptionSms);
    ftEditionOptions.setWidget(2, 0, new Label(viewConstants.labelOptionMutuellement()));
    ftEditionOptions.setWidget(2, 1, rbtnOptionMutuellementActive);
    ftEditionOptions.setWidget(2, 2, rbtnOptionMutuellementDesactive);
    ftEditionOptions.setWidget(2, 3, lDateModifOptionMensuellement);
    ftEditionOptions.setWidget(3, 0, new Label(viewConstants.labelOptionRelevesPrestations()));
    ftEditionOptions.setWidget(3, 1, rbtnOptionRelevesPrestationsActive);
    ftEditionOptions.setWidget(3, 2, rbtnOptionRelevesPrestationsDesactive);
    ftEditionOptions.setWidget(3, 3, lDateModifOptionRelevesPrestations);
    ftEditionOptions.getCellFormatter().setStylePrimaryName(0, 0,
            EspaceClientPresenter.RESOURCES.css().celluleSansBordure());
    ftEditionOptions.getCellFormatter().setStylePrimaryName(0, 1,
            EspaceClientPresenter.RESOURCES.css().celluleEnteteColonne());
    ftEditionOptions.getCellFormatter().setStylePrimaryName(0, 2,
            EspaceClientPresenter.RESOURCES.css().celluleEnteteColonne());
    ftEditionOptions.getCellFormatter().setStylePrimaryName(0, 3,
            EspaceClientPresenter.RESOURCES.css().celluleEnteteColonne());
    ftEditionOptions.getCellFormatter().setStylePrimaryName(1, 0,
            EspaceClientPresenter.RESOURCES.css().celluleEnteteLigne());
    ftEditionOptions.getCellFormatter().setStylePrimaryName(2, 0,
            EspaceClientPresenter.RESOURCES.css().celluleEnteteLigne());
    ftEditionOptions.getCellFormatter().setStylePrimaryName(3, 0,
            EspaceClientPresenter.RESOURCES.css().celluleEnteteLigne());

    final int nbRows = ftEditionOptions.getRowCount();
    for (int i = 0; i < nbRows; i++) {
        ftEditionOptions.getCellFormatter().setHorizontalAlignment(i, 1, HasHorizontalAlignment.ALIGN_CENTER);
        ftEditionOptions.getCellFormatter().setHorizontalAlignment(i, 2, HasHorizontalAlignment.ALIGN_CENTER);
        ftEditionOptions.getCellFormatter().setHorizontalAlignment(i, 3, HasHorizontalAlignment.ALIGN_CENTER);
    }
    ftEditionOptions.getColumnFormatter().setWidth(0, BlocOptionsAdherentViewImplConstants.LARGEUR_COL);
    ftEditionOptions.getColumnFormatter().setWidth(1, BlocOptionsAdherentViewImplConstants.LARGEUR_COL);
    ftEditionOptions.getColumnFormatter().setWidth(2, BlocOptionsAdherentViewImplConstants.LARGEUR_COL);
    ftEditionOptions.getColumnFormatter().setWidth(3, BlocOptionsAdherentViewImplConstants.LARGEUR_COL);

    final VerticalPanel conteneur = new VerticalPanel();
    conteneur.setSpacing(10);
    conteneur.setWidth(ComposantEspaceClientConstants.POURCENT_100);
    conteneur.add(ftEditionOptions);
    conteneur.add(btnEnregistrerOptions);
    conteneur.setCellHorizontalAlignment(ftEditionOptions, HasAlignment.ALIGN_CENTER);
    conteneur.setCellHorizontalAlignment(btnEnregistrerOptions, HasAlignment.ALIGN_CENTER);

    final List<ChampSynthese> listeChamps = new ArrayList<ChampSynthese>();
    listeChamps.add(new ChampSynthese(lOptionSms, viewConstants.labelOptionSms(), false));
    listeChamps.add(new ChampSynthese(lOptionMutuellement, viewConstants.labelOptionMutuellement(), false));
    listeChamps.add(
            new ChampSynthese(lOptionRelevesPrestation, viewConstants.labelOptionRelevesPrestations(), false));
    final BlocSyntheseDepliant blocOptions = new BlocSyntheseDepliant(listeChamps, conteneur);
    blocOptions.setStylePrimaryName(EspaceClientPresenter.RESOURCES.css().blocSyntheseDepliant());

    final CaptionPanel cpOptions = new CaptionPanel(viewConstants.captionBlocOptions());
    cpOptions.add(blocOptions);
    return cpOptions;
}

From source file:de.metanome.frontend.client.algorithms.AlgorithmsPage.java

License:Apache License

/**
 * Adds each of the algorithms to the given table, including formatting and buttons.
 *
 * @param algorithms the algorithms to be displayed
 * @param table      the table to which the algorithms will be added
 *///from  w  w w . j a v  a  2  s .c  o m
protected void addAlgorithmsToTable(List<Algorithm> algorithms, FlexTable table) {
    int row = table.getRowCount();
    Collections.sort(algorithms);

    for (final Algorithm algorithm : algorithms) {
        // Using the HTML title to associate an algorithm with each button.
        Button runButton = new Button("Run");
        runButton.setTitle(algorithm.getName());
        runButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                callRunConfiguration(((Button) event.getSource()).getTitle());
            }
        });

        Button deleteButton = new Button("Delete");
        deleteButton.setTitle(algorithm.getName());
        deleteButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                deleteAlgorithm(algorithm);
            }
        });

        table.setWidget(row, 0, new HTML("<b>" + algorithm.getName() + "</b>"));
        table.setText(row, 1, "Author: " + algorithm.getAuthor());
        table.setText(row, 2, "File: " + algorithm.getFileName());
        table.setText(row, 3, "Description: " + algorithm.getDescription());
        table.setWidget(row, 4, runButton);
        table.setWidget(row, 5, deleteButton);
        row++;
    }
}

From source file:de.metanome.frontend.client.algorithms.AlgorithmsPage.java

License:Apache License

/**
 * Removes the row, which contains the given algorithm Name, from the given table
 *
 * @param table         the table//from   w  w w  .j  ava2s .c o m
 * @param algorithmName the algorithm name
 */
protected void removeRow(FlexTable table, String algorithmName) {
    int row = 0;
    while (row < table.getRowCount()) {
        // Check if the file name cell contains the given algorithm name
        if (((HTML) table.getWidget(row, 0)).getText().equals(algorithmName)) {
            table.removeRow(row);
            return;
        }
        row++;
    }
}

From source file:de.metanome.frontend.client.datasources.FileInputEditForm.java

License:Apache License

/**
 * Add another user input row to the bottom of the given table
 *
 * @param table       the UI object on which to add the row
 * @param inputWidget the widget to be used for input
 * @param name        the name of the input property
 *//*from   w  ww  .  j a  v  a2s . c o m*/
protected void addRow(FlexTable table, Widget inputWidget, String name) {
    int row = table.getRowCount();
    table.setText(row, 0, name);
    table.setWidget(row, 1, inputWidget);
}

From source file:edu.cudenver.bios.glimmpse.client.panels.MatrixDisplayPanel.java

License:Open Source License

public FlexTable buildFixedRandomMatrixGrid(Node matrixNode, String randomValue) {
    FlexTable table = new FlexTable();
    table.setBorderWidth(1);/*from ww w  .  j  a  va 2s .co  m*/
    if (matrixNode != null) {
        NamedNodeMap frAttrs = matrixNode.getAttributes();
        boolean combineHorizontal = true;
        Node combineHorizontalNode = frAttrs.getNamedItem(GlimmpseConstants.ATTR_COMBINE_HORIZONTAL);
        if (combineHorizontalNode != null)
            combineHorizontal = Boolean.parseBoolean(combineHorizontalNode.getNodeValue());

        Node fixedNode = null;
        Node randomNode = null;
        NodeList children = matrixNode.getChildNodes();
        for (int i = 0; i < children.getLength() && (fixedNode == null || randomNode == null); i++) {
            Node child = children.item(i);
            if (GlimmpseConstants.TAG_MATRIX.equals(child.getNodeName())) {
                NamedNodeMap attrs = child.getAttributes();
                Node nameNode = attrs.getNamedItem(GlimmpseConstants.ATTR_NAME);
                if (GlimmpseConstants.MATRIX_FIXED.equals(nameNode.getNodeValue()))
                    fixedNode = child;
                else if (GlimmpseConstants.MATRIX_FIXED.equals(nameNode.getNodeValue()))
                    randomNode = child;
            }
        }

        int startRow = 0;
        int startCol = 0;
        if (fixedNode != null) {
            addMatrixData(fixedNode, table, startRow, startCol);
        }
        if (randomNode != null) {
            if (combineHorizontal) {
                startCol = table.getCellCount(0);
            } else {
                startRow = table.getRowCount();
            }
            addMatrixData(fixedNode, table, startRow, startCol);

        }
    }

    return table;
}

From source file:edu.ucdenver.bios.glimmpseweb.client.guided.InteractionHypothesisPanel.java

License:Open Source License

/**
 * Find and select the radio button corresponding to the factor.  
 * If no match, then no effect.//ww w.j a v  a  2s .c  o  m
 * @param factorName name of the factor
 * @param trendType trend associated with the factor
 * @param table the between or within participant factor table
 */
private void selectCheckBoxByFactor(String factorName, HypothesisTrendTypeEnum trendType, FlexTable table) {
    for (int row = 0; row < table.getRowCount(); row++) {
        InteractionVariablePanel ivPanel = (InteractionVariablePanel) table.getWidget(row, 0);
        if (ivPanel.getLabel().equals(factorName)) {
            ivPanel.setChecked(true);
            ivPanel.setTrend(trendType);
            selectedCount++;
            break;
        }
    }
}

From source file:edu.ucdenver.bios.glimmpseweb.client.guided.MainEffectHypothesisPanel.java

License:Open Source License

/**
 * Find and select the radio button corresponding to the factor.  
 * If no match, then no effect.// ww w  .j a  va  2  s . co m
 * @param factorName name of the factor
 * @param table the between or within participant factor table
 * @return true if a match is found
 */
private boolean selectRadioButtonByFactor(String factorName, FlexTable table) {
    for (int row = 0; row < table.getRowCount(); row++) {
        RadioButton rb = (RadioButton) table.getWidget(row, RADIO_BUTTON_COLUMN);
        if (rb.getText().equals(factorName)) {
            rb.setValue(true);
            return true;
        }
    }
    return false;
}

From source file:fast.mediation.client.DataTransformationTool.java

License:Open Source License

private void rebuildOperatorTabs() {
    // remove old tabs
    int widgetCount = tabPanel.getWidgetCount();
    while (widgetCount > 1) {
        tabPanel.remove(widgetCount - 1);
        widgetCount = tabPanel.getWidgetCount();
    }//  w w w  .j a  va  2s .  c  om

    // general tab
    FlexTable generalInformationTable = new FlexTable();
    FlexCellFormatter generalInfoFormatter = generalInformationTable.getFlexCellFormatter();
    generalInformationTable.addStyleName("cw-FlexTable");
    generalInformationTable.setWidth("32em");
    generalInformationTable.setCellSpacing(5);
    generalInformationTable.setCellPadding(3);
    generalInfoFormatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
    generalInfoFormatter.setColSpan(0, 0, 2);

    int rowCount = generalInformationTable.getRowCount();

    // add label and nameTextBox
    Label nameLabel = new Label("Name:");
    generalInformationTable.setWidget(rowCount, 0, nameLabel);
    rowCount++;
    nameTextBox = CTextChangeHandler.createTextBox(trafoOperator, "name");
    generalInformationTable.setWidget(rowCount, 0, nameTextBox);
    rowCount++;

    // add form for input fact
    portGUI = new PortGUI(this, trafoOperator, true);
    Widget inputPortTable = portGUI.createInputPortTable();
    generalInformationTable.setWidget(rowCount, 0, inputPortTable);
    rowCount++;

    // add form for output fact
    portGUI = new PortGUI(this, trafoOperator, true);
    Widget outputPortTable = portGUI.createOutputPortTable();
    generalInformationTable.setWidget(rowCount, 0, outputPortTable);
    rowCount++;

    // add to tab panel
    tabPanel.add(generalInformationTable, new TabWidget("General"));

    refreshRuleAndCodeTab();
}

From source file:fast.mediation.client.DataTransformationTool.java

License:Open Source License

public void refreshRuleAndCodeTab() {
    // remove old tabs
    int widgetCount = tabPanel.getWidgetCount();
    while (widgetCount > 2) {
        tabPanel.remove(widgetCount - 1);
        widgetCount = tabPanel.getWidgetCount();
    }//from  www.  j a va  2s .  co  m

    // transformation tab
    FlexTable transformationTable = new FlexTable();
    FlexCellFormatter transformationTableCellFormatter = transformationTable.getFlexCellFormatter();
    transformationTable.addStyleName("cw-FlexTable");
    transformationTable.setWidth("32em");
    transformationTable.setCellSpacing(5);
    transformationTable.setCellPadding(3);
    transformationTableCellFormatter.setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT);
    transformationTableCellFormatter.setColSpan(0, 0, 2);

    int numRows = transformationTable.getRowCount();

    // Add rule GUI
    ruleGUI = new MediationRuleGUI(WrappingType.WRAP_JSON, trafoOperator, requestHandler);
    transformationTable.setWidget(numRows, 1, ruleGUI.createTranslationTable());

    // FTest.assertTrue(true, "createJsonTranslationTable succeeded");

    transformationTable.ensureDebugId("cwFlexTable");

    tabPanel.add(transformationTable, new TabWidget("exTransformation"));

    //Adding part three, just to test code generation, there is a show of selected rules, templates and the .js results
    codeGenViewer = new CodeGenViewer(trafoOperator, WrappingType.WRAP_JSON, ruleGUI);
    tabPanel.add(codeGenViewer.createCodeGenViewer(), new TabWidget("CodeGen Viewer"));
}