public ConfigAccountPanel() { if (CShell.isGuest() || CShell.isPermaguest() || !MemberMailUtil.isPlaceholderAddress(CShell.creds.accountName)) { SmartTable box = new SmartTable(0, 10); box.setText(0, 0, _msgs.configNotYou()); box.setWidget(0, 1, Link.create(_msgs.configHere(), Pages.ACCOUNT, "edit")); add(box); return; } int row = 0; SmartTable table = new SmartTable(0, 10); table.setText(row++, 0, _msgs.configIntro(), 3); table.setHTML(row++, 0, " ", 3); table.setText(row, 0, _msgs.editEmail(), 1, "rightLabel"); _email = MsoyUI.createTextBox("", MemberName.MAX_EMAIL_LENGTH, -1); table.setWidget(row++, 1, _email); TextBoxUtil.addTypingListener(_email, _validator); table.setText(row, 0, _msgs.configPassword(), 1, "rightLabel"); table.setWidget(row++, 1, _password = new PasswordTextBox()); TextBoxUtil.addTypingListener(_password, _validator); table.setText(row, 0, _msgs.editConfirm(), 1, "rightLabel"); table.setWidget(row++, 1, _confirm = new PasswordTextBox()); TextBoxUtil.addTypingListener(_confirm, _validator); table.setHTML(row++, 0, " ", 3); table.setText(row++, 0, _msgs.configAuthTip(), 3); table.setWidget( row++, 2, _submit = MsoyUI.createButton( MsoyUI.MEDIUM_THIN, _msgs.configSubmit(), new ClickHandler() { public void onClick(ClickEvent event) { updateAccount(); } })); _submit.setEnabled(false); // we use a blank tongue box for formatting consistency with the edit page add(new TongueBox(null, table)); }
protected void setFilteredBy(String text) { if (text == null) { String blurb = _dmsgs.xlateCatalogIntro(_query.itemType); _listings.setText(0, 0, blurb, 1, "Blurb"); } else { FlowPanel filter = new FlowPanel(); filter.add(new InlineLabel(text, false, false, true)); CatalogQuery query = new CatalogQuery(); query.itemType = _query.itemType; query.sortBy = _query.sortBy; filter.add( Link.create(_msgs.catalogClearFilter(), Pages.SHOP, ShopUtil.composeArgs(query, 0))); _listings.setWidget(0, 0, filter, 1, "Blurb"); } }
protected void displaySearchResults(final List<VizMemberName> members) { if (_medals == null) { // we need _medals to be valid before we can proceed with this operation. _medalsValidCommand = new Command() { public void execute() { displaySearchResults(members); } }; return; } if (members.size() == 0) { MsoyUI.info(_msgs.awardMedalsNoMembersFound()); return; } for (final VizMemberName member : members) { HorizontalPanel row = new HorizontalPanel(); row.setSpacing(10); row.add(MediaUtil.createMediaView(member.getPhoto(), MediaDescSize.HALF_THUMBNAIL_SIZE)); row.add(Link.create(member.toString(), Pages.PEOPLE, "" + member.getId())); // TODO: this will be really inefficient for groups that have a ton of Medals. This // UI should contain only one drop down if at all possible. final ListBox awardDrop = createDropDown(); row.add(awardDrop); row.add( new Button( _msgs.awardMedalsAward(), new ClickHandler() { public void onClick(ClickEvent event) { int selected = Math.max(0, awardDrop.getSelectedIndex()); Medal medal = awardDrop.getItemCount() < 0 ? null : _medalMap.get(awardDrop.getValue(selected)); grantMedal(member, medal); } })); add(row); } }