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

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

Introduction

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

Prototype

public FlexTable() 

Source Link

Usage

From source file:com.square.client.gwt.client.composant.bloc.BlocArrondiBleu.java

License:Open Source License

/**
 * Constructeur./* w  w w  .  ja v a  2  s. c  om*/
 */
public BlocArrondiBleu() {
    flexTable = new FlexTable();
    flexTable.setCellPadding(0);
    flexTable.setCellSpacing(0);
    flexTable.setBorderWidth(0);
    flexTable.setSize(AppControllerConstants.POURCENT_100, AppControllerConstants.POURCENT_100);

    conteneurWidget = new SimplePanel();
    conteneurWidget.setSize(AppControllerConstants.POURCENT_100, AppControllerConstants.POURCENT_100);

    final FlexTable footer = new FlexTable();
    footer.setBorderWidth(0);
    footer.setCellPadding(0);
    footer.setCellSpacing(0);
    footer.setSize(AppControllerConstants.POURCENT_100, HAUTEUR_ARRONDI);
    footer.setWidget(0, 0, new Label());
    footer.setWidget(0, 1, new Label());
    footer.getCellFormatter().setStylePrimaryName(0, 0,
            SquareResources.INSTANCE.css().blocArrondiBleuFooterLeft());
    footer.getCellFormatter().setStylePrimaryName(0, 1,
            SquareResources.INSTANCE.css().blocArrondiBleuFooterRight());
    footer.getCellFormatter().setWidth(0, 1, HAUTEUR_ARRONDI);

    flexTable.setWidget(0, 0, conteneurWidget);
    flexTable.setWidget(1, 0, footer);
    flexTable.getCellFormatter().setStylePrimaryName(0, 0,
            SquareResources.INSTANCE.css().blocArrondiBleuContenu());
    flexTable.getCellFormatter().setHeight(0, 0, AppControllerConstants.POURCENT_100);
    flexTable.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);

    this.initWidget(flexTable);
}

From source file:com.square.client.gwt.client.composant.onglet.scroll.DoubleTabPanelScroll.java

License:Open Source License

/**
 * Creates an empty tab panel./* w ww  .  j a  va  2s  .c  o m*/
 * @param nbOngletsStatiques nombre d'onglets statiques
 * @param width largeur du scrollPanel, en units CSS (e.g. "10px", "1em")
 */
public DoubleTabPanelScroll(int nbOngletsStatiques, int width) {
    this.nbOngletsStatiques = nbOngletsStatiques;
    dynamicTabBar = new ExtendedTabBar();
    staticTabBar = new ExtendedTabBar();
    tabBar = new ExtendedDoubleTabBar(staticTabBar, dynamicTabBar, nbOngletsStatiques);
    deck = new TabbedDeckPanel(tabBar);
    scrollPanel = new ExtendedScrollPanel(dynamicTabBar, width);
    scrollPanel.addStyleName(SquareResources.INSTANCE.css().scrollPanel());
    final VerticalPanel panel = new VerticalPanel();

    final FlexTable panelTabBars = new FlexTable();
    panelTabBars.getFlexCellFormatter().addStyleName(0, 0, SquareResources.INSTANCE.css().ongletsStatiques());
    panelTabBars.addStyleName(SquareResources.INSTANCE.css().barreOnglets());
    panelTabBars.setWidget(0, 0, staticTabBar);
    panelTabBars.setCellPadding(0);
    panelTabBars.setCellSpacing(0);

    panelTabBars.setWidget(0, 1, scrollPanel);
    panelTabBars.getFlexCellFormatter().addStyleName(0, 1, SquareResources.INSTANCE.css().ongletsDynamiques());
    panelTabBars.getFlexCellFormatter().setHorizontalAlignment(0, 1, HorizontalPanel.ALIGN_LEFT);

    panel.add(panelTabBars);
    panel.add(deck);
    panel.setCellHeight(deck, "100%");

    final int idxDecalage = nbOngletsStatiques;
    dynamicTabBar.addSelectionHandler(new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
            staticTabBar.selectTab(-1);
            scrollPanel.ensureVisible((UIObject) (dynamicTabBar.getTab(event.getSelectedItem())));
            scrollPanel.refreshScrollButtons();
            deck.showWidget(event.getSelectedItem() + idxDecalage);
            fireSelectionEvent(event.getSelectedItem() + idxDecalage);
        }
    });

    dynamicTabBar.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
        @Override
        public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
            fireBeforeSelectionEvent(event.getItem() + idxDecalage);
        }
    });

    staticTabBar.addSelectionHandler(new SelectionHandler<Integer>() {
        @Override
        public void onSelection(SelectionEvent<Integer> event) {
            dynamicTabBar.selectTab(-1);
            deck.showWidget(event.getSelectedItem());
            fireSelectionEvent(event.getSelectedItem());
        }
    });
    staticTabBar.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
        @Override
        public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
            fireBeforeSelectionEvent(event.getItem());
        }
    });
    initWidget(panel);
    setStyleName("gwt-TabPanel");
    deck.setStyleName("gwt-TabPanelBottom");
    // Add a11y role "tabpanel"
    Accessibility.setRole(deck.getElement(), Accessibility.ROLE_TABPANEL);
}

From source file:com.square.client.gwt.client.view.action.creation.ActionCreationViewImpl.java

License:Open Source License

/** Construction du bloc de planification. */
private void construireBlocPlanification() {
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantLibelleGwt>() {
        @Override/*from  w ww.j a v a 2s. co  m*/
        public String getSelectSuggestRenderer(IdentifiantLibelleGwt row) {
            return row == null ? "" : row.getLibelle();
        }

        @Override
        public String[] getResultColumnsRenderer() {
            return new String[] {};
        }

        @Override
        public String[] getResultRowsRenderer(IdentifiantLibelleGwt row) {
            return new String[] { row == null ? "" : row.getLibelle() };
        }
    };

    final Label labelAFaire = new Label(viewConstants.labelAFaire(), false);
    cdbDateAction = new DecoratedCalendrierDateBox(true);
    cdbDateAction.ensureDebugId(viewDebugIdConstants.debugIdCdbDateAction());
    aidecdbDateAction = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_DATE, isAdmin);
    // listComposantAide.add(aidecdbDateAction);
    ajouterAideComposant(aidecdbDateAction);
    final Label labelDebut = new Label(viewConstants.labelDebut(), false);
    tbfHeureAction = new DecoratedTextBoxFormat("NN:NN");
    tbfHeureAction.ensureDebugId(viewDebugIdConstants.debugIdTbfHeureAction());
    tbfHeureAction.addStyleName(SquareResources.INSTANCE.css().heureDate());
    aideTbfHeureAction = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_HEURE, isAdmin);
    HorizontalPanel panelHeure = new HorizontalPanel();
    panelHeure.setSpacing(5);
    panelHeure.add(tbfHeureAction);
    panelHeure.add(aideTbfHeureAction);
    panelHeure.setCellVerticalAlignment(aideTbfHeureAction, HasAlignment.ALIGN_MIDDLE);
    ajouterAideComposant(aideTbfHeureAction);
    final Label labelDuree = new Label(viewConstants.labelDuree(), false);
    slbDuree = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbDuree.ensureDebugId(viewDebugIdConstants.debugIdSlbDuree());
    slbDuree.setWidth(ActionCreationViewImplConstants.LARGEUR_SLB_DUREE);
    aideSlbDuree = new AideComposant(100014L, isAdmin);
    ajouterAideComposant(aideSlbDuree);

    // Constuction de la priorite
    final Label lpriorite = new Label(viewConstants.priorite());
    slbPriorite = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbPriorite.ensureDebugId(viewDebugIdConstants.debugIdSlbPriorite());
    aideSlbPriorite = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_PRIORITE, isAdmin);
    HorizontalPanel panelPriorite = new HorizontalPanel();
    panelPriorite.setSpacing(5);
    panelPriorite.add(slbPriorite);
    panelPriorite.add(aideSlbPriorite);
    ajouterAideComposant(aideSlbPriorite);

    final CaptionPanel captionPanel = new CaptionPanel(viewConstants.libellePanelPlanification());
    final FlexTable flexTable = new FlexTable();
    flexTable.setWidth(AppControllerConstants.POURCENT_100);
    flexTable.setCellSpacing(3);
    flexTable.setWidget(0, 0, labelAFaire);
    flexTable.setWidget(0, 1,
            construireBlocIcone(cdbDateAction, "ActionCreationDto.dateAction", aidecdbDateAction));
    flexTable.setWidget(0, 2, labelDebut);
    flexTable.setWidget(0, 3, panelHeure);
    flexTable.setWidget(0, 4, labelDuree);
    flexTable.setWidget(0, 5, construireBlocIcone(slbDuree, "ActionCreationDto.idDuree", aideSlbDuree));
    flexTable.setWidget(1, 0, lpriorite);
    flexTable.setWidget(1, 1, panelPriorite);
    flexTable.getFlexCellFormatter().setColSpan(1, 1, 5);
    flexTable.getRowFormatter().setVerticalAlign(0, HasAlignment.ALIGN_MIDDLE);
    flexTable.getRowFormatter().setVerticalAlign(1, HasAlignment.ALIGN_MIDDLE);
    flexTable.getColumnFormatter().setWidth(0, ActionCreationViewImplConstants.LARGEUR_COL_LIBELLE);

    captionPanel.add(flexTable);
    conteneurGlobal.add(captionPanel);
}

From source file:com.square.client.gwt.client.view.action.creation.ActionCreationViewImpl.java

License:Open Source License

/** Construction du bloc affectation. */
private void construireBlocAffectation() {
    final Label lPersonne = new Label(viewConstants.libellePersonne(), false);
    final Label lAttributionAgence = new Label(viewConstants.labelAttributionAgence(), false);
    final Label lAttributionRessourceAgence = new Label(viewConstants.labelAttributionRessourceAgence(), false);
    lPersonneAffecte = new Label();
    slbAttributionAgence = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(
            new SuggestListBoxSingleProperties<IdentifiantLibelleGwt>() {
                @Override/*from w  w  w .ja  va  2  s  .co m*/
                public String getSelectSuggestRenderer(IdentifiantLibelleGwt row) {
                    return row == null ? "" : row.getLibelle();
                }

                @Override
                public String[] getResultColumnsRenderer() {
                    return new String[] {};
                }

                @Override
                public String[] getResultRowsRenderer(IdentifiantLibelleGwt row) {
                    return new String[] { row == null ? "" : row.getLibelle() };
                }
            });
    aideSlbAttributionAgence = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_ATTRIBUTION_AGENCE,
            isAdmin);
    ajouterAideComposant(aideSlbAttributionAgence);

    slbAttributionAgence.ensureDebugId(viewDebugIdConstants.debugIdSlbAttributionAgence());
    slbAttributionRessourceAgence = new DecoratedSuggestListBoxSingle<DimensionRessourceModel>(
            new SuggestListBoxSingleProperties<DimensionRessourceModel>() {
                @Override
                public String getSelectSuggestRenderer(DimensionRessourceModel row) {
                    return row == null ? "" : row.getNom() + " " + row.getPrenom();
                }

                @Override
                public String[] getResultColumnsRenderer() {
                    return new String[] {};
                }

                @Override
                public String[] getResultRowsRenderer(DimensionRessourceModel row) {
                    return new String[] { row == null ? "" : row.getNom(), row.getPrenom() };
                }

            });
    slbAttributionRessourceAgence.ensureDebugId(viewDebugIdConstants.debugIdSlbAttributionRessourceAgence());
    aideSlbAttributionRessourceAgence = new AideComposant(
            AideComposantConstants.AIDE_ACTION_CREATION_ATTRIBUTION_RESSOURCE, isAdmin);
    ajouterAideComposant(aideSlbAttributionRessourceAgence);

    final CaptionPanel captionPanel = new CaptionPanel(viewConstants.libellePanelAffectation());
    final FlexTable ftAffectation = new FlexTable();
    ftAffectation.setWidth(AppControllerConstants.POURCENT_100);
    ftAffectation.setCellSpacing(3);
    ftAffectation.setWidget(0, 0, lAttributionAgence);
    ftAffectation.setWidget(0, 1,
            construireBlocIcone(slbAttributionAgence, "ActionCreationDto.idAgence", aideSlbAttributionAgence));
    ftAffectation.setWidget(1, 0, lAttributionRessourceAgence);
    ftAffectation.setWidget(1, 1, construireBlocIcone(slbAttributionRessourceAgence,
            "ActionCreationDto.idCommercial", aideSlbAttributionRessourceAgence));
    ftAffectation.setWidget(2, 0, lPersonne);
    ftAffectation.setWidget(2, 1, lPersonneAffecte);
    ftAffectation.getColumnFormatter().setWidth(0, ActionCreationViewImplConstants.LARGEUR_COL_LIBELLE);
    captionPanel.add(ftAffectation);
    conteneurGlobal.add(captionPanel);
}

From source file:com.square.client.gwt.client.view.action.creation.ActionCreationViewImpl.java

License:Open Source License

/** Construction du bloc Action. */
private void construireBlocAction() {
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantLibelleGwt>() {
        @Override/* www .  j a v  a  2  s .  c o m*/
        public String getSelectSuggestRenderer(IdentifiantLibelleGwt row) {
            return row == null ? "" : row.getLibelle();
        }

        @Override
        public String[] getResultColumnsRenderer() {
            return new String[] {};
        }

        @Override
        public String[] getResultRowsRenderer(IdentifiantLibelleGwt row) {
            return new String[] { row == null ? "" : row.getLibelle() };
        }
    };
    slbNature = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbNature.ensureDebugId(viewDebugIdConstants.debugIdSlbNature());
    aideSlbNature = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_NATURE, isAdmin);
    ajouterAideComposant(aideSlbNature);
    slbObjet = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbObjet.ensureDebugId(viewDebugIdConstants.debugIdSlbObjet());
    aideSlbObjet = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_OBJET, isAdmin);
    ajouterAideComposant(aideSlbObjet);
    slbSousObjet = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbSousObjet.ensureDebugId(viewDebugIdConstants.debugIdSlbSousObjet());
    aideSlbSousObjet = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_SOUS_OBJET, isAdmin);
    HorizontalPanel panelSlbSousObjet = new HorizontalPanel();
    panelSlbSousObjet.setSpacing(5);
    panelSlbSousObjet.add(slbSousObjet);
    panelSlbSousObjet.add(aideSlbSousObjet);
    ajouterAideComposant(aideSlbSousObjet);
    slbType = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbType.ensureDebugId(viewDebugIdConstants.debugIdSlbType());
    aideSlbType = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_TYPE, isAdmin);
    ajouterAideComposant(aideSlbType);
    cbReclamation = new CheckBox(viewConstants.reclamation());
    cbReclamation.ensureDebugId(viewDebugIdConstants.debugIdCbReclamation());
    cbFermerPrecedente = new CheckBox(viewConstants.fermerActionPrecedente());
    cbFermerPrecedente.ensureDebugId(viewDebugIdConstants.debugIdCbFermerPrecedente());
    cbFermerPrecedente.setVisible(false);
    cbFermerPrecedente.setValue(false);
    final Label lnature = new Label(viewConstants.nature(), false);
    final Label ltype = new Label(viewConstants.type(), false);
    final Label lObjet = new Label(viewConstants.objet(), false);
    final Label lSousObjet = new Label(viewConstants.sousObjet(), false);

    final CaptionPanel captionPanel = new CaptionPanel(viewConstants.libellePanelAction());
    final FlexTable flexTable = new FlexTable();
    flexTable.setWidth(AppControllerConstants.POURCENT_100);
    flexTable.setCellSpacing(3);
    flexTable.setWidget(0, 0, lnature);
    flexTable.setWidget(0, 1,
            construireBlocIcone(slbNature, "ActionCreationDto.idNatureAction", aideSlbNature));
    flexTable.setWidget(1, 0, ltype);
    flexTable.setWidget(1, 1, construireBlocIcone(slbType, "ActionCreationDto.idType", aideSlbType));
    flexTable.setWidget(2, 0, lObjet);
    flexTable.setWidget(2, 1, construireBlocIcone(slbObjet, "ActionCreationDto.idObjet", aideSlbObjet));
    flexTable.setWidget(3, 0, lSousObjet);
    flexTable.setWidget(3, 1, panelSlbSousObjet);
    flexTable.setWidget(4, 1, cbReclamation);
    flexTable.setWidget(5, 1, cbFermerPrecedente);
    flexTable.getColumnFormatter().setWidth(0, ActionCreationViewImplConstants.LARGEUR_COL_LIBELLE);

    captionPanel.add(flexTable);
    conteneurGlobal.add(captionPanel);
}

From source file:com.square.client.gwt.client.view.action.creation.ActionCreationViewImpl.java

License:Open Source License

/** Construction du bloc campagne. */
private void construireBlocCampagne() {
    final Label lcampagne = new Label(viewConstants.campagne(), false);
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantLibelleGwt>() {
        @Override//  ww w. j  a v  a 2 s  .  c  o m
        public String getSelectSuggestRenderer(IdentifiantLibelleGwt row) {
            return row == null ? "" : row.getLibelle();
        }

        @Override
        public String[] getResultColumnsRenderer() {
            return new String[] {};
        }

        @Override
        public String[] getResultRowsRenderer(IdentifiantLibelleGwt row) {
            return new String[] { row == null ? "" : row.getLibelle() };
        }
    };
    slbCampagne = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbCampagne.ensureDebugId(viewDebugIdConstants.debugIdSlbCampagne());
    aideSlbCampagne = new AideComposant(AideComposantConstants.AIDE_ACTION_CREATION_CAMPAGNE, isAdmin);
    HorizontalPanel panelSlbCampagne = new HorizontalPanel();
    panelSlbCampagne.setSpacing(5);
    panelSlbCampagne.add(slbCampagne);
    panelSlbCampagne.add(aideSlbCampagne);
    ajouterAideComposant(aideSlbCampagne);
    final CaptionPanel captionPanel = new CaptionPanel(viewConstants.libellePanelCampagne());
    final FlexTable flexTable = new FlexTable();
    flexTable.setWidth(AppControllerConstants.POURCENT_100);
    flexTable.setCellSpacing(3);
    flexTable.setWidget(0, 0, lcampagne);
    flexTable.setWidget(0, 1, panelSlbCampagne);
    flexTable.getColumnFormatter().setWidth(0, ActionCreationViewImplConstants.LARGEUR_COL_LIBELLE);

    captionPanel.add(flexTable);
    conteneurGlobal.add(captionPanel);
}

From source file:com.square.client.gwt.client.view.action.moteur.recherche.ActionMoteurRechercheViewImpl.java

License:Open Source License

/**
 * Constructeur./*from   w  ww .j  ava2  s  .com*/
 * @param constantes constantes.
 * @param appConstantes les appConstantes.
 */
public ActionMoteurRechercheViewImpl(ConstantesModel constantes, AppControllerConstants appConstantes) {
    this.constantes = constantes;
    this.appConstantes = appConstantes;
    focusPanel = new FocusPanel();
    this.isAdmin = constantes.isHasRoleAdmin();
    final VerticalPanel conteneurGlobal = new VerticalPanel();
    conteneurGlobal.setSpacing(10);
    final AideComposant aideView = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_GLOBAL,
            isAdmin);
    ajouterAideComposant(aideView);
    conteneurGlobal.add(aideView);
    conteneurGlobal.setCellHorizontalAlignment(aideView, HasAlignment.ALIGN_RIGHT);
    conteneurGlobal.setWidth(AppControllerConstants.POURCENT_100);

    conteneur = new FlexTable();
    conteneur.setCellSpacing(10);
    conteneur.setWidth(AppControllerConstants.POURCENT_100);

    final Widget identificationWidget = construireBlocIdentification();
    final Widget creationWidget = construireBlocCreation();
    final Widget planificationWidget = construireBlocPlanification();
    final Widget informationWidget = construireBlocInformation();

    conteneur.setWidget(0, 0, identificationWidget);
    conteneur.setWidget(0, 1, creationWidget);
    conteneur.setWidget(0, 2, planificationWidget);
    conteneur.getColumnFormatter().setWidth(0, "39%");
    conteneur.getColumnFormatter().setWidth(1, "39%");
    conteneur.getColumnFormatter().setWidth(2, "22%");
    conteneur.setWidget(1, 0, informationWidget);
    conteneur.getFlexCellFormatter().setColSpan(1, 0, 3);

    btnRechercher = new DecoratedButton(viewConstants.rechercher());
    btnRechercher.ensureDebugId(viewDebugIdConstants.debugIdBtnRechercher());
    btnEffacerRecherche = new DecoratedButton(viewConstants.effacer());
    btnEffacerRecherche.ensureDebugId(viewDebugIdConstants.debugIdBtnEffacerRecherche());

    final FlexTable conteneurButtons = new FlexTable();
    conteneurButtons.setCellSpacing(5);
    conteneurButtons.setWidget(0, 0, btnRechercher);
    conteneurButtons.setWidget(0, 1, btnEffacerRecherche);
    conteneur.setWidget(2, 0, conteneurButtons);
    conteneur.getCellFormatter().setHorizontalAlignment(2, 0, HasAlignment.ALIGN_CENTER);
    conteneur.getFlexCellFormatter().setColSpan(2, 0, 3);

    createRemotePagingTable();
    conteneur.setWidget(3, 0, remotePagingTableAction);
    conteneur.getCellFormatter().setHorizontalAlignment(3, 0, HasAlignment.ALIGN_CENTER);
    conteneur.getFlexCellFormatter().setColSpan(3, 0, 3);

    creerExportExcel();

    // FORME LE MENU CONTEXT
    contruireActionsContextPanel();
    conteneurGlobal.add(conteneur);
    focusPanel.add(new ContenuOnglet(conteneurGlobal));
    // conteneurGlobal.add(focusPanel);
    this.initWidget(focusPanel);
    this.setWidth(AppControllerConstants.POURCENT_100);
    this.addStyleName(SquareResources.INSTANCE.css().actionsMoteurRecherche());
}

From source file:com.square.client.gwt.client.view.action.moteur.recherche.ActionMoteurRechercheViewImpl.java

License:Open Source License

private Widget construireBlocIdentification() {
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantLibelleGwt>() {

        @Override/*  w  ww  .j ava2 s .  c  om*/
        public String getSelectSuggestRenderer(IdentifiantLibelleGwt row) {
            return row == null ? "" : row.getLibelle();
        }

        @Override
        public String[] getResultColumnsRenderer() {
            return new String[] {};
        }

        @Override
        public String[] getResultRowsRenderer(IdentifiantLibelleGwt row) {
            return new String[] { row == null ? "" : row.getLibelle() };
        }
    };
    slbType = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbType.ensureDebugId(viewDebugIdConstants.debugIdSlbType());
    aideslbType = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_TYPE, isAdmin);
    final HorizontalPanel panelslbType = new HorizontalPanel();
    panelslbType.setSpacing(5);
    panelslbType.add(slbType);
    panelslbType.add(aideslbType);
    ajouterAideComposant(aideslbType);

    slbObjet = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbObjet.ensureDebugId(viewDebugIdConstants.debugIdSlbObjet());
    aideslbObjet = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_OBJET, isAdmin);
    final HorizontalPanel panelslbObjet = new HorizontalPanel();
    panelslbObjet.setSpacing(5);
    panelslbObjet.add(slbObjet);
    panelslbObjet.add(aideslbObjet);
    ajouterAideComposant(aideslbObjet);

    slbSousObjet = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    slbSousObjet.ensureDebugId(viewDebugIdConstants.debugIdSlbSousObjet());
    aideslbSousObjet = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_SOUS_OBJET, isAdmin);
    final HorizontalPanel panelslbSousObjet = new HorizontalPanel();
    panelslbSousObjet.setSpacing(5);
    panelslbSousObjet.add(slbSousObjet);
    panelslbSousObjet.add(aideslbSousObjet);
    ajouterAideComposant(aideslbSousObjet);

    final CaptionPanel fieldSetPanel = new CaptionPanel(viewConstants.identificaton());
    fieldSetPanel.setHeight(ActionsMoteurRechercheViewImplConstants.HAUTEUR_BLOC);

    final FlexTable fpIdentification = new FlexTable();
    fpIdentification.setCellSpacing(5);
    final Label type = creerLibelle(viewConstants.type());
    final Label objet = creerLibelle(viewConstants.objet());
    final Label sousObjet = creerLibelle(viewConstants.sousObjet());

    fpIdentification.setWidget(0, 0, type);
    fpIdentification.setWidget(0, 1, panelslbType);
    fpIdentification.setWidget(1, 0, objet);
    fpIdentification.setWidget(1, 1, panelslbObjet);
    fpIdentification.setWidget(2, 0, sousObjet);
    fpIdentification.setWidget(2, 1, panelslbSousObjet);

    fpIdentification.getColumnFormatter().setWidth(0, "25%");
    fieldSetPanel.add(fpIdentification);
    fieldSetPanel.setHeight("200px");
    return fieldSetPanel;
}

From source file:com.square.client.gwt.client.view.action.moteur.recherche.ActionMoteurRechercheViewImpl.java

License:Open Source License

/**
 * Construit le bloc "cration"./*from w ww  .j  av a 2s  .  co  m*/
 * @return le bloc gnr.
 */
private Widget construireBlocCreation() {
    slbCreateur = new DecoratedSuggestListBoxComposite<DimensionRessourceModel>(
            new SuggestListBoxCompositeProperties<DimensionRessourceModel>() {
                @Override
                public String getSelectSuggestRenderer(DimensionRessourceModel row) {
                    return construireLabelRessource(row, false);
                }

                @Override
                public String[] getResultColumnsRenderer() {
                    return new String[] {};
                }

                @Override
                public String[] getResultRowsRenderer(DimensionRessourceModel row) {
                    return new String[] { construireLabelRessource(row, true) };
                }

                @Override
                public String getSuggestListBoxMultiplePopupTitle() {
                    return viewConstants.titrePopUpSelection();
                }

                @Override
                public Integer getLeftPosition() {
                    return LEFT_POSITION_CENTER;
                }

                @Override
                public Integer getTopPosition() {
                    return TOP_POSITION_CENTER;
                }
            });
    slbCreateur.ensureDebugId(viewDebugIdConstants.debugIdSlbCreateur());
    slbCreateur.setScrollPanelSuggestMultipleHeight(
            ActionsMoteurRechercheViewImplConstants.HAUTEUR_SCROLLPANEL_LISTBOX_MULTIPLE);
    aideslbCreateur = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_CREATEUR, isAdmin);
    final HorizontalPanel panelslbCreateur = new HorizontalPanel();
    panelslbCreateur.setSpacing(3);
    panelslbCreateur.add(slbCreateur);
    panelslbCreateur.add(aideslbCreateur);
    ajouterAideComposant(aideslbCreateur);

    slbAttribueA = new DecoratedSuggestListBoxComposite<DimensionRessourceModel>(
            new SuggestListBoxCompositeProperties<DimensionRessourceModel>() {
                @Override
                public String getSelectSuggestRenderer(DimensionRessourceModel row) {
                    return construireLabelRessource(row, false);
                }

                @Override
                public String[] getResultColumnsRenderer() {
                    return new String[] {};
                }

                @Override
                public String[] getResultRowsRenderer(DimensionRessourceModel row) {
                    return new String[] { construireLabelRessource(row, true) };
                }

                @Override
                public String getSuggestListBoxMultiplePopupTitle() {
                    return viewConstants.titrePopUpSelection();
                }

                @Override
                public Integer getLeftPosition() {
                    return LEFT_POSITION_CENTER;
                }

                @Override
                public Integer getTopPosition() {
                    return TOP_POSITION_CENTER;
                }
            });
    slbAttribueA.ensureDebugId(viewDebugIdConstants.debugIdSlbAttribueA());
    slbAttribueA.setScrollPanelSuggestMultipleHeight(
            ActionsMoteurRechercheViewImplConstants.HAUTEUR_SCROLLPANEL_LISTBOX_MULTIPLE);
    aideslbAttribueA = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_ATTRIBUE_A, isAdmin);
    final HorizontalPanel panelslbAttribueA = new HorizontalPanel();
    panelslbAttribueA.setSpacing(3);
    panelslbAttribueA.add(slbAttribueA);
    panelslbAttribueA.add(aideslbAttribueA);
    ajouterAideComposant(aideslbAttribueA);

    slbAgence = new DecoratedSuggestListBoxComposite<IdentifiantLibelleGwt>(
            new SuggestListBoxCompositeProperties<IdentifiantLibelleGwt>() {
                @Override
                public String getSelectSuggestRenderer(IdentifiantLibelleGwt row) {
                    return row == null ? "" : row.getLibelle();
                }

                @Override
                public String[] getResultColumnsRenderer() {
                    return new String[] {};
                }

                @Override
                public String[] getResultRowsRenderer(IdentifiantLibelleGwt row) {
                    return new String[] { row == null ? "" : row.getLibelle() };
                }

                @Override
                public String getSuggestListBoxMultiplePopupTitle() {
                    return viewConstants.titrePopUpSelection();
                }

                @Override
                public Integer getLeftPosition() {
                    return LEFT_POSITION_CENTER;
                }

                @Override
                public Integer getTopPosition() {
                    return TOP_POSITION_CENTER;
                }
            });
    slbAgence.ensureDebugId(viewDebugIdConstants.debugIdSlbAgence());
    slbAgence.setScrollPanelSuggestMultipleHeight(
            ActionsMoteurRechercheViewImplConstants.HAUTEUR_SCROLLPANEL_LISTBOX_MULTIPLE);
    aideslbAgence = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_AGENCE, isAdmin);
    final HorizontalPanel panelslbAgence = new HorizontalPanel();
    panelslbAgence.setSpacing(3);
    panelslbAgence.add(slbAgence);
    panelslbAgence.add(aideslbAgence);
    ajouterAideComposant(aideslbAgence);

    cbRechercheEtEntreAgencesEtCommerciaux = new CheckBox();
    cbRechercheEtEntreAgencesEtCommerciaux
            .ensureDebugId(viewDebugIdConstants.debugIdCbRechercheEtEntreAgencesEtCommerciaux());

    final CaptionPanel fieldSetPanel = new CaptionPanel(viewConstants.libeleCreation());
    fieldSetPanel.setHeight(ActionsMoteurRechercheViewImplConstants.HAUTEUR_BLOC);
    final FlexTable fpCreation = new FlexTable();
    fpCreation.setCellSpacing(5);
    final Label createur = creerLibelle(viewConstants.createur());
    final Label agence = creerLibelle(viewConstants.agence());
    final Label rechercheEt = creerLibelle(viewConstants.rechercheEt());
    final Label attribueA = creerLibelle(viewConstants.attribueA());

    fpCreation.setWidget(0, 0, createur);
    fpCreation.setWidget(0, 1, panelslbCreateur);
    fpCreation.setWidget(1, 0, agence);
    fpCreation.setWidget(1, 1, panelslbAgence);
    fpCreation.setWidget(2, 0, rechercheEt);
    fpCreation.setWidget(2, 1, cbRechercheEtEntreAgencesEtCommerciaux);
    fpCreation.setWidget(3, 0, attribueA);
    fpCreation.setWidget(3, 1, panelslbAttribueA);

    fpCreation.getColumnFormatter().setWidth(0, "25%");
    fieldSetPanel.add(fpCreation);
    fieldSetPanel.setHeight("200px");
    return fieldSetPanel;
}

From source file:com.square.client.gwt.client.view.action.moteur.recherche.ActionMoteurRechercheViewImpl.java

License:Open Source License

private Widget construireBlocPlanification() {
    clBdateDebut = new DecoratedCalendrierDateBox();
    clBdateDebut.ensureDebugId(viewDebugIdConstants.debugIdClBdateDebut());
    aideclBdateDebut = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_DATE_DEBUT, isAdmin);
    final HorizontalPanel panelclBdateDebut = new HorizontalPanel();
    panelclBdateDebut.setSpacing(1);// w ww  .  j  a  v a  2 s .c  om
    panelclBdateDebut.add(clBdateDebut);
    panelclBdateDebut.add(aideclBdateDebut);
    ajouterAideComposant(aideclBdateDebut);

    clBdateFin = new DecoratedCalendrierDateBox();
    clBdateFin.ensureDebugId(viewDebugIdConstants.debugIdClBdateFin());
    aideclBdateFin = new AideComposant(AideComposantConstants.AIDE_ACTION_RECHERCHE_DATE_FIN, isAdmin);
    final HorizontalPanel panelclBdateFin = new HorizontalPanel();
    panelclBdateFin.setSpacing(1);
    panelclBdateFin.add(clBdateFin);
    panelclBdateFin.add(aideclBdateFin);
    ajouterAideComposant(aideclBdateFin);

    final CaptionPanel fieldSetPanel = new CaptionPanel(viewConstants.planification());
    fieldSetPanel.setHeight(ActionsMoteurRechercheViewImplConstants.HAUTEUR_BLOC);
    final FlexTable fpPlanification = new FlexTable();
    fpPlanification.setCellSpacing(1);
    final Label dateDebut = creerLibelle(viewConstants.dateDebut());
    final Label dateFin = creerLibelle(viewConstants.dateFin());

    fpPlanification.setWidget(0, 0, dateDebut);
    fpPlanification.setWidget(0, 1, panelclBdateDebut);
    fpPlanification.setWidget(1, 0, dateFin);
    fpPlanification.setWidget(1, 1, panelclBdateFin);
    panelclBdateDebut.setWidth("105%");
    panelclBdateFin.setWidth("105%");
    fieldSetPanel.add(fpPlanification);
    fieldSetPanel.setHeight("200px");
    return fieldSetPanel;
}