Example usage for com.google.gwt.user.client.ui HorizontalPanel setCellVerticalAlignment

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

Introduction

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

Prototype

public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align) 

Source Link

Document

Overloaded version for IsWidget.

Usage

From source file:com.square.composant.tarificateur.square.client.view.adhesion.BlocInfoSanteCompleteViewImpl.java

License:Open Source License

/**
 * Construit un bloc avec un label et un champ pour l'affichage.
 *///from   ww  w  .  j  a va2s . c  o m
private HorizontalPanel construireBlocIcone(final Widget composant, final String nomChamp) {
    final IconeErreurChamp icone = iconeErreurChampManager.createInstance(nomChamp, composant);
    final HorizontalPanel panelIcone = new HorizontalPanel();
    panelIcone.add(composant);
    panelIcone.add(icone);
    panelIcone.setCellVerticalAlignment(icone, HasAlignment.ALIGN_MIDDLE);
    return panelIcone;
}

From source file:com.square.composant.tarificateur.square.client.view.devis.DevisViewImpl.java

License:Open Source License

private void creerBlocEntete() {
    btnEnregistrerDevis = new DecoratedButton(viewConstants.libelleBoutonEnregistrer());
    btnAjouterProduit = new DecoratedButton(viewConstants.libelleBoutonAjouterProduit());
    btnAjouterProduit.setTitle(viewConstants.titleBoutonAjouterProduit());
    btnEnvoyerDevisMail = new DecoratedButton(viewConstants.libelleBoutonEnvoyerMail());
    btnImprimerDevis = new DecoratedButton(viewConstants.libelleBoutonImprimer());
    btnTransformerDevisAia = new DecoratedButton(viewConstants.libelleBoutonTransformerDevisAia());
    btnTransformerDevisAia.setTitle(viewConstants.titleBoutonTransformerDevisAia());
    btnTransfererNouveauDevis = new DecoratedButton(viewConstants.libelleBoutonTransfertNouveauDevis());
    btnTransfererNouveauDevis.setTitle(viewConstants.titleBoutonTransfertNouveauDevis());
    btnInformationsAdhesion = new DecoratedButton(viewConstants.libelleBoutonInformationsAdhesion());
    btnInformationsAdhesion.setTitle(viewConstants.titleBoutonInformationsAdhesion());
    btnTransformerDevisAia.setEnabled(false);
    btnTransfererNouveauDevis.setEnabled(false);

    final HorizontalPanel buttonBar = new HorizontalPanel();
    buttonBar.setSpacing(5);//from   www .  j  a v  a  2s .c  o m
    buttonBar.add(btnEnregistrerDevis);
    buttonBar.add(btnAjouterProduit);
    buttonBar.add(btnImprimerDevis);
    buttonBar.add(btnEnvoyerDevisMail);
    buttonBar.add(btnTransformerDevisAia);
    buttonBar.add(btnTransfererNouveauDevis);
    buttonBar.add(btnInformationsAdhesion);

    lbMotifDevis = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(
            new SuggestListBoxSingleProperties<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() };
                }
            });
    final HorizontalPanel pMotifDevis = creerBlocLibelleValeur(viewConstants.labelMotifDevis(),
            construireBlocIcone(lbMotifDevis, "idMotifDevis"));
    pMotifDevis.setSpacing(5);

    final Label libelleFinaliteDevis = new Label(viewConstants.libelleFinaliteDevis());
    libelleFinaliteDevis.setWordWrap(false);
    lFinaliteDevis = new Label();
    lFinaliteDevis.setWordWrap(false);
    blocFinaliteDevis = new HorizontalPanel();
    blocFinaliteDevis.setSpacing(2);
    blocFinaliteDevis.add(libelleFinaliteDevis);
    blocFinaliteDevis.add(lFinaliteDevis);

    iconeWarningFamilleDifferente = new Image(ComposantTarificateur.RESOURCES.iconeWarning());

    final HorizontalPanel conteneurLigne2 = new HorizontalPanel();
    conteneurLigne2.setSpacing(5);
    conteneurLigne2.add(pMotifDevis);
    conteneurLigne2.add(iconeWarningFamilleDifferente);
    conteneurLigne2.add(blocFinaliteDevis);
    conteneurLigne2.setCellVerticalAlignment(pMotifDevis, HasVerticalAlignment.ALIGN_MIDDLE);
    conteneurLigne2.setCellVerticalAlignment(iconeWarningFamilleDifferente, HasVerticalAlignment.ALIGN_MIDDLE);
    conteneurLigne2.setCellVerticalAlignment(blocFinaliteDevis, HasVerticalAlignment.ALIGN_MIDDLE);

    // Menu Bar
    blocEntete = new VerticalPanel();
    blocEntete.addStyleName(ComposantTarificateur.RESOURCES.css().blocEnteteDevis());
    blocEntete.setWidth(ComposantTarificateurConstants.POURCENT_100);
    blocEntete.add(buttonBar);
    blocEntete.add(conteneurLigne2);
    blocEntete.setCellHorizontalAlignment(conteneurLigne2, HasHorizontalAlignment.ALIGN_RIGHT);
}

From source file:com.square.composant.tarificateur.square.client.view.devis.DevisViewImpl.java

License:Open Source License

private HorizontalPanel creerBlocLibelleValeur(String libelle, Widget wValeur) {
    final Label lLibelle = new Label(libelle);
    lLibelle.setWordWrap(false);//from w w w  .  j av  a  2  s .  com
    lLibelle.addStyleName(ComposantTarificateur.RESOURCES.css().important());
    if (wValeur instanceof HasText) {
        wValeur.addStyleName(ComposantTarificateur.RESOURCES.css().important());
    }
    final HorizontalPanel conteneurBloc = new HorizontalPanel();
    conteneurBloc.add(lLibelle);
    conteneurBloc.add(wValeur);
    conteneurBloc.setCellVerticalAlignment(lLibelle, HasVerticalAlignment.ALIGN_MIDDLE);
    conteneurBloc.setCellVerticalAlignment(wValeur, HasVerticalAlignment.ALIGN_MIDDLE);
    return conteneurBloc;
}

From source file:com.square.composant.tarificateur.square.client.view.ligne.devis.LigneDevisViewImpl.java

License:Open Source License

private HorizontalPanel creerBlocLibelleValeur(String libelle, Widget wValeur) {
    final Label lLibelle = new Label(libelle);
    lLibelle.setWordWrap(false);/*from w  ww  . j  a va  2s  .  c  om*/
    lLibelle.addStyleName(ComposantTarificateur.RESOURCES.css().important());
    if (wValeur instanceof HasText) {
        wValeur.addStyleName(ComposantTarificateur.RESOURCES.css().important());
    }
    final HorizontalPanel conteneurBloc = new HorizontalPanel();
    conteneurBloc.setSpacing(2);
    conteneurBloc.add(lLibelle);
    conteneurBloc.add(wValeur);
    conteneurBloc.setCellVerticalAlignment(lLibelle, HasVerticalAlignment.ALIGN_MIDDLE);
    conteneurBloc.setCellVerticalAlignment(wValeur, HasVerticalAlignment.ALIGN_MIDDLE);
    return conteneurBloc;
}

From source file:com.square.composants.graphiques.lib.client.composants.BlocSyntheseDepliant.java

License:Open Source License

/**
 * Constructeur.//from w w  w.jav a2 s .  c om
 * @param listeChamps .
 * @param header .
 * @param contenu .
 * @param nbChampParLigne .
 */
public BlocSyntheseDepliant(List<ChampSynthese> listeChamps, Widget header, Widget contenu,
        final int nbChampParLigne) {
    this.listeChamps = listeChamps;
    this.nbChampParLigne = nbChampParLigne;
    disclosurePanel = new CustomDisclosurePanel();
    disclosurePanel.setAnimationEnabled(true);
    disclosurePanel.addOpenHandler(this);
    disclosurePanel.addCloseHandler(this);
    disclosurePanel.addStyleName(SquareLibResources.INSTANCE.css().blocSyntheseDepliant());
    disclosurePanel.setWidth(ComposantsGraphiquesConstants.POURCENT_100);

    final SimplePanel conteneurContenu = new SimplePanel();
    conteneurContenu.add(contenu);

    icone = new Image(SquareLibResources.INSTANCE.expand());
    icone.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            disclosurePanel.setOpen(!disclosurePanel.isOpen());
        }
    });

    nbLigne = (int) Math.ceil((double) listeChamps.size() / nbChampParLigne);
    resumePanel = new Grid(nbLigne, nbChampParLigne);
    resumePanel.setWidth(ComposantsGraphiquesConstants.POURCENT_100);
    int index = 0;
    for (int row = 0; row < resumePanel.getRowCount(); row++) {
        for (int column = 0; column < resumePanel.getColumnCount() && (index < listeChamps.size()); column++) {
            final ChampSynthese champ = listeChamps.get(index++);
            resumePanel.setWidget(row, column, champ);
            addOpenEventHandler(champ);
            addCloseEventHandler(champ);
        }
    }

    final HorizontalPanel conteneurEntete = new HorizontalPanel();
    conteneurEntete.setSpacing(5);
    conteneurEntete.setWidth(ComposantsGraphiquesConstants.POURCENT_100);
    conteneurEntete.add(resumePanel);
    if (header != null) {
        conteneurEntete.add(header);
        conteneurEntete.setCellHorizontalAlignment(header, HasAlignment.ALIGN_RIGHT);
    }
    conteneurEntete.add(icone);
    conteneurEntete.setCellHorizontalAlignment(icone, HasAlignment.ALIGN_RIGHT);
    conteneurEntete.setCellVerticalAlignment(resumePanel, HasAlignment.ALIGN_MIDDLE);
    conteneurEntete.setCellVerticalAlignment(icone, HasAlignment.ALIGN_MIDDLE);

    conteneurEnteteFocus = new FocusPanel();
    conteneurEnteteFocus.setWidth(ComposantsGraphiquesConstants.POURCENT_100);
    conteneurEnteteFocus.add(conteneurEntete);

    disclosurePanel.setHeader(conteneurEnteteFocus);
    disclosurePanel.setContent(conteneurContenu);

    initWidget(disclosurePanel);
}

From source file:com.square.composants.graphiques.lib.client.composants.ChampSynthese.java

License:Open Source License

/** Construction du composant. */
private void construireWidget() {
    final HorizontalPanel bloc = new HorizontalPanel();
    bloc.setSpacing(3);//from  www  .j  a  va  2 s  .  c  om
    bloc.setStyleName("enteteChamp");

    if (this.champ != null && champ instanceof CheckBox) {
        bloc.add(this.champ);
        if (!"".equals(this.label.getText())) {
            bloc.add(this.label);
            if (this.labelOuverture != null) {
                bloc.add(this.labelOuverture);
                labelOuverture.setVisible(false);
            }
        }
        bloc.setCellVerticalAlignment(this.champ, HasAlignment.ALIGN_MIDDLE);
    } else {
        if (!"".equals(this.label.getText())) {
            bloc.add(this.label);
            if (this.labelOuverture != null) {
                bloc.add(this.labelOuverture);
                labelOuverture.setVisible(false);
            }
        }
    }

    bloc.add(this.champLectureSeule);

    if (this.champ != null && !(champ instanceof CheckBox)) {
        bloc.add(this.champ);
        bloc.setCellVerticalAlignment(this.champ, HasAlignment.ALIGN_MIDDLE);
    }

    if (this.icone != null) {
        bloc.add(icone);
        icone.setVisible(false);
        bloc.setCellVerticalAlignment(icone, HasAlignment.ALIGN_MIDDLE);
    }

    if (this.aide != null) {
        bloc.add(aide);
        aide.setVisible(false);
        bloc.setCellVerticalAlignment(aide, HasAlignment.ALIGN_MIDDLE);
    }

    bloc.setCellVerticalAlignment(this.label, HasAlignment.ALIGN_MIDDLE);
    if (this.labelOuverture != null) {
        bloc.setCellVerticalAlignment(this.labelOuverture, HasAlignment.ALIGN_MIDDLE);
    }
    bloc.setCellVerticalAlignment(this.champLectureSeule, HasAlignment.ALIGN_MIDDLE);
    bloc.setVisible(!afficherChampDepliement);
    this.initWidget(bloc);
}

From source file:com.webgocommerce.client.view.uiadditemlista.UIAddItemLista.java

private void initComponents() {
    lstFamilia = new ListModelFamilia();
    progreso = new ProgressBar();
    header = new HeaderMenu();
    lblCenter = new Label("CATEGORIA - LISTA");
    btnActualizar = new Button("Buscar");
    btnBack = new PushButton(new Image(MyResource.INSTANCE.getImgBack32()));
    btnBack.setTitle("Volver Atras");
    header.setLeftWidget(btnBack);/*  w w  w. ja v a  2  s.  co m*/
    header.setCenterWidget(lblCenter);
    //header.setRightWidget(btnActualizar);
    //formBuscar = new FlexTable();
    //lblBuscar = new Label("Buscar:");
    txtBuscar = new MSearchBox();
    txtBuscar.getElement().setPropertyString("placeholder", "escriba aqui");
    //formBuscar.setWidget(0, 0, lblBuscar);
    //formBuscar.setWidget(0, 1, txtBuscar);
    grid = new GridItemSinLista();
    //grid.setAlwaysShowScrollBars(true);
    grid.setMinimumTableWidth(1024, Style.Unit.PX);
    pnlGuardar = new FlowPanel();
    btnGuardar = new com.googlecode.mgwt.ui.client.widget.button.Button("Agregar a Lista");
    pnlGuardar.add(btnGuardar);
    btnGuardar.setConfirm(true);
    this.getPnlTabla().add(grid);
    this.getPnlTabla().add(grid.getPager());
    this.getPnlTabla().add(pnlGuardar);
    this.getPnlBusqueda().add(header);
    HorizontalPanel pnlSearch = new HorizontalPanel();
    pnlSearch.add(lstFamilia);
    pnlSearch.add(txtBuscar);
    pnlSearch.add(btnActualizar);
    pnlSearch.setCellVerticalAlignment(lstFamilia, HasVerticalAlignment.ALIGN_MIDDLE);
    pnlSearch.setCellVerticalAlignment(btnActualizar, HasVerticalAlignment.ALIGN_MIDDLE);
    this.getPnlBusqueda().add(pnlSearch);
    this.getPnlBotones().setVisible(false);
    Window.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            reCalcularWindows();
        }
    });
}

From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java

public static void setupStatusRegion(LayoutManager lm) {
    final HorizontalPanel hp = new HorizontalPanel();
    Region statusBar = new BaseRegion(STATUS) {
        @Override// w  ww  . jav  a2  s.c o  m
        public void setDisplay(Widget display) {
            GwtUtil.setStyles(display, "fontSize", "12px", "lineHeight", "40px");
            super.setDisplay(display);
        }

        @Override
        public void hide() {
            hp.setVisible(false);
        }

        @Override
        public void show() {
            hp.setVisible(true);
        }
    };

    Image im = new Image("images/gxt/attention.gif");
    im.setSize("16px", "16px");
    GwtUtil.setStyle(im, "marginLeft", "20px");
    hp.add(im);
    hp.add(statusBar.getDisplay());
    hp.getElement().setId("app-status");
    hp.setSize("99%", "40px");
    hp.setCellVerticalAlignment(im, VerticalPanel.ALIGN_MIDDLE);
    hp.setCellVerticalAlignment(statusBar.getDisplay(), VerticalPanel.ALIGN_MIDDLE);
    hp.setVisible(false);

    RootPanel.get("application").add(hp);
    lm.addRegion(statusBar);
}

From source file:edu.caltech.ipac.firefly.ui.catalog.CatalogPanel.java

private void createContents() {
    _targetPanelHolder.setWidget(_targetPanel);
    _projSelect.clear();//from  ww w.j av  a2s.  com
    for (Proj proj : _catalogData.getProjects()) {
        _projSelect.addItem(proj.getShortProjName());
    }

    initChangeHandlers();
    createTargetPanel();
    createSearchMethodPanel();
    initCatalogDisplay();

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(_searchMethod);
    hp.add(_searchMethodPanel);
    _searchMethodPanel.addStyleName("standard-border");
    hp.setCellVerticalAlignment(_searchMethod, HorizontalPanel.ALIGN_MIDDLE);
    DOM.setStyleAttribute(_searchMethod.getElement(), "paddingRight", "20px");

    FlexTable grid = new FlexTable();

    Label projLab = new Label(_prop.getName("proj"));
    projLab.setWidth(LABEL_WIDTH);
    _catagoryLab.setWidth(LABEL_WIDTH);

    Label pad = new Label(" ");
    pad.setHeight("25px");

    DOM.setStyleAttribute(grid.getElement(), "paddingTop", "5px");
    grid.setWidget(0, 0, projLab);
    grid.setWidget(0, 1, _projSelect);
    grid.setWidget(1, 0, _catagoryLab);
    grid.setWidget(1, 1, _catagorySelect);
    grid.setWidget(1, 2, pad);
    grid.setCellSpacing(5);

    Widget link = GwtUtil.makeLinkButton("Set Column Restrictions", "Set Column Restrictions",
            new ClickHandler() {
                public void onClick(ClickEvent event) {
                    showCatalogDialog();
                }
            });

    vp.add(_targetCards);
    vp.add(hp);
    vp.add(grid);
    vp.add(link);
    vp.add(new HTML("<br><br>"));
    //        vp.add(_catTable);
    //        vp.setCellHeight(_catTable, "250px");
    _catTable.addStyleName("standard-border");

    VerticalPanel catalogSide = new VerticalPanel();
    catalogSide.add(_catalogTitle);
    catalogSide.add(_catTable);

    GwtUtil.setStyle(_catalogTitle, "padding", "5px 0 5px 1px");

    masterPanel.add(vp);
    masterPanel.add(catalogSide);
    GwtUtil.setStyle(catalogSide, "marginLeft", "30px");

    catalogSide.setWidth(_inDialog ? "88%" : "100%");
    masterPanel.setCellWidth(catalogSide, "100%");
    //        masterPanel.setCellHeight(catalogSide, "300px");

    catalogSide.setCellWidth(_catTable, "90%");
    catalogSide.setCellHeight(_catTable, "300px");
    catalogSide.setCellHorizontalAlignment(_catTable, HasHorizontalAlignment.ALIGN_RIGHT);

    //        masterPanel.setCellWidth(_catTable, "90%");
    //        masterPanel.setCellHeight(_catTable, "300px");
    //        masterPanel.setCellHorizontalAlignment(_catTable, HasHorizontalAlignment.ALIGN_RIGHT);

    GwtUtil.setStyle(link, "paddingLeft", "5px");
    masterPanel.setSpacing(3);

    addKeyPressToAll(masterPanel);

    updateProj();
    showSearchMethodPanel();
    //        onResize();
}

From source file:edu.colorado.csdms.wmt.client.ui.dialog.SaveDialogBox.java

License:Open Source License

/**
 * Makes a SaveDialogBox with a user-supplied name.
 * /*from   ww w .  ja  v  a 2 s. c  o  m*/
 * @param data the DataManager object for the WMT session
 * @param modelName a descriptive name for the model
 */
public SaveDialogBox(DataManager data, String modelName) {

    super(false); // autohide
    this.setModal(true);
    this.setText("Save Model As...");
    this.setStyleName("wmt-DialogBox");
    this.data = data;

    namePanel = new FieldPanel(modelName);

    final Button labelsButton = new Button(Constants.FA_TAGS + "Labels");
    labelsButton.setStyleName("wmt-Button");
    labelsMenu = new LabelsSaveModelMenu(data);
    labelsButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            labelsMenu.setPopupPositionAndShow(new PositionCallback() {
                final Integer x = labelsButton.getElement().getAbsoluteRight();
                final Integer y = labelsButton.getAbsoluteTop();

                @Override
                public void setPosition(int offsetWidth, int offsetHeight) {
                    labelsMenu.setPopupPosition(x, y);
                }
            });
        }
    });

    HorizontalPanel row = new HorizontalPanel();
    row.setSpacing(5); // px
    row.add(namePanel);
    row.add(labelsButton);
    row.setCellVerticalAlignment(labelsButton, HasVerticalAlignment.ALIGN_MIDDLE);

    choicePanel = new ChoicePanel();
    choicePanel.getOkButton().setHTML(Constants.FA_SAVE + "Save");

    VerticalPanel contents = new VerticalPanel();
    contents.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    contents.add(row);
    contents.add(choicePanel);

    this.setWidget(contents);
}