Search in sources :

Example 96 with Label

use of com.google.gwt.user.client.ui.Label in project gerrit by GerritCodeReview.

the class ProjectInfoScreen method initProjectOptions.

private void initProjectOptions() {
    grid.addHeader(new SmallHeading(AdminConstants.I.headingProjectOptions()));
    state = new ListBox();
    for (ProjectState stateValue : ProjectState.values()) {
        state.addItem(Util.toLongString(stateValue), stateValue.name());
    }
    saveEnabler.listenTo(state);
    grid.add(AdminConstants.I.headingProjectState(), state);
    submitType = new ListBox();
    for (final SubmitType type : SubmitType.values()) {
        submitType.addItem(Util.toLongString(type), type.name());
    }
    submitType.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent event) {
            setEnabledForUseContentMerge();
        }
    });
    saveEnabler.listenTo(submitType);
    grid.add(AdminConstants.I.headingProjectSubmitType(), submitType);
    contentMerge = newInheritedBooleanBox();
    saveEnabler.listenTo(contentMerge);
    grid.add(AdminConstants.I.useContentMerge(), contentMerge);
    newChangeForAllNotInTarget = newInheritedBooleanBox();
    saveEnabler.listenTo(newChangeForAllNotInTarget);
    grid.add(AdminConstants.I.createNewChangeForAllNotInTarget(), newChangeForAllNotInTarget);
    requireChangeID = newInheritedBooleanBox();
    saveEnabler.listenTo(requireChangeID);
    grid.addHtml(AdminConstants.I.requireChangeID(), requireChangeID);
    if (Gerrit.info().receive().enableSignedPush()) {
        enableSignedPush = newInheritedBooleanBox();
        saveEnabler.listenTo(enableSignedPush);
        grid.add(AdminConstants.I.enableSignedPush(), enableSignedPush);
        requireSignedPush = newInheritedBooleanBox();
        saveEnabler.listenTo(requireSignedPush);
        grid.add(AdminConstants.I.requireSignedPush(), requireSignedPush);
    }
    rejectImplicitMerges = newInheritedBooleanBox();
    saveEnabler.listenTo(rejectImplicitMerges);
    grid.addHtml(AdminConstants.I.rejectImplicitMerges(), rejectImplicitMerges);
    enableReviewerByEmail = newInheritedBooleanBox();
    saveEnabler.listenTo(enableReviewerByEmail);
    grid.addHtml(AdminConstants.I.enableReviewerByEmail(), enableReviewerByEmail);
    maxObjectSizeLimit = new NpTextBox();
    saveEnabler.listenTo(maxObjectSizeLimit);
    effectiveMaxObjectSizeLimit = new Label();
    effectiveMaxObjectSizeLimit.setStyleName(Gerrit.RESOURCES.css().maxObjectSizeLimitEffectiveLabel());
    HorizontalPanel p = new HorizontalPanel();
    p.add(maxObjectSizeLimit);
    p.add(effectiveMaxObjectSizeLimit);
    grid.addHtml(AdminConstants.I.headingMaxObjectSizeLimit(), p);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Label(com.google.gwt.user.client.ui.Label) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) ProjectState(com.google.gerrit.extensions.client.ProjectState) SubmitType(com.google.gerrit.extensions.client.SubmitType) ListBox(com.google.gwt.user.client.ui.ListBox) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 97 with Label

use of com.google.gwt.user.client.ui.Label in project gerrit by GerritCodeReview.

the class GroupListScreen method initPageHeader.

private void initPageHeader() {
    final HorizontalPanel hp = new HorizontalPanel();
    hp.setStyleName(Gerrit.RESOURCES.css().projectFilterPanel());
    final Label filterLabel = new Label(AdminConstants.I.projectFilter());
    filterLabel.setStyleName(Gerrit.RESOURCES.css().projectFilterLabel());
    hp.add(filterLabel);
    filterTxt = new NpTextBox();
    filterTxt.setValue(match);
    filterTxt.addKeyUpHandler(new KeyUpHandler() {

        @Override
        public void onKeyUp(KeyUpEvent event) {
            Query q = new Query(filterTxt.getValue()).open(event.getNativeKeyCode() == KeyCodes.KEY_ENTER);
            if (match.equals(q.qMatch)) {
                q.start(start);
            }
            if (q.open || !match.equals(q.qMatch)) {
                if (query == null) {
                    q.run();
                }
                query = q;
            }
        }
    });
    hp.add(filterTxt);
    add(hp);
}
Also used : KeyUpEvent(com.google.gwt.event.dom.client.KeyUpEvent) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) KeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) NpTextBox(com.google.gwtexpui.globalkey.client.NpTextBox)

Example 98 with Label

use of com.google.gwt.user.client.ui.Label in project perun by CESNET.

the class UserExtSourceDetailTabItem method draw.

public Widget draw() {
    this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin().trim()));
    // MAIN TAB PANEL
    VerticalPanel vp = new VerticalPanel();
    vp.setSize("100%", "100%");
    // The table
    AbsolutePanel dp = new AbsolutePanel();
    //dp.setStyleName("decoration");
    final FlexTable menu = new FlexTable();
    menu.setCellSpacing(5);
    menu.setWidget(0, 0, new Image(LargeIcons.INSTANCE.worldIcon()));
    Label memberName = new Label();
    memberName.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin(), 40));
    memberName.setStyleName("now-managing");
    memberName.setTitle(userExtSource.getLogin());
    menu.setWidget(0, 1, memberName);
    int column = 2;
    menu.setHTML(0, column, " ");
    menu.getFlexCellFormatter().setWidth(0, column, "25px");
    column++;
    if (JsonUtils.isExtendedInfoVisible()) {
        menu.setHTML(0, column, "<strong>UES ID:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getId() + "</span>");
        column++;
        menu.setHTML(0, column, "&nbsp;");
        menu.getFlexCellFormatter().setWidth(0, column, "25px");
        column++;
        menu.setHTML(0, column, "<strong>ES name:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getName() + "</span>");
        column++;
        menu.setHTML(0, column, "&nbsp;");
        menu.getFlexCellFormatter().setWidth(0, column, "25px");
        column++;
        menu.setHTML(0, column, "<strong>ES type:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getType() + "</span>");
    }
    dp.add(menu);
    vp.add(dp);
    vp.setCellHeight(dp, "30px");
    tabPanel.clear();
    tabPanel.add(new UserExtSourceSettingsTabItem(userExtSource), "Settings");
    // Resize must be called after page fully displays
    Scheduler.get().scheduleDeferred(new Command() {

        @Override
        public void execute() {
            tabPanel.finishAdding();
        }
    });
    vp.add(tabPanel);
    this.contentWidget.setWidget(vp);
    return getWidget();
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Command(com.google.gwt.user.client.Command) FlexTable(com.google.gwt.user.client.ui.FlexTable) Label(com.google.gwt.user.client.ui.Label) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Image(com.google.gwt.user.client.ui.Image)

Example 99 with Label

use of com.google.gwt.user.client.ui.Label in project opennms by OpenNMS.

the class AlarmControl method doOnAdd.

public Element doOnAdd() {
    LOG.info("AlarmControl.doOnAdd()");
    final AlarmControlCss css = AlarmControlBundle.INSTANCE.css();
    css.ensureInjected();
    m_eventManager.addHandler(AlarmSeverityUpdatedEvent.TYPE, this);
    this.setStylePrimaryName("leaflet-control-alarm");
    this.addStyleName("leaflet-bar");
    this.addStyleName("leaflet-control");
    final Label label = new Label("Show Severity >=");
    label.getElement().setAttribute("for", "alarmControl");
    label.addStyleName(css.label());
    m_severityBox = new ListBox(false);
    m_severityBox.getElement().setId("alarmControl");
    for (final AlarmSeverity sev : AlarmSeverity.values()) {
        m_severityBox.addItem(sev.getLabel());
    }
    m_severityBox.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(final ChangeEvent event) {
            final int selected = m_severityBox.getSelectedIndex();
            LOG.info("new selection index = " + selected);
            final String value = m_severityBox.getValue(selected);
            LOG.info("new severity = " + value);
            m_eventManager.fireEvent(new AlarmSeverityUpdatedEvent(AlarmSeverity.get(value)));
            event.stopPropagation();
        }
    });
    m_severityBox.addStyleName(css.label());
    this.add(label);
    this.add(m_severityBox);
    LOG.info("AlarmControl.doOnAdd(): finished, returning: " + this.getElement());
    m_componentTracker.ready(getClass());
    return this.getElement();
}
Also used : AlarmSeverity(org.opennms.features.vaadin.nodemaps.internal.gwt.client.AlarmSeverity) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Label(com.google.gwt.user.client.ui.Label) AlarmSeverityUpdatedEvent(org.opennms.features.vaadin.nodemaps.internal.gwt.client.event.AlarmSeverityUpdatedEvent) ListBox(com.google.gwt.user.client.ui.ListBox)

Example 100 with Label

use of com.google.gwt.user.client.ui.Label in project openremote by openremote.

the class AppActivityManager method onPlaceChange.

/**
 * Deactivate the current activity, find the next one from our ActivityMapper,
 * and start it.
 * <p>
 * The current activity's widget will be hidden immediately, which can cause
 * flicker if the next activity provides its widget asynchronously. That can
 * be minimized by decent caching. Perenially slow activities might mitigate
 * this by providing a widget immediately, with some kind of "loading"
 * treatment.
 */
public void onPlaceChange(Place newPlace) {
    if (LOG.isLoggable(Level.FINE))
        LOG.fine(name + " - on place change: " + newPlace);
    AppActivity nextActivity = getNextActivity(newPlace);
    if (LOG.isLoggable(Level.FINE))
        LOG.fine(name + " - next activity is: " + nextActivity);
    if (nextActivity == null) {
        nextActivity = NULL_ACTIVITY;
    }
    if (currentActivity.equals(nextActivity)) {
        if (LOG.isLoggable(Level.FINE))
            LOG.fine(name + " - activity unchanged");
        return;
    } else {
        if (LOG.isLoggable(Level.FINE))
            LOG.fine(name + " - activity changed, transitioning");
    }
    if (startingNext) {
        // The place changed again before the new current activity showed its widget
        tryStopOrCancel(false);
        currentActivity = NULL_ACTIVITY;
        startingNext = false;
    } else if (!currentActivity.equals(NULL_ACTIVITY)) {
        showWidget(null);
        if (LOG.isLoggable(Level.FINE))
            LOG.fine(name + " - removing current activity registrations: " + activityRegistrations);
        eventBus.removeAll(activityRegistrations);
        activityRegistrations.clear();
        tryStopOrCancel(true);
    }
    currentActivity = nextActivity;
    if (currentActivity.equals(NULL_ACTIVITY)) {
        Label nullLabel = new Label("No activity available for given place.");
        nullLabel.getElement().getStyle().setColor("red");
        nullLabel.getElement().getStyle().setFontWeight(Style.FontWeight.BOLD);
        showWidget(nullLabel);
    } else {
        startingNext = true;
        tryStart();
    }
}
Also used : Label(com.google.gwt.user.client.ui.Label)

Aggregations

Label (com.google.gwt.user.client.ui.Label)106 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)22 Test (org.junit.Test)19 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)17 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)11 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)11 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)10 ArrayList (java.util.ArrayList)10 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)9 TextBox (com.google.gwt.user.client.ui.TextBox)9 Image (com.google.gwt.user.client.ui.Image)8 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)7 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)7 CheckBox (com.google.gwt.user.client.ui.CheckBox)7 NpTextBox (com.google.gwtexpui.globalkey.client.NpTextBox)7 HTML (com.google.gwt.user.client.ui.HTML)6 JsArrayString (com.google.gwt.core.client.JsArrayString)5 Element (com.google.gwt.dom.client.Element)5 KeyUpEvent (com.google.gwt.event.dom.client.KeyUpEvent)5 KeyUpHandler (com.google.gwt.event.dom.client.KeyUpHandler)5