use of com.google.gwt.user.client.ui.Label in project che by eclipse.
the class NotificationContainerItem method update.
/**
* Update notification's widget values.
* <p/>
* Widget consumes:
* <ul>
* <li>{@link Notification#title}</li>
* <li>{@link Notification#content}</li>
* <li>Icon and background color based on {@link StatusNotification.Status}</li>
* </ul>
*/
private void update() {
Widget titleWidget = titlePanel.getWidget();
if (titleWidget != null && titleWidget instanceof Label) {
((Label) titleWidget).setText(notification.getTitle());
StringBuilder infoBuilder = new StringBuilder();
if (notification.getProject() != null) {
infoBuilder.append("Project: ").append(notification.getProject().getName()).append(". ");
}
infoBuilder.append(DATA_FORMAT.format(new Date(notification.getTime())));
titlePanel.getElement().setAttribute("info", infoBuilder.toString());
}
Widget messageWidget = messagePanel.getWidget();
if (messageWidget != null && messageWidget instanceof Label) {
((Label) messageWidget).setText(notification.getContent());
}
if (notification instanceof StatusNotification) {
iconPanel.setWidget(getIconBaseOnStatus());
}
}
use of com.google.gwt.user.client.ui.Label in project che by eclipse.
the class NotificationContainerItem method createContentWidget.
/**
* Create message widget that contains notification message.
*
* @return {@link SimplePanel} as message wrapper
*/
private SimplePanel createContentWidget() {
SimplePanel messageWrapper = new SimplePanel();
Label messageLabel = new Label();
messageWrapper.add(messageLabel);
messageWrapper.setStyleName(resources.notificationCss().notificationMessageWrapper());
messageWrapper.ensureDebugId(MESSAGE_WRAPPER_DBG_ID + notification.getId());
return messageWrapper;
}
use of com.google.gwt.user.client.ui.Label in project che by eclipse.
the class NotificationPopup method createTitleWidget.
/**
* Create title widget that contains notification title.
*
* @return {@link SimplePanel} as title wrapper
*/
private SimplePanel createTitleWidget() {
SimplePanel titleWrapper = new SimplePanel();
Label titleLabel = new Label();
titleWrapper.add(titleLabel);
titleWrapper.setStyleName(resources.notificationCss().notificationPopupTitleWrapper());
titleWrapper.ensureDebugId(TITLE_DBG_ID + notification.getId());
return titleWrapper;
}
use of com.google.gwt.user.client.ui.Label in project che by eclipse.
the class StatusText method paint.
@Override
public void paint() {
verticalPanel.clear();
if (showPredicate.apply(widget)) {
verticalPanel.add(new Label(getText()));
widget.getElement().appendChild(verticalPanel.getElement());
}
}
use of com.google.gwt.user.client.ui.Label in project che by eclipse.
the class OrganizeImportsViewImpl method show.
/** {@inheritDoc} */
@Override
public void show(ConflictImportDTO match) {
container.clear();
List<String> matches = match.getTypeMatches();
for (String fqn : matches) {
final Label label = new Label(fqn);
if (fqn.equals(selectedImport)) {
selectedLabel = label;
selectedLabel.getElement().getStyle().setBackgroundColor(getEditorSelectionColor());
}
label.getElement().getStyle().setColor(getMainFontColor());
label.getElement().getStyle().setCursor(POINTER);
label.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
selectedLabel.getElement().getStyle().setBackgroundColor("initial");
selectedLabel = label;
label.getElement().getStyle().setBackgroundColor(getEditorSelectionColor());
}
});
container.add(label);
}
super.show();
}
Aggregations