List of usage examples for com.google.gwt.user.client.ui Label Label
protected Label(Element element)
From source file:cc.kune.common.client.ui.AbstractFlowToolbar.java
License:GNU Affero Public License
@Override public Widget addFill() { final Label emptyLabel = new Label(""); emptyLabel.addStyleName("oc-floatright"); // emptyLabel.setWidth("100%"); add(emptyLabel);// w w w. j av a 2 s.c o m return emptyLabel; }
From source file:cc.kune.common.client.ui.AbstractFlowToolbar.java
License:GNU Affero Public License
@Override public Widget addSeparator() { final Label emptyLabel = new Label(""); emptyLabel.setStyleName("ytb-sep-FIXMEEE"); emptyLabel.addStyleName("oc-tb-sep"); emptyLabel.addStyleName("oc-floatleft"); add(emptyLabel);/*from ww w . ja v a2 s . c om*/ return emptyLabel; }
From source file:cc.kune.common.client.ui.AbstractFlowToolbar.java
License:GNU Affero Public License
@Override public Widget addSpacer() { final Label emptyLabel = new Label(""); emptyLabel.setStyleName("oc-tb-spacer"); emptyLabel.addStyleName("oc-floatleft"); add(emptyLabel);//from w w w. j av a 2 s. c o m return emptyLabel; }
From source file:cc.kune.common.client.ui.BasicThumb.java
License:GNU Affero Public License
/** * Instantiates a new basic thumb./*from w w w . j ava 2 s . c o m*/ * * @param imageRef * This can be a ImageResource or a String Url * @param imgSize * the img size * @param text * the text * @param textMaxLenght * the text max lenght * @param crop * the crop * @param clickHandler * the click handler */ public BasicThumb(final Object imageRef, final int imgSize, final String text, final int textMaxLenght, final boolean crop, final ClickHandler clickHandler) { super(); onOverLabel = false; panel = new VerticalPanel(); if (imageRef instanceof String) { final String imageUrl = (String) imageRef; if (imgSize == NOSIZE) { image = new Image(imageUrl); } else { if (crop) { image = new Image(imageUrl, 0, 0, imgSize, imgSize); } else { image = new Image(imageUrl); image.setPixelSize(imgSize, imgSize); } } } else if (imageRef instanceof ImageResource) { image = new Image((ImageResource) imageRef); image.setPixelSize(imgSize, imgSize); } else { // This should not happen image = new Image(); image.setPixelSize(imgSize, imgSize); Log.info("Unrecognized icon of BasicThumb: " + imageRef); } final String title = textMaxLenght == NOSIZE ? text : TextUtils.ellipsis(text, textMaxLenght); label = new Label(title); panel.add(image); panel.add(label); panel.addStyleName("k-basic-thumb"); panel.addStyleName("kune-Margin-Mini-trbl"); panel.addStyleName("k-pointer"); panel.addStyleName("k-floatleft"); panel.setCellHorizontalAlignment(label, VerticalPanel.ALIGN_CENTER); if (clickHandler != null) { addClickHandlerImpl(clickHandler); } image.addMouseOverHandler(new MouseOverHandler() { @Override public void onMouseOver(final MouseOverEvent event) { if (onOverLabel) { label.setVisible(true); } } }); image.addMouseOutHandler(new MouseOutHandler() { @Override public void onMouseOut(final MouseOutEvent event) { if (onOverLabel) { label.setVisible(false); } } }); setElement(panel.getElement()); }
From source file:cc.kune.common.client.ui.dialogs.MessageToolbar.java
License:GNU Affero Public License
/** * Instantiates a new message toolbar.//from w w w. j ava 2 s.com * * @param images the images * @param errorLabelId the error label id */ public MessageToolbar(final NotifyLevelImages images, final String errorLabelId) { this.images = images; toolbar = new FlowPanel(); errorLabel = new Label(""); errorLabel.setWordWrap(true); errorLabel.ensureDebugId(errorLabelId); errorIcon = new Image(); errorIcon.setResource(images.getImage(NotifyLevel.error)); toolbar.add(errorIcon); toolbar.setStyleName("k-error-tb"); toolbar.add(errorLabel); errorIcon.setVisible(false); toolbar.setVisible(false); initWidget(toolbar); }
From source file:cc.kune.common.client.ui.FlowToolbar.java
License:GNU Affero Public License
@Override public Widget addFill() { final Label emptyLabel = new Label(""); emptyLabel.addStyleName("oc-floatright"); // emptyLabel.setWidth("100%"); this.add(emptyLabel); return emptyLabel; }
From source file:cc.kune.common.client.ui.FlowToolbar.java
License:GNU Affero Public License
@Override public Widget addSeparator() { final Label emptyLabel = new Label(""); emptyLabel.setStyleName("k-tb-sep"); emptyLabel.addStyleName("oc-tb-sep"); emptyLabel.addStyleName("oc-floatleft"); this.add(emptyLabel); return emptyLabel; }
From source file:cc.kune.common.client.ui.FlowToolbar.java
License:GNU Affero Public License
@Override public Widget addSpacer() { final Label emptyLabel = new Label(""); emptyLabel.setStyleName("oc-tb-spacer"); emptyLabel.addStyleName("oc-floatleft"); this.add(emptyLabel); return emptyLabel; }
From source file:cc.kune.core.client.auth.SignInPanel.java
License:GNU Affero Public License
/** * Creates the register and forgot passwd. * * @return the vertical panel// w ww. j a va 2 s . c o m */ private VerticalPanel createRegisterAndForgotPasswd() { final VerticalPanel noAccRegisterPanel = new VerticalPanel(); final HorizontalPanel hpanel = new HorizontalPanel(); final Label dontHaveAccount = new Label(i18n.t("Don't have an account?")); registerLabel = new Label(i18n.t("Create one.")); createLink(registerLabel, CREATE_ONE); registerLabel.addStyleName("kune-Margin-Medium-l"); forgotPasswordLabel = new Label(i18n.t("Lost your password?")); createLink(forgotPasswordLabel, FORGOT_PASSWD); hpanel.add(dontHaveAccount); hpanel.add(registerLabel); noAccRegisterPanel.add(hpanel); noAccRegisterPanel.add(forgotPasswordLabel); return noAccRegisterPanel; }
From source file:cc.kune.core.client.sitebar.auth.AskForPasswordResetPanel.java
License:GNU Affero Public License
/** * Instantiates a new ask for password reset panel. * //from www . ja v a 2 s . c o m * @param i18n * 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 AskForPasswordResetPanel(final I18nTranslationService i18n, final Session session, final MaskWidgetView mask, final NotifyLevelImages images, final EventBus eventbus, final Provider<UserServiceAsync> userService, final StateManager stateManager) { super(ASK_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(); form.setWidth(DEF_SIGN_IN_FORM_SIZE); final Label desc = new Label(i18n .t("Please enter your email address. You will receive a link to create a new password via email.")); desc.setWidth("320px"); resetEmail = UserFieldFactory.createUserEmail(EMAIL_RESET_ID); resetEmail.setFieldLabel(i18n.t("email")); resetEmail.setTabIndex(1); messageErrorBar = new MessageToolbar(images, errorLabelId); form.add(resetEmail); form.add(messageErrorBar); super.getFirstBtn().addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { if (form.isValid()) { userService.get().askForPasswordReset(resetEmail.getValue(), new AsyncCallback<Void>() { @Override public void onFailure(final Throwable caught) { if (caught instanceof EmailNotFoundException) { AskForPasswordResetPanel.this.setErrorMessage( i18n.t("There is no registered user with that e-mail address"), NotifyLevel.error); } else { AskForPasswordResetPanel.this.setErrorMessage( i18n.t("Other error trying to reset your password"), NotifyLevel.error); } StackErrorEvent.fire(eventbus, caught); AskForPasswordResetPanel.this.messageErrorBar.setVisible(true); } @Override public void onSuccess(final Void result) { NotifyUser.info(i18n.t("Check your email for the confirmation link")); hide(); } }); } } }); super.getSecondBtn().addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { hide(); } }); super.getInnerPanel().add(desc); super.getInnerPanel().add(form.getFormPanel()); }