Exemplo n.º 1
0
  private void initialize(String titleKey) {
    feedback = new FeedbackPanel("feedback");
    feedback.setOutputMarkupId(true);
    add(feedback);

    Label titleLabel = new Label("pageTitle", getString(titleKey, null, titleKey));
    titleLabel.setRenderBodyOnly(true);
    add(titleLabel);

    Link<Object> plLangLink =
        new Link<Object>("plLang") {
          private static final long serialVersionUID = 3288754396147822387L;

          @Override
          public void onClick() {
            getSession().setLocale(new Locale("pl", "pl_PL"));
            setResponsePage(getPage().getClass());
          }
        };
    add(plLangLink);

    Link<Object> enLangLink =
        new Link<Object>("enLang") {
          private static final long serialVersionUID = 4601930920670566466L;

          @Override
          public void onClick() {
            getSession().setLocale(Locale.ENGLISH);
            setResponsePage(getPage().getClass());
          }
        };
    add(enLangLink);

    ((Application) getApplication()).getMenuLoader().addMenuPanel(BasePage.this);
  }
Exemplo n.º 2
0
  @Override
  protected void initLayout() {
    Label username =
        new Label(
            ID_USERNAME,
            new AbstractReadOnlyModel<String>() {

              @Override
              public String getObject() {
                return getShortUserName();
              }
            });
    username.setRenderBodyOnly(true);
    add(username);

    ExternalLink logoutLink =
        new ExternalLink(
            ID_LOGOUT_LINK,
            new Model<String>(
                RequestCycle.get().getRequest().getContextPath() + "/j_spring_security_logout"),
            createStringResource("UserMenuPanel.logout"));
    add(logoutLink);

    //        LabeledBookmarkableLink editProfile = new LabeledBookmarkableLink(ID_EDIT_PROFILE,
    //                new MenuItem(createStringResource("UserMenuPanel.editProfile"),
    // PageDashboard.class));
    //        add(editProfile);

    LabeledBookmarkableLink resetPasswords =
        new LabeledBookmarkableLink(
            ID_RESET_PASSWORDS,
            new MenuItem(
                createStringResource("UserMenuPanel.resetPasswords"), PageMyPasswords.class));
    add(resetPasswords);
  }
Exemplo n.º 3
0
  protected void populateCell(
      WebMarkupContainer cellContainer, final AssignmentEditorDto assignment) {
    AjaxLink inner =
        new AjaxLink(ID_INNER) {
          private static final long serialVersionUID = 1L;

          @Override
          public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            assignmentDetailsPerformed(assignment, ajaxRequestTarget);
          }
        };
    cellContainer.add(inner);

    Label nameLabel = new Label(ID_INNER_LABEL, assignment.getName());
    inner.add(nameLabel);

    AjaxLink detailsLink =
        new AjaxLink(ID_DETAILS_LINK) {
          @Override
          public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            assignmentDetailsPerformed(assignment, ajaxRequestTarget);
          }
        };
    cellContainer.add(detailsLink);

    Label detailsLinkLabel =
        new Label(
            ID_DETAILS_LINK_LABEL, pageBase.createStringResource("MultiButtonPanel.detailsLink"));
    detailsLinkLabel.setRenderBodyOnly(true);
    detailsLink.add(detailsLinkLabel);

    AjaxLink detailsLinkIcon =
        new AjaxLink(ID_DETAILS_LINK_ICON) {
          private static final long serialVersionUID = 1L;

          @Override
          public void onClick(AjaxRequestTarget target) {}
        };
    detailsLink.add(detailsLinkIcon);

    AjaxLink addToCartLink =
        new AjaxLink(ID_ADD_TO_CART_LINK) {
          @Override
          public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            addAssignmentPerformed(assignment, ajaxRequestTarget);
          }
        };
    cellContainer.add(addToCartLink);

    AjaxLink addToCartLinkIcon =
        new AjaxLink(ID_ADD_TO_CART_LINK_ICON) {
          private static final long serialVersionUID = 1L;

          @Override
          public void onClick(AjaxRequestTarget target) {}
        };
    addToCartLink.add(addToCartLinkIcon);

    WebMarkupContainer icon = new WebMarkupContainer(ID_TYPE_ICON);
    icon.add(new AttributeAppender("class", getIconClass(assignment.getType())));
    cellContainer.add(icon);
  }