Search in sources :

Example 1 with Label

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());
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) Label(com.google.gwt.user.client.ui.Label) StatusNotification(org.eclipse.che.ide.api.notification.StatusNotification) Date(java.util.Date)

Example 2 with Label

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;
}
Also used : Label(com.google.gwt.user.client.ui.Label) SimplePanel(com.google.gwt.user.client.ui.SimplePanel)

Example 3 with Label

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;
}
Also used : Label(com.google.gwt.user.client.ui.Label) SimplePanel(com.google.gwt.user.client.ui.SimplePanel)

Example 4 with Label

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());
    }
}
Also used : Label(com.google.gwt.user.client.ui.Label)

Example 5 with Label

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();
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Label(com.google.gwt.user.client.ui.Label)

Aggregations

Label (com.google.gwt.user.client.ui.Label)89 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)19 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)15 Test (org.junit.Test)11 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)10 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)10 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)9 TextBox (com.google.gwt.user.client.ui.TextBox)9 Image (com.google.gwt.user.client.ui.Image)8 CheckBox (com.google.gwt.user.client.ui.CheckBox)7 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 JsArrayString (com.google.gwt.core.client.JsArrayString)5 Element (com.google.gwt.dom.client.Element)5 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)5 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)5 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5 Grid (com.google.gwt.user.client.ui.Grid)5 HTML (com.google.gwt.user.client.ui.HTML)4