List of usage examples for com.google.gwt.user.client.ui Widget setTitle
public void setTitle(String title)
From source file:org.bonitasoft.forms.client.view.widget.FormFieldWidget.java
License:Open Source License
/** * add generic features to the field widgets * * @param fieldWidget/*from www . ja v a 2s. c o m*/ * the GWT widget * @param widgetData * the widget data object */ protected void addStandardWidgetFeatures(final Widget fieldWidget, final ReducedFormWidget widgetData) { if (isStaticField()) { if (widgetType.equals(WidgetType.IMAGE)) { fieldWidget.setStyleName("bonita_form_image_container"); } else { fieldWidget.setStyleName("bonita_form_text"); } } else { fieldWidget.setStyleName("bonita_form_field"); if (widgetType.equals(WidgetType.DATE)) { fieldWidget.addStyleName("bonita_form_date"); } } if (widgetData.getTitle() != null && widgetData.getTitle().length() > 0) { fieldWidget.setTitle(widgetData.getTitle()); } insertWidgetInPanel(fieldWidget, widgetData); }
From source file:org.eclipse.che.ide.notification.NotificationPopup.java
License:Open Source License
/** * Update notification's widget values.//from w ww . j a v a 2 s . co m * <p/> * Widget consumes: * <ul> * <li>{@link Notification#title}</li> * <li>{@link Notification#content}</li> * <li>Icon and background color based on {@link Status}</li> * </ul> */ private void update() { Widget titleWidget = titlePanel.getWidget(); if (titleWidget != null && titleWidget instanceof Label) { ((Label) titleWidget).setText(notification.getTitle()); titleWidget.setTitle(notification.getTitle()); } Widget messageWidget = messagePanel.getWidget(); if (messageWidget != null && messageWidget instanceof Label) { ((Label) messageWidget).setText(notification.getContent()); } iconPanel.setWidget(getIconBaseOnStatus()); removeStyleName(resources.notificationCss().notificationStatusProgress()); removeStyleName(resources.notificationCss().notificationStatusSuccess()); removeStyleName(resources.notificationCss().notificationStatusFail()); DisplayMode displayMode = notification.getDisplayMode(); Status status = notification.getStatus(); switch (status) { case PROGRESS: setStyleName(resources.notificationCss().notificationStatusProgress(), true); break; case SUCCESS: setStyleName(resources.notificationCss().notificationStatusSuccess(), true); break; case FAIL: setStyleName(resources.notificationCss().notificationStatusFail(), true); break; } if (FLOAT_MODE == displayMode && PROGRESS == status) { hideTimer.cancel(); return; } hideTimer.schedule(DEFAULT_TIME); }
From source file:org.eurekastreams.web.client.ui.common.GroupPanel.java
License:Apache License
/** * Constructor./*from w ww . jav a 2 s. c o m*/ * * @param group * to display * @param showFollowers * to display * @param makeLinkable * whether to display it or not * @param showDescription * Whether to display the description line. */ public GroupPanel(final DomainGroupModelView group, final boolean makeLinkable, final boolean showFollowers, final boolean showDescription) { addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItem()); addStyleName(StaticResourceBundle.INSTANCE.coreCss().listItem()); addStyleName(StaticResourceBundle.INSTANCE.coreCss().group()); add(new AvatarLinkPanel(EntityType.GROUP, group.getUniqueId(), group.getAvatarId(), Size.Small)); FlowPanel infoPanel = new FlowPanel(); infoPanel.setStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemInfo()); if (!group.isPublic()) { Label icon = new Label(); icon.addStyleName(StaticResourceBundle.INSTANCE.coreCss().privateIcon()); icon.setTitle("Private Group"); infoPanel.add(icon); } Widget name; if (makeLinkable) { String nameUrl = Session.getInstance() .generateUrl(new CreateUrlRequest(Page.GROUPS, group.getShortName())); name = new Hyperlink(group.getName(), nameUrl); } else { name = new Label(group.getName()); } name.setTitle(group.getName()); name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemName()); name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsisChild()); infoPanel.add(name); if (showDescription) { String descriptionText = group.getDescription(); if (descriptionText != null && !descriptionText.isEmpty()) { Label about = new Label(descriptionText); about.setTitle(descriptionText); about.addStyleName(StaticResourceBundle.INSTANCE.coreCss().missionStatement()); about.addStyleName(StaticResourceBundle.INSTANCE.coreCss().oneLineDescription()); about.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsis()); infoPanel.add(about); } } if (showFollowers) { FlowPanel followersPanel = new FlowPanel(); followersPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowers()); InlineLabel followers = new InlineLabel("Followers: "); followersPanel.add(followers); InlineLabel followersCount = new InlineLabel(Integer.toString(group.getFollowersCount())); followersCount.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData()); followersPanel.add(followersCount); insertActionSeparator(followersPanel); followersPanel.add(new InlineLabel("Added: ")); DateFormatter dateFormatter = new DateFormatter(new Date()); InlineLabel dateAdded = new InlineLabel(dateFormatter.timeAgo(group.getDateAdded(), true)); dateAdded.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData()); followersPanel.add(dateAdded); infoPanel.add(followersPanel); } infoPanel.add(new FollowPanel(group)); this.add(infoPanel); }
From source file:org.eurekastreams.web.client.ui.common.PersonPanel.java
License:Apache License
/** * Constructor.//from w w w .ja v a 2s .c o m * * @param person * to display * @param showFollowers * to display * @param makeLinkable * whether to display it or not * @param showDescription * Whether to display the description line. * @param showEmail * Whether or not the email address should be shown. */ public PersonPanel(final PersonModelView person, final boolean makeLinkable, final boolean showFollowers, final boolean showDescription, final boolean showEmail) { addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItem()); addStyleName(StaticResourceBundle.INSTANCE.coreCss().listItem()); addStyleName(StaticResourceBundle.INSTANCE.coreCss().person()); add(AvatarLinkPanel.create(person, Size.Small)); FlowPanel infoPanel = new FlowPanel(); infoPanel.setStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemInfo()); Widget name; if (makeLinkable) { String nameUrl = Session.getInstance() .generateUrl(new CreateUrlRequest(Page.PEOPLE, person.getAccountId())); name = new Hyperlink(person.getDisplayName(), nameUrl); } else { name = new Label(person.getDisplayName()); } name.setTitle(person.getDisplayName()); name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemName()); name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsisChild()); Label title = new Label(person.getTitle()); title.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemTitle()); title.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsis()); infoPanel.add(name); infoPanel.add(title); if (showDescription) { String descriptionText = person.getDescription(); if (descriptionText != null && !descriptionText.isEmpty()) { Label about = new Label(descriptionText); about.setTitle(descriptionText); about.addStyleName(StaticResourceBundle.INSTANCE.coreCss().shortBio()); about.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsis()); infoPanel.add(about); } } if (showFollowers) { FlowPanel followersPanel = new FlowPanel(); followersPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowers()); InlineLabel followers = new InlineLabel("Followers: "); followersPanel.add(followers); InlineLabel followersCount = new InlineLabel(Integer.toString(person.getFollowersCount())); followersCount.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData()); followersPanel.add(followersCount); insertActionSeparator(followersPanel); followersPanel.add(new InlineLabel("Added: ")); DateFormatter dateFormatter = new DateFormatter(new Date()); InlineLabel dateAdded = new InlineLabel(dateFormatter.timeAgo(person.getDateAdded(), true)); dateAdded.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData()); followersPanel.add(dateAdded); infoPanel.add(followersPanel); } if (showEmail) { String emailText = person.getEmail(); if (emailText != null && !emailText.isEmpty()) { Label email = new Label(emailText); email.addStyleName(StaticResourceBundle.INSTANCE.coreCss().email()); email.addStyleName(StaticResourceBundle.INSTANCE.coreCss().extendedInfo()); infoPanel.add(email); } } if (Session.getInstance().getCurrentPerson().getId() != person.getId()) { infoPanel.add(new FollowPanel(person)); } this.add(infoPanel); }
From source file:org.nsesa.editor.gwt.amendment.client.ui.amendment.action.AmendmentActionPanelViewImpl.java
License:EUPL
public AmendmentActionPanelViewImpl() { final Widget widget = uiBinder.createAndBindUi(this); initWidget(widget);//ww w .j av a 2 s . c o m //show class name tool tip in hosted mode if (!GWT.isScript()) widget.setTitle(this.getClass().getName()); }
From source file:org.nsesa.editor.gwt.amendment.client.ui.amendment.AmendmentViewImpl.java
License:EUPL
@Inject public AmendmentViewImpl(final Constants constants) { this.constants = constants; final Widget widget = uiBinder.createAndBindUi(this); initWidget(widget);/*from w w w. ja va 2 s.com*/ //show class name tool tip in hosted mode if (!GWT.isScript()) widget.setTitle(this.getClass().getName()); }
From source file:org.nsesa.editor.gwt.amendment.client.ui.amendment.ConsolidatedAmendmentViewImpl.java
License:EUPL
@Inject public ConsolidatedAmendmentViewImpl(final Constants constants) { this.constants = constants; final Widget widget = uiBinder.createAndBindUi(this); initWidget(widget);//from www . j a va 2 s . c om //show class name tool tip in hosted mode if (!GWT.isScript()) widget.setTitle(this.getClass().getName()); }
From source file:org.nsesa.editor.gwt.amendment.client.ui.amendment.share.SharePanelViewImpl.java
License:EUPL
public SharePanelViewImpl() { final Widget widget = uiBinder.createAndBindUi(this); initWidget(widget);/*from w ww . j av a 2s. c om*/ //show class name tool tip in hosted mode if (!GWT.isScript()) widget.setTitle(this.getClass().getName()); }
From source file:org.nsesa.editor.gwt.amendment.client.ui.amendment.SingleColumnAmendmentViewImpl.java
License:EUPL
@Inject public SingleColumnAmendmentViewImpl(final Constants constants) { this.constants = constants; final Widget widget = uiBinder.createAndBindUi(this); initWidget(widget);//from ww w . j a v a 2 s .c o m //show class name tool tip in hosted mode if (!GWT.isScript()) widget.setTitle(this.getClass().getName()); }
From source file:org.nsesa.editor.gwt.amendment.client.ui.document.AmendmentDocumentViewImpl.java
License:EUPL
@Inject public AmendmentDocumentViewImpl(final DocumentEventBus documentEventBus, final InfoPanelController infoPanelController, final SourceFileController sourceFileController, final AmendmentsPanelController amendmentsPanelController, final org.nsesa.editor.gwt.core.client.ui.document.resources.Resources resources) { this.documentEventBus = documentEventBus; this.sourceFileView = sourceFileController.getView(); this.infoPanelView = infoPanelController.getView(); this.amendmentsPanelView = amendmentsPanelController.getView(); this.resources = resources; final Widget widget = uiBinder.createAndBindUi(this); initWidget(widget);/*w ww. j a va2s . c om*/ //show class name tool tip in hosted mode if (!GWT.isScript()) widget.setTitle(this.getClass().getName()); switchToTab(0); }