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

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

Introduction

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

Prototype

public void setSpacing(int spacing) 

Source Link

Document

Sets the amount of spacing between this panel's cells.

Usage

From source file:com.qut.middleware.esoemanager.client.ui.policy.PolicyUI.java

License:Apache License

private void createGraphicalInterface() {

    this.policyPanel = new VerticalPanel();
    this.validationPanel = new HorizontalPanel();

    this.resources = new PolicyResourcesUI();
    this.actions = new PolicyActionsUI();

    this.rules = new ArrayList<RuleUI>();

    this.desc = new HiddenIntegratedTextBox(this, 1, null, "Policies are required to have a description",
            "Description", EsoeManagerConstants.areaID);
    this.id = new IntegratedLabel(this, "ID");

    this.active = new ActiveState();
    if (!this.newPolicy) {
        this.active.setDeactivated();

        this.loader = new Loader();
        this.loader.setVisible(false);
        this.activeToggle = new ConfirmationStyledButton("Change policy active state?", "toggle", "");
        this.activeToggle.addClickListener(new ClickListener() {

            public void onClick(Widget sender) {
                EsoeManager.contentService.toggleServicePolicyState(PolicyUI.this.serviceIdentifier,
                        PolicyUI.this.id.getText(), PolicyUI.this.active.isActive(),
                        new PolicyActivationHandler());
            }/*from  w ww. jav a  2  s .  c  o m*/
        });
    } else {
        this.resources.addValue();
        this.actions.addValue();
        this.active.setDeactivated();
    }

    if (this.newPolicy) {
        this.desc.showEditor();
    }

    this.content = new FlexibleTable(2, 2);

    this.localMessages = new MessagePanel();
    this.content.insertWidget(this.localMessages);
    this.content.nextRow();

    if (!this.newPolicy) {
        HorizontalPanel actPan = new HorizontalPanel();
        actPan.setSpacing(2);
        actPan.setVerticalAlignment(ALIGN_MIDDLE);
        actPan.add(this.active);
        actPan.add(this.activeToggle);

        this.content.insertWidget(actPan);
        this.content.nextRow();
    }

    HorizontalPanel descPan = new HorizontalPanel();
    descPan.setSpacing(2);
    descPan.setVerticalAlignment(ALIGN_MIDDLE);
    descPan.add(this.desc.getTitle());
    descPan.add(this.desc.getContent());
    this.content.insertWidget(descPan);
    this.content.nextRow();

    Label rulesLbl = new Label("This policy contains the following rules");

    StyledButton addRule = new StyledButton("add", "Add Rule");
    addRule.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            RuleUI rule = new RuleUI(PolicyUI.this, true);
            PolicyUI.this.rules.add(rule);
            PolicyUI.this.renderRules();
        }
    });

    this.rulesPanel = new VerticalPanel();
    this.rulesPanel.addStyleName(CSSConstants.esoeManagerPolicyRules);

    this.content.insertWidget(this.resources.getContent());
    this.content.nextRow();
    this.content.insertWidget(this.actions.getContent());
    this.content.nextRow();
    this.content.insertWidget(rulesLbl);
    this.content.insertWidget(addRule);
    this.content.nextRow();

    this.policyPanel.add(this.content);
    this.policyPanel.add(this.rulesPanel);

    this.validationMessage = new Label();
    this.validationPanel.setSpacing(5);
    this.validationPanel.add(new Loader());
    this.validationPanel.add(this.validationMessage);
    this.validationPanel.setVisible(false);

    this.graphicalEditor.add(this.policyPanel);
    this.graphicalEditor.add(this.validationPanel);
}

From source file:com.qut.middleware.esoemanager.client.ui.policy.RuleUI.java

License:Apache License

public void createContentInterface() {
    this.addStyleName(CSSConstants.esoeManagerPolicyRule);

    this.content = new VerticalPanel();
    this.content.addStyleName(CSSConstants.esoeManagerPolicyRuleContent);

    this.id = new HiddenIntegratedTextBox(this, 1, null, "Rules are required to have an ID", "ID",
            EsoeManagerConstants.areaID);
    this.desc = new HiddenIntegratedTextBox(this, 1, null, "Rules are required to have a description",
            "Description", EsoeManagerConstants.areaID);
    StyledButton showContent = new StyledButton("application", "");
    showContent.addClickListener(new ClickListener() {

        public void onClick(Widget sender) {

            // toggle content visibility
            content.setVisible(!content.isVisible());
        }/*from  www .  j  ava2 s  .c  o  m*/
    });

    ConfirmationStyledButton removeRule = new ConfirmationStyledButton("Really delete this rule?", "delete",
            "Delete");
    removeRule.addClickListener(new ClickListener() {

        public void onClick(Widget sender) {

            // toggle content visibility
            parent.deleteRule(RuleUI.this);
        }
    });

    HorizontalPanel banner = new HorizontalPanel();
    banner.addStyleName(CSSConstants.esoeManagerPolicyBanner);
    banner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    HorizontalPanel bannerTitle = new HorizontalPanel();
    bannerTitle.addStyleName(CSSConstants.esoeManagerPolicyBannerTitle);
    bannerTitle.setSpacing(5);
    bannerTitle.add(showContent);
    bannerTitle.add(new Label("Rule"));
    banner.add(bannerTitle);

    banner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    HorizontalPanel bannerButtons = new HorizontalPanel();
    bannerButtons.setSpacing(5);
    bannerButtons.add(removeRule);
    banner.add(bannerButtons);

    FlexibleTable heading = new FlexibleTable(2, 2);
    heading.nextRow();
    heading.insertWidget(this.id.getTitle());
    heading.insertWidget(this.id.getContent());
    heading.nextRow();
    heading.insertWidget(this.desc.getTitle());
    heading.insertWidget(this.desc.getContent());

    if (this.newRule) {
        this.id.showEditor();
        this.desc.showEditor();
    }

    this.localMessages = new MessagePanel();
    this.effect = new EffectUI();
    this.actions = new ActionsUI();
    if (this.newRule)
        this.actions.addValue();

    this.resources = new ResourcesUI();
    if (this.newRule)
        this.resources.addValue();

    this.condition = new ConditionUI(this, null, this.newRule, true);

    this.content.add(this.localMessages);
    this.content.add(this.effect);
    this.content.add(this.resources.getContent());
    this.content.add(this.actions.getContent());

    this.content.add(this.condition);

    if (!this.newRule)
        this.content.setVisible(false);

    this.add(banner);
    this.add(heading);
    this.add(this.content);
}

From source file:com.sensia.tools.client.swetools.editors.sensorml.panels.CenterPanel.java

License:Open Source License

private Panel getXMLViewPanel() {
    final HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(20);
    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    HTML title = new HTML("<b>SensorML XML:</b>");
    final Button load = new Button("Load");

    //init radio buttons choices
    final RadioButton fromLocalFileSystem = new RadioButton("myRadioGroup", "from local");
    final RadioButton fromUrl = new RadioButton("myRadioGroup", "from url");

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.add(fromLocalFileSystem);// w  w w . j  a  v  a  2 s. co  m
    hPanel.add(fromUrl);

    //container for either local file system input panel or url valueBox
    final SimplePanel fromPanel = new SimplePanel();

    //init file upload panel
    final ISourcePanel fileUploadPanel = new LocalFileSourcePanel(smlEditorProcessor, editCheckbox);

    //init url load
    final ISourcePanel urlDownloadPanel = new UrlSourcePanel(smlEditorProcessor, editCheckbox);

    //add to xml panel
    panel.add(title);
    panel.add(hPanel);
    panel.add(fromPanel);
    panel.add(load);

    //set from local file system panel as default choice
    fromLocalFileSystem.setChecked(true);
    fromPanel.add(fileUploadPanel.getPanel());

    //add listener to handle event
    load.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (fromLocalFileSystem.getValue()) {
                fileUploadPanel.parseContent();
            } else if (fromUrl.getValue()) {
                urlDownloadPanel.parseContent();
            }
        }
    });

    //add listener to handle from local file system handler
    fromLocalFileSystem.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
                fromPanel.clear();
                fromPanel.add(fileUploadPanel.getPanel());
            }
        }
    });

    //add listener to handle from local file system handler
    fromUrl.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue()) {
                fromPanel.clear();
                fromPanel.add(urlDownloadPanel.getPanel());
            }
        }
    });

    return panel;
}

From source file:com.sensia.tools.client.swetools.editors.sensorml.panels.CenterPanel.java

License:Open Source License

private Panel getProfilePanel() {
    final HorizontalPanel panel = new HorizontalPanel();
    panel.setSpacing(20);
    panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

    final ListBox profileListBox = new ListBox(false);

    profileListBox.addItem("");
    for (final String profileName : profiles.keySet()) {
        profileListBox.addItem(profileName);
    }/*w w w.j  a  va 2s.co m*/

    HTML titleProfile = new HTML("<b>Profiles:</b>");

    //button to load the selected profile
    Button load = new Button("Apply");
    editCheckbox = new CheckBox("Edit");

    panel.add(titleProfile);
    panel.add(profileListBox);
    panel.add(load);
    panel.add(editCheckbox);

    editCheckbox.setVisible(false);

    //after clicking on the checkbox, the mode is sent to the tree hierarchy starting from the Root element
    editCheckbox.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            if (root != null) {
                MODE mode = (editCheckbox.isChecked()) ? MODE.EDIT : MODE.VIEW;
                root.switchMode(mode);
            }
        }
    });

    load.addClickHandler(new LoadProfileButtonClickListener(profileListBox, profiles, smlEditorProcessor));

    return panel;
}

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

License:Open Source License

/**
 * Creates a new scroll panel with the given child widget.
 * @param tabBar the widget to be wrapped by the scroll panel
 * @param width largeur du scrollPanel, en units CSS (e.g. "10px", "1em")
 *///from w w  w.j a  v  a 2s. c om
public ExtendedScrollPanel(final ExtendedTabBar tabBar, int width) {
    this.tabBar = tabBar;

    imgScrollGauche = new Image(SmatisResources.INSTANCE.iconeOngletScrollGauche());
    imgScrollGaucheDisabled = new Image(SmatisResources.INSTANCE.iconeOngletScrollGaucheDisable());
    imgScrollDroite = new Image(SmatisResources.INSTANCE.iconeOngletScrollDroite());
    imgScrollDroiteDisabled = new Image(SmatisResources.INSTANCE.iconeOngletScrollDroiteDisable());

    scrollPanel = new SimplePanel();
    scrollPanel.add(tabBar);

    btnLeft = new PushButton(imgScrollGauche);
    btnLeft.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            btnRight.setVisible(true);
            btnRightDisabled.setVisible(false);
            final int scrollPosBefore = getHorizontalScrollPosition();
            if (scrollPosBefore > 0) {
                btnLeft.setVisible(true);
                btnLeftDisabled.setVisible(false);
            } else {
                btnLeft.setVisible(false);
                btnLeftDisabled.setVisible(true);
            }
            while (scrollPosBefore != 0 && scrollPosBefore == getHorizontalScrollPosition()) {
                indexOfLastVisibleWidget = Math.max(0, indexOfLastVisibleWidget - 1);
                ensureVisible((UIObject) (tabBar.getTab(indexOfLastVisibleWidget)));
            }

            // on grise les boutons apres le dplacement du scroll bar (il se peut qu'il y'ait un problme d'arrondi  un prs)
            if (getHorizontalScrollPosition() <= 1) {
                btnLeft.setVisible(false);
                btnLeftDisabled.setVisible(true);
            }
        }
    });
    btnLeft.setStylePrimaryName("optionsButton");
    btnLeft.setVisible(false);
    btnLeftDisabled = new PushButton(imgScrollGaucheDisabled);
    btnLeftDisabled.setStylePrimaryName("optionsButton");
    btnLeftDisabled.setVisible(false);

    btnRight = new PushButton(imgScrollDroite);
    btnRight.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            btnLeft.setVisible(true);
            btnLeftDisabled.setVisible(false);
            final int scrollPosBefore = getHorizontalScrollPosition();
            final int scrollMax = tabBar.getOffsetWidth() - scrollPanel.getOffsetWidth();
            if (scrollPosBefore < scrollMax) {
                btnRight.setVisible(true);
                btnRightDisabled.setVisible(false);
            } else {
                btnRight.setVisible(false);
                btnRightDisabled.setVisible(true);
            }
            while (scrollPosBefore != scrollMax && scrollPosBefore == getHorizontalScrollPosition()) {
                indexOfLastVisibleWidget = Math.min(tabBar.getTabCount() - 1, indexOfLastVisibleWidget + 1);
                ensureVisible((UIObject) (tabBar.getTab(indexOfLastVisibleWidget)));
            }

            indexOfLastVisibleWidget = Math.min(tabBar.getTabCount() - 1, indexOfLastVisibleWidget + 1);
            ensureVisible((UIObject) (tabBar.getTab(indexOfLastVisibleWidget)));

            // on grise les boutons apres le dplacement du scroll bar (il se peut qu'il y'ait un problme d'arrondi  un prs)
            if (getHorizontalScrollPosition() >= scrollMax - 1) {
                btnRight.setVisible(false);
                btnRightDisabled.setVisible(true);
            }
        }
    });
    btnRight.setStylePrimaryName("optionsButton");
    btnRight.setVisible(false);
    btnRightDisabled = new PushButton(imgScrollDroiteDisabled);
    btnRightDisabled.setStylePrimaryName("optionsButton");
    btnRightDisabled.setVisible(false);

    final HorizontalPanel pBtnLeft = new HorizontalPanel();
    pBtnLeft.setSpacing(0);
    pBtnLeft.add(btnLeft);
    pBtnLeft.add(btnLeftDisabled);
    final HorizontalPanel pBtnRight = new HorizontalPanel();
    pBtnRight.setSpacing(0);
    pBtnRight.add(btnRight);
    pBtnRight.add(btnRightDisabled);

    // Layout du composant
    layoutScrollPanel = new Grid(1, 3);
    layoutScrollPanel.setCellPadding(0);
    layoutScrollPanel.setCellSpacing(0);
    layoutScrollPanel.setWidget(0, 0, scrollPanel);
    layoutScrollPanel.setWidget(0, 1, pBtnLeft);
    layoutScrollPanel.setWidget(0, 2, pBtnRight);
    layoutScrollPanel.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_BOTTOM);
    layoutScrollPanel.getCellFormatter().setVerticalAlignment(0, 2, HasVerticalAlignment.ALIGN_BOTTOM);

    initWidget(layoutScrollPanel);

    setAlwaysShowScrollBars(false);
    // Prevent IE standard mode bug when a AbsolutePanel is contained.
    DOM.setStyleAttribute(scrollPanel.getElement(), "position", "relative");
    this.setWidth(width);
}

From source file:com.square.client.gwt.client.composant.popup.PopupFusion.java

License:Open Source License

/**
 * Constructeur.//w  w w  . ja  v  a 2s. co  m
 * @param eventBus le bus d'vnement.
 * @param nom le nom du doublon.
 * @param prenom le prnom du doublon.
 * @param dateNaissance la date de naissance du doublon.
 * @param idPersonneSelectionnee identifiant de la personne pr-selectionne dans la popup de fusion
 * @param deskBar deskBar
 */
public PopupFusion(final HandlerManager eventBus, String nom, String prenom, String dateNaissance,
        Long idPersonneSelectionnee, DeskBar deskBar) {
    super(popupConstants.titrePopup(), false, false, true);
    this.addStyleName(SquareResources.INSTANCE.css().popupFusion());
    this.deskBar = deskBar;

    final VerticalPanel pConteneur = new VerticalPanel();
    pConteneur.setWidth(PopupFusionConstants.LARGEUR_POPUP);
    pConteneur.setSpacing(5);

    final VerticalPanel pConteneurComposantFusion = new VerticalPanel();
    pConteneurComposantFusion.setWidth(AppControllerConstants.POURCENT_100);
    final RechercheDoublonCritereModel criteres = new RechercheDoublonCritereModel();
    criteres.setNom(nom);
    criteres.setPrenom(prenom);
    criteres.setDateNaissance(dateNaissance);
    final ComposantFusionPresenter composantFusionPresenter = new ComposantFusionPresenter(eventBus, criteres,
            idPersonneSelectionnee);
    composantFusionPresenter.showPresenter(pConteneurComposantFusion);

    final DecoratedButton btnFermer = new DecoratedButton(popupConstants.btnFermer());
    btnFermer.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            hide();

            // On met  jour la recherche
            eventBus.fireEvent(new RafraichirRecherchePersonneEvent());
        }
    });

    btnReduire = new DecoratedButton(popupConstants.reduire());

    eventBus.addHandler(EnableMinimizeWidgetEvent.TYPE, new EnableMinimizeWidgetEventHandler() {
        @Override
        public void enableMinimizeWidget(EnableMinimizeWidgetEvent event) {
            btnReduire.setEnabled(event.isEnabled());
        }
    });

    final HorizontalPanel conteneurBoutons = new HorizontalPanel();
    conteneurBoutons.add(btnReduire);
    conteneurBoutons.add(btnFermer);
    conteneurBoutons.setSpacing(5);

    pConteneur.add(pConteneurComposantFusion);
    pConteneur.add(conteneurBoutons);
    pConteneur.setCellHorizontalAlignment(conteneurBoutons, HasAlignment.ALIGN_CENTER);

    this.setWidget(pConteneur, 0);
}

From source file:com.square.client.gwt.client.composant.popup.PopupFusionViewImpl.java

License:Open Source License

public PopupFusionViewImpl() {
    super(popupConstants.titrePopup(), false, false, true);
    this.addStyleName(SquareResources.INSTANCE.css().popupFusion());

    final VerticalPanel pConteneur = new VerticalPanel();
    pConteneur.setWidth(PopupFusionConstants.LARGEUR_POPUP);
    pConteneur.setSpacing(5);/*  w  w  w .j  a  va 2  s.co  m*/

    pConteneurComposantFusion = new VerticalPanel();
    pConteneurComposantFusion.setWidth(AppControllerConstants.POURCENT_100);

    btnFermer = new DecoratedButton(popupConstants.btnFermer());
    btnReduire = new DecoratedButton(popupConstants.reduire());

    final HorizontalPanel conteneurBoutons = new HorizontalPanel();
    conteneurBoutons.add(btnReduire);
    conteneurBoutons.add(btnFermer);
    conteneurBoutons.setSpacing(5);

    pConteneur.add(pConteneurComposantFusion);
    pConteneur.add(conteneurBoutons);
    pConteneur.setCellHorizontalAlignment(conteneurBoutons, HasAlignment.ALIGN_CENTER);

    this.setWidget(pConteneur, 0);

    // on en fait une popup minimisable
    minimizablePopup = new PopupMinimizable(this, popupConstants.titrePopup(), btnReduire);
}

From source file:com.square.client.gwt.client.view.action.annulation.ActionPopupAnnulerViewImpl.java

License:Open Source License

/** Constructeur. */
public ActionPopupAnnulerViewImpl() {
    super(viewConstants.popupTitle(), false, false, true);
    conteneur = new VerticalPanel();
    final Label lAnnonce = new Label(viewConstants.libelleAnnonce());
    conteneur.add(lAnnonce);//from  w ww .  j av  a2 s .  c  o m
    final HorizontalPanel horizontalPanel = new HorizontalPanel();
    btnOui = new DecoratedButton(viewConstants.oui());
    btnOui.ensureDebugId(viewDebugIdConstants.debugIdBtnOui());
    btnNon = new DecoratedButton(viewConstants.non());
    btnNon.ensureDebugId(viewDebugIdConstants.debugIdBtnOui());
    horizontalPanel.add(btnOui);
    horizontalPanel.add(btnNon);
    horizontalPanel.setSpacing(5);
    conteneur.add(horizontalPanel);
    conteneur.setCellHorizontalAlignment(horizontalPanel, HasAlignment.ALIGN_CENTER);
    this.setWidget(conteneur);
}

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  w  w . java  2 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() };
        }
    };

    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 Action. */
private void construireBlocAction() {
    final SuggestListBoxSingleProperties<IdentifiantLibelleGwt> slbIdentifiantLibelleProperties = new SuggestListBoxSingleProperties<IdentifiantLibelleGwt>() {
        @Override//from  ww w  .j  a  v  a 2s . 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() };
        }
    };
    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);
}