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

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

Introduction

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

Prototype

public CaptionPanel() 

Source Link

Document

Constructs a CaptionPanel with an empty caption.

Usage

From source file:com.square.client.gwt.client.view.personne.physique.opportunites.gestion.OpportuniteBlocViewImpl.java

License:Open Source License

private void construireBloc() {
    captionPanel = new CaptionPanel();
    lType = new Label();
    lObjet = new Label();
    lSousObjet = new Label();
    lStatut = new Label();
    lDateCreation = new Label();
    lCreateur = new Label();
    captionPanel.setCaptionText(viewConstants.titreOpportunite());
    final SuggestListBoxSingleProperties<DimensionRessourceModel> properties = new SuggestListBoxSingleProperties<DimensionRessourceModel>() {
        @Override// w w w . j  ava2  s  .  co m
        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() };
        }
    };

    slbsRessource = new DecoratedSuggestListBoxSingle<DimensionRessourceModel>(properties);
    slbsRessource.ensureDebugId(viewDebugIdConstants.debugIdSlbsRessource());
    aideslbsRessource = new AideComposant(
            AideComposantConstants.AIDE_PERSONNE_PHYSIQUE_OPPORTUNITES_GESTION_RESSOURCE, isAdmin);
    ajouterAideComposant(aideslbsRessource);

    final HorizontalPanel panelslbsRessource = new HorizontalPanel();
    panelslbsRessource.add(slbsRessource);
    panelslbsRessource.add(aideslbsRessource);
    panelslbsRessource.setSpacing(5);

    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> propertiesAgence = 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() };
        }
    };
    slbsAgence = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(propertiesAgence);
    slbsAgence.ensureDebugId(viewDebugIdConstants.debugIdSlbsAgence());
    aideslbsAgence = new AideComposant(
            AideComposantConstants.AIDE_PERSONNE_PHYSIQUE_OPPORTUNITES_GESTION_AGENCE, isAdmin);
    ajouterAideComposant(aideslbsAgence);
    final HorizontalPanel panelslbsAgence = new HorizontalPanel();
    panelslbsAgence.add(slbsAgence);
    panelslbsAgence.add(aideslbsAgence);
    panelslbsAgence.setSpacing(5);

    final List<ChampSynthese> listeChamps = new ArrayList<ChampSynthese>();
    listeChamps.add(new ChampSynthese(lType, viewConstants.type(), true));
    listeChamps.add(new ChampSynthese(lObjet, viewConstants.objet(), true));
    listeChamps.add(new ChampSynthese(lSousObjet, viewConstants.sousObjet(), true));
    listeChamps.add(new ChampSynthese(panelslbsAgence, viewConstants.agence(),
            iconeErreurChampManager.createInstance("opportuniteModificationDto.agence", slbsAgence), true));
    listeChamps.add(new ChampSynthese(lStatut, viewConstants.statut(), true));
    listeChamps.add(new ChampSynthese(lDateCreation, viewConstants.dateCreation(), true));
    listeChamps.add(new ChampSynthese(lCreateur, viewConstants.createur(), true));
    listeChamps.add(new ChampSynthese(panelslbsRessource, viewConstants.ressource(),
            iconeErreurChampManager.createInstance("opportuniteModificationDto.ressource", slbsRessource),
            true));
    blocSyntheseDepliant = new BlocSyntheseDepliant(listeChamps, contenu, 4);
    blocSyntheseDepliant.ensureDebugId(viewDebugIdConstants.debugIdSBlocSyntheseDepliant());
    captionPanel.add(blocSyntheseDepliant);
    conteneur.add(captionPanel);
}

From source file:com.square.composant.fusion.square.client.composants.BlocChampsPersonneFusion.java

License:Open Source License

/**
 * Constructeur./*from w w w.  ja  v a 2s. co m*/
 * @param isSource boolen pour savoir si le bloc concerne une personne source ou une personne cible.
 * @param personneSourceFusion les informations de la personne source.
 * @param personneCibleFusion les informations de la personne cible.
 * @param constantes les constantes.
 */
public BlocChampsPersonneFusion(boolean isSource, PersonneSourceFusionModel personneSourceFusion,
        PersonneCibleFusionModel personneCibleFusion, ConstantesModel constantes) {
    // Cration des constantes du composant
    composantConstants = (BlocChampsPersonneFusionConstants) GWT
            .create(BlocChampsPersonneFusionConstants.class);

    this.personneSourceEnCours = personneSourceFusion;
    this.personneCibleEnCours = personneCibleFusion;
    this.isSource = isSource;
    this.constantes = constantes;

    this.setWidth(ComposantFusionPresenterConstants.POURCENT_100);

    lAucunChampsAFusionner = new Label(composantConstants.aucunChampAFusionner());
    btnSelection = new DecoratedButton(composantConstants.btnToutSelectionner());
    btnSelection.setVisible(this.isSource);
    btnSelection.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            if (composantConstants.btnToutSelectionner().equals(btnSelection.getText())) {
                modifierSelectionFusion(true);
            } else {
                modifierSelectionFusion(false);
            }
        }
    });

    String numClient = "";
    String dateCreation = "";
    if (isSource && personneSourceEnCours != null) {
        numClient = personneSourceEnCours.getNumeroClient();
        dateCreation = personneSourceEnCours.getDateCreation();
    } else if (!isSource && personneCibleEnCours != null) {
        numClient = personneCibleEnCours.getNumeroClient();
        dateCreation = personneCibleEnCours.getDateCreation();
    }
    final Label lNumClient = new Label(composantConstants.numeroClient() + " " + numClient);
    lNumClient.addStyleName(ComposantFusionPresenter.RESOURCES.css().numeroClient());
    final Label lDateCreation = new Label(composantConstants.dateCreation() + " " + dateCreation);
    lDateCreation.addStyleName(ComposantFusionPresenter.RESOURCES.css().dateCreation());

    // Ajout du numro du client
    final VerticalPanel pInfosClient = new VerticalPanel();
    pInfosClient.add(lNumClient);
    pInfosClient.add(lDateCreation);
    pInfosClient.setSpacing(5);
    final HorizontalPanel pClient = new HorizontalPanel();
    pClient.setHeight(BlocChampsPersonneFusionConstants.HAUTEUR_NUM_CLIENT);
    pClient.setWidth(ComposantFusionPresenterConstants.POURCENT_100);
    pClient.add(pInfosClient);
    pClient.setCellVerticalAlignment(lNumClient, ALIGN_MIDDLE);
    pClient.add(btnSelection);
    pClient.setCellVerticalAlignment(btnSelection, ALIGN_MIDDLE);
    pClient.setCellHorizontalAlignment(btnSelection, ALIGN_RIGHT);

    pContenu = new VerticalPanel();
    pContenu.setWidth(ComposantFusionPresenterConstants.POURCENT_100);
    pContenu.addStyleName(ComposantFusionPresenter.RESOURCES.css().contenuBloc());
    pContenu.add(pClient);

    // Construction du tableau des champs de la personne
    construireTableauChamps();

    final CaptionPanel pBloc = new CaptionPanel();
    // Dfinition du style et du titre en fonction si le bloc est d'une personne source ou d'une personne cible
    if (this.isSource) {
        pBloc.addStyleName(ComposantFusionPresenter.RESOURCES.css().blocSource());
        pBloc.setCaptionText(composantConstants.titreClientSource());
    } else {
        pBloc.addStyleName(ComposantFusionPresenter.RESOURCES.css().blocCible());
        pBloc.setCaptionText(composantConstants.titreClientCible());
    }
    pBloc.add(pContenu);
    this.add(pBloc);
}

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

License:Open Source License

/**
 * Ajoute un panel contenant les informations d'un enfant.
 * @param enfant/*from w  w  w  .j  ava2 s  .c o m*/
 */
private void construirePanel(String suffix) {
    final Label lNumSs = new Label(viewConstants.lNumSs());
    lRelation = new Label(viewConstants.relation());
    final Label lRegime = new Label(viewConstants.lRegime());
    final Label lCaisse = new Label(viewConstants.lCaisse());
    final Label lTns = new Label(viewConstants.lTns(), false);
    final Label lLoiMadelin = new Label(viewConstants.lLoiMadelin(), false);
    final Label lcouvertNow = new Label(viewConstants.lcouvertNow(), false);
    final Label lcouvert6DerniersMois = new Label(viewConstants.lcouvert6DerniersMois(), false);

    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = 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 SuggestListBoxSingleProperties<IdentifiantEidLibelleModel> slbIdentifiantEidLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantEidLibelleModel>() {
        @Override
        public String getSelectSuggestRenderer(IdentifiantEidLibelleModel row) {
            return row == null ? "" : row.getLibelle();
        }

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

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

    final SuggestListBoxSingleProperties<CaisseSimpleModel> slbCaisseProperties = new SuggestListBoxSingleProperties<CaisseSimpleModel>() {
        @Override
        public String getSelectSuggestRenderer(CaisseSimpleModel row) {
            return row == null ? "" : row.getCode() + "." + row.getCentre() + "." + row.getNom();
        }

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

        @Override
        public String[] getResultRowsRenderer(CaisseSimpleModel row) {
            return new String[] {
                    row == null ? "" : row.getCode() + "." + row.getCentre() + "." + row.getNom() };
        }
    };
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> propertiesRelation = 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() };
        }
    };

    lbSsReferents = new DecoratedSuggestListBoxSingle<IdentifiantEidLibelleModel>(
            slbIdentifiantEidLibelleProperties);
    tbNumSs = new DecoratedTextBox();
    tbNumSs.setMaxLength(InfosAdhesionViewImplConstants.LONGUEUR_NUM_SECURITE_SOCIALE);
    tbCleSs = new DecoratedTextBox();
    tbCleSs.setMaxLength(InfosAdhesionViewImplConstants.LONGUEUR_CLE_SECURITE_SOCIALE);
    tbCleSs.setWidth(InfosAdhesionViewImplConstants.LARGEUR_TB_CLE_SS);
    slbRelation = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(propertiesRelation);
    setRelationVisible(false);
    lbRegime = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    lbCaisse = new DecoratedSuggestListBoxSingle<CaisseSimpleModel>(slbCaisseProperties);
    cbTns = new CheckBox();
    cbLoiMadelin = new CheckBox();
    cbCouvertNow = new CheckBox();
    cbCouvert6DerniersMois = new CheckBox();

    final HorizontalPanel hpSecuSociale = new HorizontalPanel();
    hpSecuSociale.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    hpSecuSociale.add(lbSsReferents);
    hpSecuSociale.add(new HTML("&nbsp;"));
    hpSecuSociale.add(tbNumSs);
    hpSecuSociale.add(new HTML("&nbsp;"));
    hpSecuSociale.add(construireBlocIcone(tbCleSs, "PersonneDto.numSecuriteSocial" + suffix));

    final FlexTable flexTable = new FlexTable();
    flexTable.setWidth(ComposantTarificateurConstants.POURCENT_100);
    flexTable.setCellSpacing(3);
    flexTable.setWidget(0, 0, lNumSs);
    flexTable.setWidget(0, 1, hpSecuSociale);
    flexTable.setWidget(1, 0, lRegime);
    flexTable.setWidget(1, 1, construireBlocIcone(lbRegime, "PersonneDto.eidRegime" + suffix));
    flexTable.setWidget(1, 2, lCaisse);
    flexTable.setWidget(1, 3, construireBlocIcone(lbCaisse, "PersonneDto.eidCaisse" + suffix));
    flexTable.setWidget(2, 0, lTns);
    flexTable.setWidget(2, 1, cbTns);
    flexTable.setWidget(2, 2, lLoiMadelin);
    flexTable.setWidget(2, 3, cbLoiMadelin);
    flexTable.setWidget(3, 0, lcouvertNow);
    flexTable.setWidget(3, 1, cbCouvertNow);
    flexTable.setWidget(3, 2, lcouvert6DerniersMois);
    flexTable.setWidget(3, 3, cbCouvert6DerniersMois);
    flexTable.setWidget(4, 0, lRelation);
    flexTable.setWidget(4, 1, construireBlocIcone(slbRelation, "RelationDto.type" + suffix));
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 3);
    flexTable.getColumnFormatter().setWidth(0, InfosAdhesionViewImplConstants.LARGEUR_COL_LIBELLE_0);
    flexTable.getColumnFormatter().setWidth(1, InfosAdhesionViewImplConstants.LARGEUR_COL_CHAMP_1);
    flexTable.getColumnFormatter().setWidth(2, InfosAdhesionViewImplConstants.LARGEUR_COL_LIBELLE_2);
    flexTable.getColumnFormatter().setWidth(3, InfosAdhesionViewImplConstants.LARGEUR_COL_CHAMP_3);

    panel = new CaptionPanel();
    panel.add(flexTable);
    container.add(panel);
}

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

License:Open Source License

/**
 * Ajoute un panel contenant les informations d'un enfant.
 * @param enfant//from www.j  av a 2 s.  com
 */
private void construirePanel(String suffix) {
    final Label lNumSs = new Label(viewConstants.lNumSs());
    final Label lRegime = new Label(viewConstants.lRegime());
    final Label lCaisse = new Label(viewConstants.lCaisse());
    lRelation = new Label(viewConstants.relation());

    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = 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 SuggestListBoxSingleProperties<IdentifiantEidLibelleModel> slbIdentifiantEidLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantEidLibelleModel>() {
        @Override
        public String getSelectSuggestRenderer(IdentifiantEidLibelleModel row) {
            return row == null ? "" : row.getLibelle();
        }

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

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

    final SuggestListBoxSingleProperties<CaisseSimpleModel> slbCaisseProperties = new SuggestListBoxSingleProperties<CaisseSimpleModel>() {
        @Override
        public String getSelectSuggestRenderer(CaisseSimpleModel row) {
            return row == null ? "" : row.getCode() + "." + row.getCentre() + "." + row.getNom();
        }

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

        @Override
        public String[] getResultRowsRenderer(CaisseSimpleModel row) {
            return new String[] {
                    row == null ? "" : row.getCode() + "." + row.getCentre() + "." + row.getNom() };
        }
    };
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> propertiesRelation = 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() };
        }
    };

    lbSsReferents = new DecoratedSuggestListBoxSingle<IdentifiantEidLibelleModel>(
            slbIdentifiantEidLibelleProperties);
    tbNumSs = new DecoratedTextBox();
    tbNumSs.setMaxLength(InfosAdhesionViewImplConstants.LONGUEUR_NUM_SECURITE_SOCIALE);
    tbCleSs = new DecoratedTextBox();
    tbCleSs.setMaxLength(InfosAdhesionViewImplConstants.LONGUEUR_CLE_SECURITE_SOCIALE);
    tbCleSs.setWidth(InfosAdhesionViewImplConstants.LARGEUR_TB_CLE_SS);
    lbRegime = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(slbIdentifiantLibelleProperties);
    lbCaisse = new DecoratedSuggestListBoxSingle<CaisseSimpleModel>(slbCaisseProperties);
    slbRelation = new DecoratedSuggestListBoxSingle<IdentifiantLibelleGwt>(propertiesRelation);
    setRelationVisible(false);

    final HorizontalPanel hpSecuSociale = new HorizontalPanel();
    hpSecuSociale.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    hpSecuSociale.add(lbSsReferents);
    hpSecuSociale.add(new HTML("&nbsp;"));
    hpSecuSociale.add(tbNumSs);
    hpSecuSociale.add(new HTML("&nbsp;"));
    hpSecuSociale.add(construireBlocIcone(tbCleSs, "PersonneDto.numSecuriteSocial" + suffix));

    final FlexTable flexTable = new FlexTable();
    flexTable.setWidth(ComposantTarificateurConstants.POURCENT_100);
    flexTable.setCellSpacing(3);
    flexTable.setWidget(0, 0, lNumSs);
    flexTable.setWidget(0, 1, hpSecuSociale);
    flexTable.setWidget(1, 0, lRegime);
    flexTable.setWidget(1, 1, construireBlocIcone(lbRegime, "PersonneDto.eidRegime" + suffix));
    flexTable.setWidget(1, 2, lCaisse);
    flexTable.setWidget(1, 3, construireBlocIcone(lbCaisse, "PersonneDto.eidCaisse" + suffix));
    flexTable.setWidget(2, 0, lRelation);
    flexTable.setWidget(2, 1, construireBlocIcone(slbRelation, "RelationDto.type" + suffix));
    flexTable.getFlexCellFormatter().setColSpan(0, 1, 3);
    flexTable.getColumnFormatter().setWidth(0, InfosAdhesionViewImplConstants.LARGEUR_COL_LIBELLE_0);
    flexTable.getColumnFormatter().setWidth(1, InfosAdhesionViewImplConstants.LARGEUR_COL_CHAMP_1);
    flexTable.getColumnFormatter().setWidth(2, InfosAdhesionViewImplConstants.LARGEUR_COL_LIBELLE_2);
    flexTable.getColumnFormatter().setWidth(3, InfosAdhesionViewImplConstants.LARGEUR_COL_CHAMP_3);

    panel = new CaptionPanel();
    panel.add(flexTable);
    container.add(panel);
}

From source file:org.cruxframework.crux.widgets.client.listshuttle.ListShuttle.java

License:Apache License

public ListShuttle(List<T> availableItems, List<T> selectedItems) {
    listShuttle = new FlowPanel();

    //First Column
    FlowPanel toSelectColumn = new FlowPanel();
    toSelectColumn.setStyleName("toSelectColumn");

    toSelectColumnFieldset = new CaptionPanel();
    toSelectColumnFieldset.setStyleName("toSelectColumnFieldset");

    availableCellList = new CellList<T>(new BeanCell());
    availableCellList.setSelectionModel(new MultiSelectionModel<T>());

    //Middle Column
    FlowPanel buttonsColumn = new FlowPanel();
    buttonsColumn.setStyleName("buttonsColumn");

    addSelectedButton = new Button();
    addSelectedButton.setText(">");
    addAllButton = new Button();
    addAllButton.setText(">>");
    removeSelectedButton = new Button();
    removeSelectedButton.setText("<");
    removeAllButton = new Button();
    removeAllButton.setText("<<");

    //Last Column
    FlowPanel selectedColumn = new FlowPanel();
    selectedColumn.setStyleName("selectedColumn");

    selectedColumnFieldset = new CaptionPanel();
    selectedColumnFieldset.setStyleName("selectedColumnFieldset");

    selectedCellList = new CellList<T>(new BeanCell());
    selectedCellList.setSelectionModel(new MultiSelectionModel<T>());

    //Attaching columns
    toSelectColumnFieldset.add(availableCellList);
    selectedColumnFieldset.add(selectedCellList);

    toSelectColumn.add(toSelectColumnFieldset);
    selectedColumn.add(selectedColumnFieldset);

    buttonsColumn.add(addSelectedButton);
    buttonsColumn.add(addAllButton);/*from  w  ww.  ja  va  2 s  . c om*/
    buttonsColumn.add(removeSelectedButton);
    buttonsColumn.add(removeAllButton);

    listShuttle.add(toSelectColumn);
    listShuttle.add(buttonsColumn);
    listShuttle.add(selectedColumn);

    //Initializing Component
    setAvailableItems(availableItems);
    setSelectedItems(selectedItems);
    bindHandlers();
    initWidget(listShuttle);
    setStyleName("crux-ListShuttle");
}

From source file:org.cruxframework.crux.widgets.client.sortablelist.SortableList.java

License:Apache License

public SortableList(List<Widget> items) {
    sortableList = new FlowPanel();

    //listColumn//w  ww .ja v a2  s .c o  m
    FlowPanel listColumn = new FlowPanel();
    listColumn.setStyleName("listColumn");

    listColumnFieldset = new CaptionPanel();
    listColumnFieldset.setStyleName("listColumnFieldset");

    cellList = new CellList<Widget>(new BeanCell());
    cellList.setSelectionModel(new SingleSelectionModel<Widget>());

    //ButtonsColumn
    FlowPanel buttonsColumn = new FlowPanel();
    buttonsColumn.setStyleName("buttonsColumn");

    upButton = new Button();
    upButton.setText("U");
    downButton = new Button();
    downButton.setText("D");

    buttonsColumn.add(upButton);
    buttonsColumn.add(downButton);

    //Fieldset
    listColumn.add(listColumnFieldset);
    listColumnFieldset.add(cellList);

    sortableList.add(listColumn);
    sortableList.add(buttonsColumn);

    //Initializing Component
    setItems(items);
    bindHandlers();
    initWidget(sortableList);
    setStyleName("crux-sortableList");
}

From source file:org.kaaproject.kaa.server.admin.client.mvp.view.widget.RecordPanel.java

License:Apache License

public RecordPanel(AvroWidgetsConfig config, boolean showCaption, String title, HasErrorMessage hasErrorMessage,
        boolean optional, boolean readOnly) {
    this.showCaption = showCaption;
    this.optional = optional;
    this.readOnly = readOnly;
    this.hasErrorMessage = hasErrorMessage;
    FlexTable table = new FlexTable();
    table.setWidth("100%");
    if (config == null) {
        config = new AvroWidgetsConfig.Builder().createConfig();
    }//from  w ww  .ja v  a  2 s  .c om

    recordFieldWidget = new RecordFieldWidget(config, readOnly);
    if (showCaption) {
        recordCaption = new CaptionPanel();
        setTitle(title);
        recordCaption.setContentWidget(recordFieldWidget);
        table.setWidget(0, 0, recordCaption);
    } else {
        table.setWidget(0, 0, recordFieldWidget);
    }

    Label uploadLabel = new Label(Utils.constants.uploadFromFile());
    recordFileUpload = new FileUploadForm();
    recordFileUpload.addSubmitCompleteHandler(new SubmitCompleteHandler() {
        @Override
        public void onSubmitComplete(SubmitCompleteEvent event) {
            loadRecordFromFile();
        }
    });
    recordFileUpload.addChangeHandler(this);
    recordFileItemName = recordFileUpload.getFileItemName();
    uploadButton = new Button(Utils.constants.upload(), new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            recordFileUpload.submit();
        }
    });
    uploadButton.addStyleName(Utils.kaaAdminStyle.bAppButtonSmall());
    uploadButton.setEnabled(false);
    uploadTable = new FlexTable();
    uploadTable.setWidget(0, 0, uploadLabel);
    uploadTable.setWidget(0, 1, recordFileUpload);
    uploadTable.setWidget(0, 2, uploadButton);
    uploadTable.getFlexCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE);
    uploadTable.getFlexCellFormatter().setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_MIDDLE);
    table.setWidget(1, 0, uploadTable);
    setWidget(table);
    setUploadVisible(!readOnly);
    formDataLoader = new DefaultFormDataLoader();
}

From source file:org.mklab.taskit.client.ui.admin.AdminViewImpl.java

License:Apache License

/**
 * {@inheritDoc}//  www.  j  av a 2  s.c  o  m
 */
@Override
protected Widget initContent() {
    final Messages messages = getClientFactory().getMessages();
    this.lectureButton = new Button(messages.editLecturesLabel());
    this.reportButton = new Button(messages.editReportsLabel());
    this.userButton = new Button(messages.editUsersLabel());

    this.lectureButton.setWidth("100%"); //$NON-NLS-1$
    this.reportButton.setWidth("100%"); //$NON-NLS-1$
    this.userButton.setWidth("100%"); //$NON-NLS-1$

    final VerticalPanel pn = new VerticalPanel();
    pn.add(this.lectureButton);
    pn.add(this.reportButton);
    pn.add(this.userButton);
    pn.setCellHorizontalAlignment(this.lectureButton, HasHorizontalAlignment.ALIGN_CENTER);
    pn.setCellHorizontalAlignment(this.reportButton, HasHorizontalAlignment.ALIGN_CENTER);
    pn.setCellHorizontalAlignment(this.userButton, HasHorizontalAlignment.ALIGN_CENTER);

    final CaptionPanel caption = new CaptionPanel();
    caption.setCaptionText("Menu"); //$NON-NLS-1$
    caption.add(pn);

    final HorizontalPanel container = new HorizontalPanel();
    container.add(caption);
    return container;
}

From source file:org.pentaho.reporting.platform.plugin.gwt.client.ParameterControllerPanel.java

License:Open Source License

private void buildParameterPanel(final ParameterSubmitMode mode,
        final HashMap<String, ArrayList<String>> errors, final ArrayList<String> globalErrors,
        final ParameterDefinition parametersElement) {
    try {//from   w  w w .  j a va2  s  . com
        if (globalErrors != null && globalErrors.isEmpty() == false) {
            add(buildGlobalErrors(globalErrors));
        }

        // build parameter UI from document
        parameterContainer.clear();
        parameterWidgets.clear();

        // create a new parameter value map
        parameterMap = new ParameterValues();

        final String layout = parametersElement.getLayout();
        int totalParameterAdded = 0;
        // must preserve order
        final ParameterGroup[] parameterGroups = parametersElement.getParameterGroups();
        for (int i = 0; i < parameterGroups.length; i++) {
            final ParameterGroup group = parameterGroups[i];

            final Panel parameterGroupPanel;
            if (layout.equals("flow")) //$NON-NLS-1$
            {
                parameterGroupPanel = new FlowPanel();
            } else if (layout.equals("horizontal")) {
                parameterGroupPanel = new HorizontalPanel();
            } else {
                parameterGroupPanel = new VerticalPanel();
            }
            final String groupLabel = group.getLabel(); //$NON-NLS-1$

            int parametersAdded = 0;

            for (final Parameter parameterElement : group.getParameters()) {
                final String parameterName = parameterElement.getName(); //$NON-NLS-1$
                final List<ParameterSelection> list = parameterElement.getSelections();
                if (list.isEmpty() == false) {
                    final ArrayList<String> parameterSelections = new ArrayList<String>();
                    for (final ParameterSelection selection : list) {
                        if (selection.isSelected()) {
                            parameterSelections.add(selection.getValue());
                        }
                    }
                    parameterMap.setSelectedValues(parameterName,
                            parameterSelections.toArray(new String[parameterSelections.size()]));
                } else {
                    parameterMap.setSelectedValue(parameterName, null);
                }

                if (parameterElement.isHidden()) {
                    continue;
                }

                final String label = parameterElement.getLabel(); //$NON-NLS-1$
                final String tooltip = parameterElement.getTooltip(); //$NON-NLS-1$
                final Label parameterLabel = new Label(label);
                parameterLabel.setTitle(tooltip);
                parameterLabel.setStyleName("parameter-label"); //$NON-NLS-1$

                final VerticalPanel parameterPanel = new VerticalPanel();
                parameterPanel.setStyleName("parameter"); //$NON-NLS-1$
                parameterPanel.setTitle(tooltip);
                parameterPanel.add(parameterLabel);

                final Widget parameterWidget = buildParameterWidget(parametersElement, parameterElement);
                if (parameterWidget == null) {
                    continue;
                }

                parametersAdded += 1;

                // only add the parameter if it has a UI
                final ArrayList<String> parameterErrors = errors.get(parameterName);
                if (parameterErrors != null) {
                    for (final String error : parameterErrors) {
                        final Label errorLabel = new Label(error);
                        errorLabel.setStyleName("parameter-error-label");// NON-NLS
                        parameterPanel.add(errorLabel);
                    }
                    parameterPanel.setStyleName("parameter-error"); //$NON-NLS-1$
                }

                if (parameterWidget instanceof ParameterUI) {
                    parameterWidgets.add((ParameterUI) parameterWidget);
                }
                parameterPanel.add(parameterWidget);

                if (layout.equals("flow")) //$NON-NLS-1$
                {
                    final SimplePanel div = new SimplePanel();
                    div.setStyleName("parameter-flow"); //$NON-NLS-1$
                    div.add(parameterPanel);
                    parameterGroupPanel.add(div);
                } else {
                    parameterGroupPanel.add(parameterPanel);
                }
            }

            totalParameterAdded += parametersAdded;
            if (parametersAdded > 0) {
                if (parametersElement.isSubscribe()) {
                    final CaptionPanel parameterGroupCaptionPanel = new CaptionPanel();
                    if (groupLabel != null && !groupLabel.equals("")) {
                        parameterGroupCaptionPanel.setCaptionText(groupLabel);
                    }
                    parameterGroupCaptionPanel.setStyleName("parameter"); //$NON-NLS-1$
                    parameterGroupCaptionPanel.setContentWidget(parameterGroupPanel);

                    final Panel panel = new SimplePanel();
                    panel.setStyleName("parameter-wrapper");
                    panel.add(parameterGroupCaptionPanel);
                    parameterContainer.add(panel);
                } else {
                    final Panel panel = new SimplePanel();
                    panel.setStyleName("parameter-wrapper");
                    panel.add(parameterGroupPanel);
                    parameterContainer.add(panel);
                }
            }
        }

        if (totalParameterAdded > 0) {
            // add parameter submit button/auto-submit checkbox
            final FlowPanel submitPanel = new FlowPanel();
            submitPanel.setWidth("100%"); //$NON-NLS-1$
            submitPanel.setStyleName("parameter-submit-panel"); //$NON-NLS-1$
            if (parametersElement.isSubscribe()) //$NON-NLS-1$ //$NON-NLS-2$
            {
                submitPanel.add(submitSubscriptionButton);
            }
            submitPanel.add(submitParametersButton);

            // handle the auto-submit defaults.
            final Boolean autoSubmitAttr = parametersElement.getAutoSubmit();
            if (Boolean.TRUE.equals(autoSubmitAttr)) {
                submitParametersOnChangeCheckBox.setValue(true);
            } else if (Boolean.FALSE.equals(autoSubmitAttr)) {
                submitParametersOnChangeCheckBox.setValue(false);
            } else {
                // BISERVER-3821 Provide ability to remove Auto-Submit check box from report viewer
                // only show the UI for the autosubmit checkbox if no preference exists
                submitPanel.add(submitParametersOnChangeCheckBox);
                submitParametersOnChangeCheckBox.setValue(parametersElement.isAutoSubmitUI());
            }

            parameterContainer.add(submitPanel);

            final SimplePanel parameterPanelWrapper = new SimplePanel();
            parameterPanelWrapper.setWidget(parameterContainer);
            parameterPanelWrapper.setStyleName("parameter-content-panel");
            parameterPanelWrapper.getElement().addClassName("pentaho-rounded-panel-bottom-lr");
            parameterPanelWrapper.getElement().addClassName("pentaho-shadow");

            parameterDisclosurePanel.setContent(parameterPanelWrapper);
            add(parameterDisclosurePanel);
        }

        // add pagination controller (if needed)
        if (parametersElement.isPaginate()) //$NON-NLS-1$ //$NON-NLS-2$
        {
            add(buildPaginationController(parametersElement.getProcessingState()));
        }
        if (globalErrors != null && globalErrors.isEmpty() == false) {
            add(buildGlobalErrors(globalErrors));
        }

        // do not show the parameter UI, but we must still fire events
        // if prompt is not needed
        if (parametersElement.isPromptNeeded() == false) {
            final boolean flag = (mode == ParameterSubmitMode.MANUAL);
            if (parametersElement.isAllowAutosubmit() || flag) {
                showReport();
            } else {
                showBlankPage();
            }
        } else {
            showBlankPage();
        }
    } catch (Exception e) {
        Window.alert("Failed in Build parameter panel");
    }
}

From source file:org.pentaho.ui.xul.gwt.tags.GwtGroupBox.java

License:Open Source License

public GwtGroupBox() {
    super(ELEMENT_NAME);
    this.orientation = Orient.VERTICAL;
    captionPanel = new CaptionPanel();
    setManagedObject(captionPanel);//  ww w.j  av a 2 s  .co m
    captionPanel.setStylePrimaryName("xul-fieldset");

    VerticalPanel vp;
    container = vp = new VerticalPanel();
    vp.setHeight("100%");
    vp.setSpacing(2);
    container.setWidth("100%");

    vp.setStyleName("vbox");

    ((VerticalPanel) container).setStyleName("vbox");
    captionPanel.add(vp);
}