Example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow CSS_CLASS_BLUE

List of usage examples for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow CSS_CLASS_BLUE

Introduction

In this page you can find the example usage for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow CSS_CLASS_BLUE.

Prototype

String CSS_CLASS_BLUE

To view the source code for org.apache.wicket.extensions.ajax.markup.html.modal ModalWindow CSS_CLASS_BLUE.

Click Source Link

Document

CSS class for window with blue border.

Usage

From source file:com.asptt.plongee.resa.ui.web.wicket.page.admin.GererAdherents.java

@SuppressWarnings("serial")
public GererAdherents() {

    setPageTitle("Gerer les adherents");
    setOutputMarkupId(true);/*  www  .j  ava2 s.  c om*/
    modal2 = new ModalWindow("modal2");
    modal2.setTitle("This is modal window with panel content.");
    modal2.setCookieName("modal-adherent");
    add(modal2);

    modalSupp = new ModalWindow("modalSupp");
    modalSupp.setTitle("Confirmation");
    modalSupp.setResizable(false);
    modalSupp.setInitialWidth(30);
    modalSupp.setInitialHeight(15);
    modalSupp.setWidthUnit("em");
    modalSupp.setHeightUnit("em");
    modalSupp.setCssClassName(ModalWindow.CSS_CLASS_BLUE);
    add(modalSupp);

    modalPwd = new ModalWindow("modalPwd");
    modalPwd.setTitle("Confirmation");
    modalPwd.setResizable(false);
    modalPwd.setInitialWidth(30);
    modalPwd.setInitialHeight(15);
    modalPwd.setWidthUnit("em");
    modalPwd.setHeightUnit("em");
    modalPwd.setCssClassName(ModalWindow.CSS_CLASS_BLUE);
    add(modalPwd);

    List<Adherent> adherents = getResaSession().getAdherentService().rechercherAdherentsTous();

    // On construit la liste des adhrents (avec pagination)
    DataView adherentsView = new DataView<Adherent>("simple", new AdherentDataProvider(adherents), 10) {
        protected void populateItem(final Item<Adherent> item) {
            final Adherent adherent = item.getModelObject();

            item.add(new IndicatingAjaxLink("select") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    replaceModalWindow(target, item.getModel());
                    modal2.show(target);
                }
            });

            item.add(new IndicatingAjaxLink("suppAdh") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    replaceModalWindowSupp(target, item.getModel());
                    modalSupp.show(target);
                }
            });

            item.add(new IndicatingAjaxLink("pwdAdh") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    replaceModalWindowPwd(target, item.getModel());
                    modalPwd.show(target);
                }
            });

            item.add(new Label("license", adherent.getNumeroLicense()));
            item.add(new Label("nom", adherent.getNom()));
            item.add(new Label("prenom", adherent.getPrenom()));

            // Ds que le plongeur est encadrant, on affiche son niveau d'encadrement
            String niveauAffiche = adherent.getPrerogative();
            item.add(new Label("niveau", niveauAffiche));
            item.add(new Label("aptitude", adherent.getAptitude()));
            item.add(new AttributeModifier("class", true, new AbstractReadOnlyModel<String>() {
                @Override
                public String getObject() {
                    String cssClass;
                    if (item.getIndex() % 2 == 1) {
                        cssClass = "even";
                    } else {
                        cssClass = "odd";
                    }
                    if (!adherent.isActif()) {
                        cssClass = cssClass + " inactif";
                    }
                    return cssClass;
                }
            }));
        }
    };
    adherentsView.setOutputMarkupId(true);
    add(adherentsView);
    add(new PagingNavigator("navigator", adherentsView));

    add(new AdherentForm("form"));

}

From source file:com.asptt.plongee.resa.ui.web.wicket.page.inscription.DeInscriptionPlongeePage.java

public DeInscriptionPlongeePage() {

    this.adh = getResaSession().getAdherent();

    setPageTitle("Desinscription plongee");
    add(new Label("message", new StringResourceModel(CatalogueMessages.DESINSCRIPTION_MSG_ADHERENT, this,
            new Model<Adherent>(adh))));

    feedback = new FeedbackPanel("feedback");
    feedback.setOutputMarkupId(true);/*from w w w . j av  a  2 s.  co  m*/
    add(feedback);

    // Initialisation de la fentre modal de confirmation d'annulation
    add(modalConfirm = new ModalWindow("modalConfirm"));
    //modalConfirm.setPageMapName("modal-2");

    modalConfirm.setTitle("Confirmation");

    modalConfirm.setResizable(false);
    modalConfirm.setInitialWidth(30);
    modalConfirm.setInitialHeight(15);
    modalConfirm.setWidthUnit("em");
    modalConfirm.setHeightUnit("em");

    modalConfirm.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    init();
}

From source file:com.asptt.plongee.resa.ui.web.wicket.page.inscription.DesinscriptionFilleulPage.java

public DesinscriptionFilleulPage() {

    this.parrain = getResaSession().getAdherent();

    setPageTitle("Desinscription Externe plongee");
    add(new Label("message", new StringResourceModel(CatalogueMessages.DESINSCRIPTION_FILLEUL_MSG_ADHERENT,
            this, new Model<Adherent>(parrain))));

    feedback = new FeedbackPanel("feedback");
    feedback.setOutputMarkupId(true);//from www .ja v  a  2  s .co  m
    add(feedback);

    // Initialisation de la fentre modal de confirmation d'annulation
    add(modalConfirm = new ModalWindow("modalConfirm"));
    //modalConfirm.setPageMapName("modal-2");

    modalConfirm.setTitle("Confirmation");

    modalConfirm.setResizable(false);
    modalConfirm.setInitialWidth(30);
    modalConfirm.setInitialHeight(15);
    modalConfirm.setWidthUnit("em");
    modalConfirm.setHeightUnit("em");

    modalConfirm.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    init();
}

From source file:com.asptt.plongee.resa.wicket.page.admin.adherent.CreerAdherent.java

public CreerAdherent() {
    setPageTitle("Creer adherent");
    // Constructeur du formulaire et du feedback panel pour renvoyer des messages sur la page
    feedback.setOutputMarkupId(true);//from w  w w . ja va 2 s  . c  o m
    add(feedback);

    modalDuplicateLicense = new ModalWindow("modalDuplicateLicense");
    modalDuplicateLicense.setTitle("Reinitialisation adherent inactif");
    modalDuplicateLicense.setResizable(false);
    modalDuplicateLicense.setInitialWidth(30);
    modalDuplicateLicense.setInitialHeight(15);
    modalDuplicateLicense.setWidthUnit("em");
    modalDuplicateLicense.setHeightUnit("em");
    modalDuplicateLicense.setCssClassName(ModalWindow.CSS_CLASS_BLUE);
    add(modalDuplicateLicense);

    add(new CreerAdherentForm("creerAdherentForm"));

}

From source file:com.asptt.plongee.resa.wicket.page.inscription.DeInscriptionPlongeePage.java

public DeInscriptionPlongeePage() {

    this.adh = ResaSession.get().getAdherent();

    setPageTitle("Desinscription plongee");
    add(new Label("message", new StringResourceModel(CatalogueMessages.DESINSCRIPTION_MSG_ADHERENT, this,
            new Model<Adherent>(adh))));

    feedback = new FeedbackPanel("feedback");
    feedback.setOutputMarkupId(true);/*from   w  ww. j  a  v  a2  s .co  m*/
    add(feedback);

    // Initialisation de la fentre modal de confirmation d'annulation d'un encadrant
    add(modalConfirmDesInscription = new ModalWindow("modalConfirmDesInscription"));
    modalConfirmDesInscription.setTitle("Confirmation de desinscription");
    modalConfirmDesInscription.setResizable(false);
    modalConfirmDesInscription.setInitialWidth(28);
    modalConfirmDesInscription.setInitialHeight(10);
    modalConfirmDesInscription.setWidthUnit("em");
    modalConfirmDesInscription.setHeightUnit("em");
    modalConfirmDesInscription.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    // Initialisation de la fentre modal de confirmation d'annulation d'un encadrant
    add(modalConfirmDesInscriptionEncadrant = new ModalWindow("modalConfirmDeInscriptionEncadrant"));
    modalConfirmDesInscriptionEncadrant.setTitle("Confirmation de desinscription d'un encadrant");
    modalConfirmDesInscriptionEncadrant.setResizable(false);
    modalConfirmDesInscriptionEncadrant.setInitialWidth(28);
    modalConfirmDesInscriptionEncadrant.setInitialHeight(11);
    modalConfirmDesInscriptionEncadrant.setWidthUnit("em");
    modalConfirmDesInscriptionEncadrant.setHeightUnit("em");
    modalConfirmDesInscriptionEncadrant.setCssClassName(ModalWindow.CSS_CLASS_BLUE);
    init();
}

From source file:it.av.youeat.web.page.RistoranteViewPage.java

License:Apache License

/**
 * Constructor that is invoked when page is invoked without a session.
 * /* ww  w . j a v  a 2 s  .  c om*/
 * @throws YoueatException
 */
public RistoranteViewPage(PageParameters parameters) throws YoueatException {
    actualDescriptionLanguage = getInitialLanguage();
    String ristoranteId = parameters.get(YoueatHttpParams.RISTORANTE_ID).toString("");
    if (StringUtils.isNotBlank(ristoranteId)) {
        this.ristorante = ristoranteService.getByID(ristoranteId);
    } else {
        throw new RestartResponseAtInterceptPageException(getApplication().getHomePage());
    }
    appendToPageTile(" " + ristorante.getName() + ", " + ristorante.getCity().getName());
    ristorante = ristorante.addDescLangIfNotPresent(actualDescriptionLanguage);
    ristorante = ristorante.addBlackboardLangIfNotPresent(actualDescriptionLanguage);
    formRisto = new Form<Ristorante>("ristoranteForm", new CompoundPropertyModel<Ristorante>(ristorante));
    add(formRisto);
    formRisto.setOutputMarkupId(true);
    formRisto.add(new Label(Ristorante.NAME));

    formRisto.add(new SmartLinkLabel(Ristorante.WWW));
    formRisto.add(new SmartLinkLabel(Ristorante.EMAIL));
    formRisto.add(new ListView<Tag>(Ristorante.TAGS) {

        @Override
        protected void populateItem(ListItem<Tag> item) {
            StringBuffer tag = new StringBuffer(item.getModelObject().getTag());
            if (item.getIndex() < ristorante.getTags().size() - 1) {
                tag.append(",");
            }
            item.add(new Label("tagItem", tag.toString()));
        }
    });
    descriptionLinksContainer = new WebMarkupContainer("descriptionLinksContainer");
    descriptionLinksContainer.setOutputMarkupId(true);
    formRisto.add(descriptionLinksContainer);
    ListView<Language> descriptionsLinks = new ListView<Language>("descriptionLinks",
            languageService.getAll()) {
        @Override
        protected void onComponentTag(ComponentTag tag) {
        };

        @Override
        protected void populateItem(final ListItem<Language> item) {
            if (actualDescriptionLanguage.getCountry().equals(item.getModelObject().getCountry())) {
                item.add(new AttributeAppender("class", new Model<String>("ui-tabs-selected ui-state-active"),
                        " "));
            }
            item.add(new AjaxFallbackButton("descriptionLink", formRisto) {

                @Override
                protected void onComponentTag(ComponentTag tag) {
                    super.onComponentTag(tag);
                    boolean langpresent = ristorante.checkDesctiption(item.getModelObject());
                    HashMap<String, String> tagAttrs = new HashMap<String, String>();
                    if (!langpresent) {
                        tagAttrs.put("title", getString("descriptionNotAvailableLang"));
                        tagAttrs.put("class", "descriptionNotAvailableLang");
                    }
                    tag.getAttributes().putAll(tagAttrs);
                }

                @Override
                protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
                    actualDescriptionLanguage = item.getModelObject();
                    ristorante = ristorante.addDescLangIfNotPresent(actualDescriptionLanguage);
                    formRisto.setModelObject(ristorante);
                    descriptions.removeAll();
                    if (target != null) {
                        target.addComponent(descriptionsContainer);
                        target.addComponent(descriptionLinksContainer);
                        target.addComponent(restaurateurBlackboardsContainer);
                    }
                }

                @Override
                protected void onError(AjaxRequestTarget target, Form<?> form) {
                    // TODO 1.5 Auto-generated method stub

                }
            }.add(new Label("linkName", getString(item.getModelObject().getCountry()))));
        }
    };
    descriptionLinksContainer.add(descriptionsLinks);
    descriptionsContainer = new WebMarkupContainer("descriptionsContainer");
    descriptionsContainer.setOutputMarkupId(true);
    formRisto.add(descriptionsContainer);
    descriptions = new ListView<RistoranteDescriptionI18n>("descriptions", new DescriptionsModel()) {
        @Override
        protected void populateItem(ListItem<RistoranteDescriptionI18n> item) {
            boolean visible = actualDescriptionLanguage.equals(item.getModelObject().getLanguage());
            if (item.getModelObject().getDescription() == null
                    || StringUtils.isBlank(item.getModelObject().getDescription())) {
                item.add(new Label(RistoranteDescriptionI18n.DESCRIPTION,
                        getString("descriptionNotAvailableLang")).setVisible(visible)
                                .setOutputMarkupPlaceholderTag(true));
            } else {
                item.add(new MultiLineLabel(RistoranteDescriptionI18n.DESCRIPTION,
                        new PropertyModel<String>(item.getModelObject(), RistoranteDescriptionI18n.DESCRIPTION))
                                .setVisible(visible).setOutputMarkupPlaceholderTag(true));
            }
        }
    };
    descriptionsContainer.add(descriptions);

    restaurateurBlackboardsContainer = new WebMarkupContainer("restaurateurBlackboardsContainer");
    restaurateurBlackboardsContainer.setOutputMarkupId(true);
    restaurateurBlackboards = new ListView<RestaurateurBlackboardI18n>("restaurateurBlackboards",
            new BlackBoardsModel()) {
        @Override
        protected void populateItem(ListItem<RestaurateurBlackboardI18n> item) {
            boolean visible = actualDescriptionLanguage.equals(item.getModelObject().getLanguage());
            if (item.getModelObject().getBlackboard() == null
                    || StringUtils.isBlank(item.getModelObject().getBlackboard())) {
                item.add(new Label("restaurateurBlackboard", "").setVisible(false)
                        .setOutputMarkupPlaceholderTag(true));
            } else {
                item.add(new MultiLineLabel("restaurateurBlackboard",
                        new PropertyModel<String>(item.getModelObject(), RestaurateurBlackboardI18n.BLACKBOARD))
                                .setVisible(visible).setOutputMarkupPlaceholderTag(true)
                                .add(new AttributeAppender("class",
                                        new Model("blackboard_" + getInitialLanguage().getLanguage()), " ")));
            }
        }
    };
    restaurateurBlackboardsContainer.add(restaurateurBlackboards);
    formRisto.add(restaurateurBlackboardsContainer);

    formRisto.add(new Label("revisionNumber"));

    Form<Ristorante> formAddress = new Form<Ristorante>("ristoranteAddressForm",
            new CompoundPropertyModel<Ristorante>(ristorante));
    add(formAddress);
    formAddress.add(new Label(Ristorante.ADDRESS));
    formAddress.add(new Label(Ristorante.CITY));
    formAddress.add(new Label(Ristorante.PROVINCE));
    formAddress.add(new Label(Ristorante.POSTALCODE));
    formAddress.add(new Label(Ristorante.COUNTRY));
    formAddress.add(new Label(Ristorante.MOBILE_PHONE_NUMBER));
    formAddress.add(new Label(Ristorante.PHONE_NUMBER));
    formAddress.add(new Label(Ristorante.FAX_NUMBER));
    formAddress.add(new RatingPanel("rating1", new PropertyModel<Integer>(getRistorante(), "rating"),
            new Model<Integer>(5), new PropertyModel<Integer>(getRistorante(), "rates.size"),
            new PropertyModel<Boolean>(this, "hasVoted"), true) {
        @Override
        protected boolean onIsStarActive(int star) {
            return star < ((int) (getRistorante().getRating() + 0.5));
        }

        @Override
        protected void onRated(int rating, AjaxRequestTarget target) {
            setHasVoted(Boolean.TRUE);
            ristoranteService.addRate(getRistorante(), getLoggedInUser(), rating);
            ristorante = ristoranteService.getByID(ristorante.getId());
            info(getString("info.ratingSaved"));
            if (target != null) {
                target.addComponent(getFeedbackPanel());
            }
        }
    });
    BookmarkablePageLink editAddressRistorante = new BookmarkablePageLink("editAddressRistorante",
            RistoranteEditAddressPage.class,
            new PageParameters(YoueatHttpParams.RISTORANTE_ID + "=" + ristorante.getId()));
    editAddressRistorante.setOutputMarkupId(true);
    add(editAddressRistorante);

    if (getApplication().getSecuritySettings().getAuthorizationStrategy()
            .isInstantiationAuthorized(RistoranteEditAddressPage.class)) {
        editAddressRistorante.setVisible(true);
    } else {
        editAddressRistorante.setVisible(false);
    }
    add(editAddressRistorante);

    BookmarkablePageLink editDataRistorante = new BookmarkablePageLink("editDataRistorante",
            RistoranteEditDataPage.class,
            new PageParameters(YoueatHttpParams.RISTORANTE_ID + "=" + ristorante.getId()));
    editDataRistorante.setOutputMarkupId(true);
    add(editDataRistorante);

    BookmarkablePageLink editPictures = new BookmarkablePageLink("editPictures",
            RistoranteEditPicturePage.class,
            new PageParameters(YoueatHttpParams.RISTORANTE_ID + "=" + ristorante.getId()));
    editPictures.setOutputMarkupId(true);
    add(editPictures);

    picturesList = new ListView<RistorantePicture>("picturesList", ristorante.getActivePictures()) {

        @Override
        protected void populateItem(final ListItem<RistorantePicture> item) {
            Link<RistorantePicture> imageLink = new Link<RistorantePicture>("pictureLink", item.getModel()) {
                @Override
                public void onClick() {
                    setResponsePage(new ImageViewPage(getModelObject().getPicture()));
                }
            };
            imageLink.add(ImageRisto.getThumbnailImage("picture", item.getModelObject().getPicture(), true));
            item.add(imageLink);
        }
    };
    formRisto.add(picturesList);

    add(revisionModal = new ModalWindow("revisionsPanel"));
    //revisionModal.setWidthUnit("%");
    //revisionModal.setInitialHeight(40);
    //revisionModal.setInitialWidth(90);
    revisionModal.setResizable(false);
    RistoranteRevisionsPanel revisionsPanel = new RistoranteRevisionsPanel(revisionModal.getContentId(),
            getFeedbackPanel());
    revisionsPanel.refreshRevisionsList(ristorante, actualDescriptionLanguage);
    revisionModal.setContent(revisionsPanel);
    revisionModal.setTitle("Revisions list");
    revisionModal.setCookieName("SC-revisionLists");
    //JQUERY LAYOUT
    //revisionModal.setCssClassName("ui-widget ui-widget-content ui-corner-all");
    revisionModal.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    revisionModal.setCloseButtonCallback(new ModalWindow.CloseButtonCallback() {
        public boolean onCloseButtonClicked(AjaxRequestTarget target) {
            return true;
        }
    });

    revisionModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        public void onClose(AjaxRequestTarget target) {

        }
    });

    add(new AjaxLink("showsAllRevisions") {
        public void onClick(AjaxRequestTarget target) {
            revisionModal.show(target);
        }
    });

    add(new AjaxLink<String>("tried") {
        public void onClick(AjaxRequestTarget target) {
            if (getLoggedInUser() != null) {
                activityService.addTriedRisto(getLoggedInUser(), ristorante);
                info(getString("info.IateHere", new Model<Ristorante>(ristorante)));
            } else {
                info(getString("action.notlogged"));
            }
            target.addComponent(getFeedbackPanel());
        }
    });

    AjaxFallbackLink<String> asfavourite = new AjaxFallbackLink<String>("asfavourite") {
        public void onClick(AjaxRequestTarget target) {
            if (getLoggedInUser() != null) {
                if (activityService.isFavouriteRisto(getLoggedInUser(), ristorante)) {
                    activityService.addRistoAsFavorite(getLoggedInUser(), ristorante);
                    info(getString("action.removedAsFavourite", new Model<Ristorante>(ristorante)));
                    asfavouriteLabel.setDefaultModelObject(getString("button.addAsFavourite"));
                } else {
                    activityService.save(new ActivityRistorante(getLoggedInUser(), ristorante,
                            ActivityRistorante.TYPE_ADDED_AS_FAVOURITE));
                    info(getString("action.addedAsFavourite", new Model<Ristorante>(ristorante)));
                    asfavouriteLabel.setDefaultModelObject(getString("button.removeAsFavourite"));
                }
            } else {
                info(getString("action.notlogged"));
            }
            if (target != null) {
                target.addComponent(asfavouriteLabel);
                target.addComponent(getFeedbackPanel());
            }
        }
    };
    add(asfavourite);

    formComment = new Form<Comment>("formComment", new CompoundPropertyModel<Comment>(new Comment()));
    formComment.setOutputMarkupId(true);
    add(formComment);
    final TextField<String> newCommentTitle = new TextField<String>(Comment.TITLE_FIELD);
    newCommentTitle.setVisible(false);
    newCommentTitle.add(StringValidator.maximumLength(Comment.TITLE_MAX_LENGTH));
    newCommentTitle.setOutputMarkupPlaceholderTag(true);
    formComment.add(newCommentTitle);
    final TextArea<String> newCommentBody = new TextArea<String>(Comment.BODY_FIELD);
    newCommentBody.setRequired(true);
    newCommentBody.add(StringValidator.maximumLength(Comment.BODY_MAX_LENGTH));
    newCommentBody.setVisible(false);
    newCommentBody.setOutputMarkupPlaceholderTag(true);
    formComment.add(newCommentBody);
    final Label newCommentTitleLabel = new Label("newCommentTitleLabel", getString("label.newCommentTitle"));
    newCommentTitleLabel.setOutputMarkupPlaceholderTag(true);
    newCommentTitleLabel.setVisible(false);
    formComment.add(newCommentTitleLabel);
    final AjaxFallbackButton submitNewComment = new AjaxFallbackButton("submitNewComment", formComment) {
        @Override
        protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
            if (getLoggedInUser() != null) {
                Comment comment = (Comment) getForm().getModelObject();
                comment.setAuthor(getLoggedInUser());
                comment.setCreationTime(DateUtil.getTimestamp());
                ristorante.addComment(comment);
                try {
                    ristoranteService.updateNoRevision(ristorante);
                    activityService.save(new ActivityRistorante(getLoggedInUser(), ristorante,
                            ActivityRistorante.TYPE_NEW_COMMENT));
                    // reset the new comment formRisto
                    formComment.setModelObject(new Comment());
                    newCommentBody.setVisible(false);
                    newCommentTitle.setVisible(false);
                    newCommentTitleLabel.setVisible(false);
                    this.setVisible(false);
                    newCommentTitleLabel.setVisible(false);
                    Comment commeTitleToShow = new Comment();
                    commeTitleToShow.setTitle(comment.getTitle() != null ? "'" + comment.getTitle() + "'" : "");
                    info(getString("message.newCommentAdded", new Model<Comment>(commeTitleToShow)));
                    if (target != null) {
                        target.addComponent(formComment);
                    }
                } catch (YoueatException e) {
                    getFeedbackPanel().error(getString("genericErrorMessage"));
                }
                if (target != null) {
                    target.addComponent(getFeedbackPanel());
                }
            }
        }

        @Override
        protected void onError(AjaxRequestTarget target, Form<?> form) {
            if (target != null) {
                target.addComponent(getFeedbackPanel());
            }
        }
    };
    submitNewComment.setOutputMarkupPlaceholderTag(true);
    submitNewComment.setVisible(false);
    formComment.add(submitNewComment);
    commentsList = new ListView<Comment>("commentsList", new CommentsModel()) {

        @Override
        protected void populateItem(final ListItem<Comment> item) {
            item.add(new Label(Comment.AUTHOR_FIELD, item.getModelObject().getAuthor().getFirstname() + " "
                    + item.getModelObject().getAuthor().getLastname()));
            item.add(new Label(Comment.TITLE_FIELD, item.getModelObject().getTitle()));
            item.add(new Label(Comment.CREATIONTIME_FIELD,
                    DateUtil.SDF2SHOW.print(item.getModelObject().getCreationTime().getTime())));
            item.add(new MultiLineLabel(Comment.BODY_FIELD, item.getModelObject().getBody()));
        }
    };
    formComment.add(commentsList);
    add(new NewCommentButton("newComment", newCommentBody, submitNewComment, newCommentTitleLabel,
            newCommentTitle));
    add(new NewCommentButton("newCommentBottom", newCommentBody, submitNewComment, newCommentTitleLabel,
            newCommentTitle));
    asfavouriteLabel = new Label("asfavouriteLabel", getString("button.addAsFavourite"));
    if (activityService.isFavouriteRisto(getLoggedInUser(), ristorante)) {
        asfavouriteLabel.setDefaultModelObject(getString("button.removeAsFavourite"));
    }
    asfavouriteLabel.setOutputMarkupId(true);
    asfavourite.add(asfavouriteLabel);

    setHasVoted(ristoranteService.hasUsersAlreadyRated(getRistorante(), getLoggedInUser())
            || getLoggedInUser() == null);

    // position on the map
    final GMap2 bottomMap = new GMap2("map",
            new GMapHeaderContributor(((YoueatApplication) this.getApplication()).getGmapKey()));
    bottomMap.setOutputMarkupId(true);
    bottomMap.setMapType(GMapType.G_NORMAL_MAP);
    bottomMap.addControl(GControl.GSmallMapControl);
    bottomMap.addControl(GControl.GMapTypeControl);
    bottomMap.setZoom(16);
    if (ristorante.getLatitude() != 0 && ristorante.getLongitude() != 0) {
        GLatLng gLatLng = new GLatLng(ristorante.getLatitude(), ristorante.getLongitude());
        GMarkerOptions markerOptions = new GMarkerOptions(ristorante.getName());
        markerOptions = markerOptions.draggable(true);
        GMarker marker = new GMarker(gLatLng, markerOptions) {
            @Override
            protected void updateOnAjaxCall(AjaxRequestTarget target, GEvent overlayEvent) {
                super.updateOnAjaxCall(target, overlayEvent);
                if (getLoggedInUser() != null) {
                    ristorante.setLatitude(this.getLatLng().getLat());
                    ristorante.setLongitude(this.getLatLng().getLng());
                    ristorante = ristoranteService.updateLatitudeLongitude(ristorante);
                }
            }
        };
        marker.addListener(GEvent.dragend, new GEventHandler() {

            @Override
            public void onEvent(AjaxRequestTarget target) {
                //attach the ajax code to handle the event 
            }
        });
        bottomMap.addOverlay(marker);
        bottomMap.setCenter(gLatLng);
    } else {
        bottomMap.setVisible(false);
    }
    add(bottomMap);
    // users that already tried infos
    List<ActivityRistorante> friendThatAlreadyEat = new ArrayList<ActivityRistorante>(0);
    int numberUsersThatAlreadyEat = 0;

    if (getLoggedInUser() != null) {
        friendThatAlreadyEat = activityService.findByFriendWithActivitiesOnRistorante(getLoggedInUser(),
                ristorante, ActivityRistorante.TYPE_TRIED);
        numberUsersThatAlreadyEat = activityService.countByRistoAndType(ristorante,
                ActivityRistorante.TYPE_TRIED);
    }
    add(new Label("friendEaterListTitle",
            getString("numberOfUsersAlreadyEatAt",
                    new Model<NumberBean>(new NumberBean(numberUsersThatAlreadyEat))))
                            .setVisible(numberUsersThatAlreadyEat > 0));
    add(new FriendEaterListView("friendEaterList", friendThatAlreadyEat)
            .setVisible(friendThatAlreadyEat.size() > 0));

    // contribution infos
    List<ActivityRistorante> friendContributions = new ArrayList<ActivityRistorante>(0);
    int numberOfContributions = 0;

    if (getLoggedInUser() != null) {
        friendContributions = activityService.findByFriendContributionsOnRistorante(getLoggedInUser(),
                ristorante);
        numberOfContributions = activityService.countContributionsOnRistorante(ristorante);
    }
    add(new Label("numberOfContributions",
            getString("numberOfContributions", new Model<NumberBean>(new NumberBean(numberOfContributions))))
                    .setVisible(numberOfContributions > 0));
    add(new FriendEaterListView("friendContributionsList", friendContributions)
            .setVisible(friendContributions.size() > 0));
}

From source file:org.efaps.ui.wicket.components.modalwindow.AbstractModalWindow.java

License:Apache License

/**
 * Initialize./*from w  w  w  .jav  a 2s . c om*/
 */
protected void initialize() {
    if ("w_silver".equals(Configuration.getAttribute(ConfigAttribute.DOJO_MODALCLASS))) {
        setCssClassName(ModalWindow.CSS_CLASS_GRAY);
    } else if ("w_blue".equals(Configuration.getAttribute(ConfigAttribute.DOJO_MODALCLASS))) {
        setCssClassName(ModalWindow.CSS_CLASS_BLUE);
    }
    showUnloadConfirmation(false);
    setTitle(DBProperties.getProperty("Logo.Version.Label"));
}

From source file:org.ujorm.hotels.gui.booking.BookingEditor.java

License:Apache License

/** Create the editor dialog */
public static BookingEditor create(String componentId, int width, int height) {
    IModel<Booking> model = Model.of(new Booking());
    final ModalWindow modalWindow = new ModalWindow(componentId, model);
    modalWindow.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    final BookingEditor result = new BookingEditor(modalWindow, model);
    modalWindow.setInitialWidth(width);/* w w w  .  j  a  va 2s  .  c  o  m*/
    modalWindow.setInitialHeight(height);
    modalWindow.setTitle(new LocalizedModel("dialog.booking.title"));
    //modalWindow.setCookieName("modal-dialog");

    return result;
}

From source file:org.ujorm.hotels.gui.customer.CustomerEditor.java

License:Apache License

/** Create the editor dialog */
public static CustomerEditor create(String componentId, int width, int height) {
    IModel<Customer> model = Model.of(new Customer());
    final ModalWindow modalWindow = new ModalWindow(componentId, model);
    modalWindow.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    final CustomerEditor result = new CustomerEditor(modalWindow, model);
    modalWindow.setInitialWidth(width);/*from   w w w. j a va 2 s .c  o m*/
    modalWindow.setInitialHeight(height);
    modalWindow.setTitle(new LocalizedModel("dialog.edit.title"));
    //modalWindow.setCookieName("modal-dialog");

    return result;
}

From source file:org.ujorm.hotels.gui.customer.LoginDialog.java

License:Apache License

/** Create the editor dialog */
public static LoginDialog create(String componentId, int width, int height) {
    IModel<Customer> model = Model.of(new Customer());
    final ModalWindow modalWindow = new ModalWindow(componentId, model);
    modalWindow.setCssClassName(ModalWindow.CSS_CLASS_BLUE);

    final LoginDialog result = new LoginDialog(modalWindow, model);
    modalWindow.setInitialWidth(width);/*  ww  w .j  ava2s. c  om*/
    modalWindow.setInitialHeight(height);
    modalWindow.setTitle(new LocalizedModel("dialog.login.title"));
    //modalWindow.setCookieName("modal-dialog");

    return result;
}