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

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

Introduction

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

Prototype

public void setCaptionText(String text) 

Source Link

Document

Sets the caption for the panel using text that will be automatically escaped.

Usage

From source file:com.qualogy.qafe.gwt.client.vo.handlers.SetPropertyHandler.java

License:Apache License

private void handleTitle(UIObject uiObject, String value) {
    if (uiObject instanceof CaptionPanel) {
        CaptionPanel p = (CaptionPanel) uiObject;
        p.setCaptionText(value);
    }//from  ww  w  .java2  s .  c o  m
}

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

License:Open Source License

/**
 * Constructeur./*from  w  w w  . ja v  a 2 s  .  c  o  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:org.mklab.taskit.client.ui.admin.AdminViewImpl.java

License:Apache License

/**
 * {@inheritDoc}/*from www .  ja v a2  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 {/*w w  w.  j  a  v a2  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:ru.ksu.niimm.cll.mocassin.frontend.viewer.client.DocumentStructureGraphPanel.java

License:Open Source License

public DocumentStructureGraphPanel() {
    CaptionPanel captionPanel = uiBinder.createAndBindUi(this);
    captionPanel.setCaptionText(constants.graphPanelTitle());
    initWidget(captionPanel);/*from w ww.  j ava2  s.  c  o  m*/
}