List of usage examples for com.google.gwt.user.client.ui Label Label
protected Label(Element element)
From source file:cc.kune.core.client.sitebar.auth.PasswordResetPanel.java
License:GNU Affero Public License
/** * Instantiates a new password reset panel. * * @param i18n// w w w . j av a 2 s . com * the i18n * @param session * the session * @param mask * the mask * @param images * the images * @param eventbus * the eventbus * @param userService * the user service * @param stateManager * the state manager */ @Inject public PasswordResetPanel(final I18nTranslationService i18n, final Session session, final MaskWidgetView mask, final NotifyLevelImages images, final EventBus eventbus, final Provider<UserServiceAsync> userService, final StateManager stateManager) { super(PASSWD_RESET_DIALOG, mask, i18n, i18n.t("Reset your password"), true, true, true, "", i18n.t("Reset your password"), RESET_BUTTON_ID, i18n.tWithNT("Cancel", "used in button"), CANCEL_BUTTON_ID, images, ERRMSG, 1); this.stateManager = stateManager; final DefaultForm form = new DefaultForm(); final Label desc = new Label(i18n.t("Enter your new password below.")); desc.setWidth("310px"); newPasswdField = UserFieldFactory.createUserPasswd(PASSWD_RESET_ID, i18n.t("New password")); newPasswdField.setTabIndex(1); confirmPasswdField = UserFieldFactory.createUserPasswd(PASSWD_RESET_ID, i18n.t("Confirm")); confirmPasswdField.setTabIndex(1); messageErrorBar = new MessageToolbar(images, errorLabelId); form.setWidth(DEF_SIGN_IN_FORM_SIZE); form.add(newPasswdField); form.add(confirmPasswdField); form.add(messageErrorBar); super.getFirstBtn().addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { final String newPass = newPasswdField.getValue(); final String confirmPass = confirmPasswdField.getValue(); if (form.isValid()) { if (!newPass.equals(confirmPass)) { messageErrorBar.setErrorMessage(i18n.t("Passwords are different"), NotifyLevel.error); messageErrorBar.setVisible(true); } else { userService.get().resetPassword(getPasswordHash(), newPasswdField.getValue(), new AsyncCallback<Void>() { @Override public void onFailure(final Throwable caught) { if (caught instanceof EmailHashInvalidException) { PasswordResetPanel.this.setErrorMessage( i18n.t("Invalid confirmation code"), NotifyLevel.error); } else { PasswordResetPanel.this.setErrorMessage( i18n.t("Other error trying to reset your password"), NotifyLevel.error); } StackErrorEvent.fire(eventbus, caught); PasswordResetPanel.this.messageErrorBar.setVisible(true); } @Override public void onSuccess(final Void result) { NotifyUser.info(i18n.t("Your password has been reset. Sign in")); hide(); stateManager.gotoHistoryToken(SiteTokens.SIGN_IN); } }); } } } }); super.getSecondBtn().addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { hide(); } }); super.getInnerPanel().add(desc); super.getInnerPanel().add(form.getFormPanel()); }
From source file:cc.kune.core.client.sn.UserSNPanel.java
License:GNU Affero Public License
/** * Instantiates a new user sn panel.//from ww w . j a v a2 s .c o m * * @param i18n * the i18n * @param guiProvider * the gui provider * @param armor * the armor * @param avatarDecorator * the avatar decorator * @param dragController * the drag controller * @param notDrop * the not drop * @param lastConnectedManager * the last connected manager */ @Inject public UserSNPanel(final I18nTranslationService i18n, final GuiProvider guiProvider, final GSpaceArmor armor, final Provider<SmallAvatarDecorator> avatarDecorator, final KuneDragController dragController, final NotImplementedDropManager notDrop, final LastConnectedManager lastConnectedManager) { super(i18n, guiProvider, armor, avatarDecorator, dragController, lastConnectedManager); this.i18n = i18n; setVisibleImpl(false); mainTitle.setText(i18n.t("His/her network:")); mainTitle.setTitle(i18n.t("This user's groups and buddies")); firstCategoryLabel.setText(i18n.t("Buddies")); setTooltip(firstCategoryLabel, i18n.t("This user's buddies")); sndCategoryLabel.setText(i18n.t("Collaborates in")); setTooltip(sndCategoryLabel, i18n.t("Groups which this user joined")); trdCategoryLabel.setText("NOT USED"); setTooltip(trdCategoryLabel, "NOT USED"); super.setTrdCategoryVisible(false, false); sndDeckLabel.setText("NOT USED"); bottomActionsToolbar = new ActionFlowPanel(guiProvider, i18n); bottomPanel.add(bottomActionsToolbar); headerActionsToolbar = new ActionFlowPanel(guiProvider, i18n); headerActionsToolbar.setLayout(HORIZONTAL, LAYOUT, END_JUSTIFIED); armor.getEntityHeader().add(headerActionsToolbar); bottomActionsToolbar.setStyleName("k-sn-bottomPanel-actions"); armor.getEntityToolsNorth().add(widget); deck.showWidget(2); noBuddies = new Label(i18n.t("This user has no buddies yet")); noBuddies.addStyleName("kune-Margin-Medium-l"); noPublic = new Label(i18n.t(CoreMessages.BUDDIES_NOT_PUBLIC)); noPublic.addStyleName("kune-Margin-Medium-l"); }
From source file:cc.kune.core.client.sn.UserSNPanel.java
License:GNU Affero Public License
@Override public void addTextToBuddieList(final String text) { final Label label = new Label(text); label.addStyleName("k-sn-collabsCountlabel"); firstCategoryFlow.add(label);//from w ww.j a v a 2 s. c o m }
From source file:cc.kune.gspace.client.i18n.I18nToTranslateGridPanel.java
License:GNU Affero Public License
/** * Instantiates a new i18n to translate grid panel. * //from w w w.j a v a2 s .co m * @param i18n * the i18n * @param list * the list */ @Inject public I18nToTranslateGridPanel(final I18nTranslationService i18n, final I18nCellList list) { this.list = list; tabTitle = new Label(i18n.t("Not translated")); initWidget(list); }
From source file:cc.kune.gspace.client.i18n.I18nTranslatedGridPanel.java
License:GNU Affero Public License
/** * Instantiates a new i18n translated grid panel. * /* ww w. jav a2 s .c o m*/ * @param i18n * the i18n * @param list * the list */ @Inject public I18nTranslatedGridPanel(final I18nTranslationService i18n, final I18nCellList list) { this.list = list; tabTitle = new Label(i18n.t("Translated")); initWidget(list); }
From source file:cc.kune.gspace.client.i18n.I18nTranslateRecomendPanel.java
License:GNU Affero Public License
/** * Instantiates a new i18n translate recomend panel. * //from w w w. ja v a 2 s . c o m * @param i18n * the i18n */ @Inject public I18nTranslateRecomendPanel(final I18nTranslationService i18n) { tabTitle = new Label(i18n.t("Recommendations")); recommFrame = new Frame("ws/i18n-recom.html"); // recommFrame.setHeight("auto"); recommFrame.setStyleName("k-i18n-recommend"); initWidget(recommFrame); }
From source file:cc.kune.gspace.client.options.general.UserOptGeneralPanel.java
License:GNU Affero Public License
/** * Instantiates a new user opt general panel. * * @param i18n/*from w ww .j a v a 2 s.co m*/ * the i18n * @param res * the res * @param maskWidget * the mask widget * @param langSelector * the lang selector */ @Inject public UserOptGeneralPanel(final I18nTranslationService i18n, final IconicResources res, final MaskWidgetView maskWidget, final LanguageSelectorPanel langSelector) { super(maskWidget, res.equalizerWhite(), i18n.t("General"), i18n.t("You can change these values:")); this.langSelector = langSelector; longName = UserFieldFactory.createUserLongName(LONG_NAME_FIELD); add(longName); langSelector.setLangTitle(i18n.t("Your language")); langSelector.setLangSeparator(" "); langSelector.setTitleWidth("100px"); email = UserFieldFactory.createUserEmail(EMAIL_FIELD); add(email); emailNotifTypeFieldSet = DefaultFormUtils .createFieldSet(i18n.t("How often do you want to receive email notifications?")); immediateRadio = DefaultFormUtils.createRadio(emailNotifTypeFieldSet, i18n.t("almost immediately"), TYPEOFEMAILNOTIF_FIELD, i18n.t("you will receive an email with any new messages in your inbox at [%s] almost immediately", i18n.getSiteCommonName()), IMMEDIATE_TYPE_ID); immediateRadio.setTabIndex(3); immediateRadio.setValue(true); hourlyRadio = DefaultFormUtils.createRadio(emailNotifTypeFieldSet, i18n.t("at most hourly"), TYPEOFEMAILNOTIF_FIELD, i18n.t("you will receive an email with any new messages in your inbox at [%s] at most hourly", i18n.getSiteCommonName()), HOURLY_TYPE_ID); hourlyRadio.setTabIndex(4); hourlyRadio.setValue(false); dailyRadio = DefaultFormUtils.createRadio(emailNotifTypeFieldSet, i18n.t("at most daily"), TYPEOFEMAILNOTIF_FIELD, i18n.t("you will receive an email with any new messages in your inbox at [%s] at most daily", i18n.getSiteCommonName()), DAILY_TYPE_ID); dailyRadio.setTabIndex(5); dailyRadio.setValue(false); noRadio = DefaultFormUtils.createRadio(emailNotifTypeFieldSet, i18n.t("I don't need email notifications"), TYPEOFEMAILNOTIF_FIELD, i18n.t("you will no receive an email with any new messages in your inbox at [%s]", i18n.getSiteCommonName()), NO_TYPE_ID); noRadio.setTabIndex(6); noRadio.setValue(false); add(emailNotifTypeFieldSet); final Label notVerified = new Label( i18n.t("Your email is not verified, so you will not receive email notifications")); notVerified.setStyleName("oc-user-msg"); notVerified.addStyleName("k-3corners"); notVerifLabelAdapter = new AdapterField(notVerified); notVerifLabelAdapter.setLabelSeparator(""); notVerifLabelAdapter.setWidth(DefaultFormUtils.BIG_FIELD_SIZE); super.add(notVerifLabelAdapter); resendEmailVerifBtn = new CustomButton(i18n.t("Resend verification email")); resendEmailVerifBtn.addStyleName("k-button"); resendEmailVerifAdapter = new AdapterField(resendEmailVerifBtn); resendEmailVerifAdapter.setValidateOnBlur(false); resendEmailVerifAdapter.setLabelSeparator(""); resendEmailVerifAdapter.setWidth(DefaultFormUtils.BIG_FIELD_SIZE); // resendEmailVerifAdapter.setFieldLabel(i18n.t("Maybe you want receive again our verification email")); add(resendEmailVerifAdapter); add(langSelector); }
From source file:cc.kune.gspace.client.options.style.EntityOptStylePanel.java
License:GNU Affero Public License
/** * Instantiates a new entity opt style panel. * * @param i18n//from w w w. ja v a2 s .c o m * the i18n * @param res * the res * @param styleSelector * the style selector */ public EntityOptStylePanel(final I18nTranslationService i18n, final IconicResources res, final GSpaceThemeSelectorPanel styleSelector) { this.i18n = i18n; tabTitle = TabTitleGenerator.generate(res.styleWhite(), i18n.t("Style"), MAX_TABTITLE_LENGTH, TAB_ID); // super.setHeight(String.valueOf(EntityOptionsView.HEIGHT) + "px"); final FlowPanel flow = new FlowPanel(); wsThemeInfo = new Label(i18n.t("Change the group workspace theme:")); flow.addStyleName("kune-Margin-20-tb"); wsThemeInfo.addStyleName("k-fl"); styleSelector.addStyleName("k-fl"); styleSelector.addStyleName("kune-Margin-10-lr"); flow.add(wsThemeInfo); flow.add(styleSelector); hasBackLabel = i18n.t("Current background image: "); noHasBacklabel = i18n.t("You can also upload a background:"); backgroundLabel = new IconLabel(res.pictureGrey(), hasBackLabel); backgroundLabel.addStyleName("k-clear"); chooseImage = i18n.t("choose an image"); changeImage = i18n.t("choose another image"); uploader = new UploaderPanel(chooseImage, FileConstants.ACCEPTED_IMAGES); uploader.setLabelText(""); uploader.addStyleName("k-clean"); clearBtn = new CustomButton(i18n.t("Clear")); clearBtn.addStyleName("k-fr"); clearBtn.addStyleName("kune-Margin-20-lr"); Tooltip.to(clearBtn, i18n.t("Remove current background image")); flow.add(backgroundLabel); flow.add(clearBtn); flow.add(uploader); flow.addStyleName("oc-clean"); // final Label wsInfo = new // Label(i18n.t("Select and configure the public space theme of this group:")); // wsInfo.addStyleName("kune-Margin-Medium-tb"); // flow.add(wsInfo); // final VerticalPanel stylesPanel = new VerticalPanel(); // final ClickHandler clickHandler = new ClickHandler() { // // @Override // public void onClick(final ClickEvent event) { // NotifyUser.info(i18n.t(TextUtils.IN_DEVELOPMENT)); // } // }; // for (int i = 1; i <= 6; i++) { // final BasicThumb thumb = new BasicThumb( // GWT.getModuleBaseURL() + "images/styles/styl" + i + ".png", "Style " + i, // clickHandler); // thumb.setTooltip(i18n.t("Click to select and configure this theme")); // // add(thumb); // } // stylesPanel.addStyleName("oc-clean"); // add(stylesPanel); initWidget(flow); super.setWidth(String.valueOf(EntityOptionsView.WIDTH_WOUT_MARGIN) + "px"); setBackImageVisibleImpl(false); super.addStyleName("k-overflow-y-auto"); super.addStyleName("k-tab-panel"); }
From source file:cc.kune.gspace.client.share.ShareToOthersPanel.java
License:Open Source License
@Inject public ShareToOthersPanel(final I18nUITranslationService i18n, final ShareToOthersDropController dropController) { this.dropController = dropController; final FlowPanel flow = new FlowPanel(); flow.addStyleName("k-share-others"); multivalueSBox = SearchBoxFactory.create(i18n, false, true, SEARCH_TEXTBOX_ID, new OnEntitySelectedInSearch() { @Override/*from ww w . j a v a 2 s .c om*/ public void onSeleted(final String shortName) { if (addListener != null) { addListener.onAdd(shortName); } } }); final SuggestBox suggestBox = multivalueSBox.getSuggestBox(); final ValueBoxBase<String> searchTextBox = suggestBox.getValueBox(); final Label suggestBoxIntro = new Label(I18n.t("drag and drop to add people or")); final Label suggestTextWhenEmpty = new Label(I18n.t("search to add")); flow.add(suggestBoxIntro); flow.add(multivalueSBox); flow.add(suggestTextWhenEmpty); multivalueSBox.addStyleName("k-share-searchbox"); suggestTextWhenEmpty.addStyleName("k-share-searchbox-text"); suggestTextWhenEmpty.addStyleName("k-clean"); initWidget(flow); // Search box settings suggestTextWhenEmpty.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { suggestBox.setFocus(true); } }); searchTextBox.addFocusHandler(new FocusHandler() { @Override public void onFocus(final FocusEvent event) { // searchLabel.setVisible(false); suggestTextWhenEmpty.getElement().getStyle().setVisibility(Visibility.HIDDEN); } }); searchTextBox.addBlurHandler(new BlurHandler() { @Override public void onBlur(final BlurEvent event) { if (searchTextBox.getValue().isEmpty()) { suggestTextWhenEmpty.getElement().getStyle().setVisibility(Visibility.VISIBLE); } } }); // Tooltips Tooltip.to(suggestBox, I18n.t(NOT_LIST_TOOLTIP)); Tooltip.to(suggestTextWhenEmpty, I18n.t(NOT_LIST_TOOLTIP)); Tooltip.to(suggestBoxIntro, I18n.t(NOT_LIST_TOOLTIP)); // D&D dropController.init(flow); }
From source file:cc.kune.gspace.client.share.ShareToTheNetPanel.java
License:Open Source License
@Inject public ShareToTheNetPanel(final ShareInTwitterMenuItem twitterItem, final ShareInGPlusMenuItem gPlusItem, final ShareInIdenticaMenuItem identicaItem, final ShareInLinkedinMenuItem linkedItem, final ShareInTumblrMenuItem tumblrItem, final ShareInDiggMenuItem diggItem, final ShareInRedditMenuItem redditItem, final ShareInFacebookMenuItem facebookItem, final ActionSimplePanel actionsPanel) { final FlowPanel flow = new FlowPanel(); final Label shareThisLinkTitle = new Label(I18n.t("share this link via:")); shareThisLinkTitle.setStyleName("k-sharetonet-introtexts"); final Label linkToShareIntro = new Label(I18n.t("Link to share:")); linkToShareIntro.addStyleName("k-sharetonet-introtexts"); linkToShare = new TextBox(); linkToShare.setVisibleLength(35);/*w ww . j a v a 2s.co m*/ linkToShare.setReadOnly(true); linkToShare.addStyleName("k-sharelink-box"); linkToShare.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { linkToShare.setSelectionRange(0, linkToShare.getValue().length()); } }); flow.add(linkToShareIntro); flow.add(linkToShare); flow.add(shareThisLinkTitle); actionsPanel.add(btnFrom(twitterItem)); actionsPanel.add(btnFrom(gPlusItem)); actionsPanel.add(btnFrom(facebookItem)); actionsPanel.add(btnFrom(redditItem)); actionsPanel.add(btnFrom(diggItem)); actionsPanel.add(btnFrom(linkedItem)); actionsPanel.add(btnFrom(tumblrItem)); flow.add(actionsPanel); shareThisLinkTitle.addStyleName("k-fl"); actionsPanel.addStyleName("k-fl"); initWidget(flow); }