Search in sources :

Example 56 with ChangeEvent

use of com.google.gwt.event.dom.client.ChangeEvent 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 57 with ChangeEvent

use of com.google.gwt.event.dom.client.ChangeEvent in project zxing by zxing.

the class Generator method setupLeftPanel.

void setupLeftPanel() {
    topPanel.setHTML(2, 0, "<span id=\"errorMessageID\" class=\"" + StylesDefs.ERROR_MESSAGE + "\"></span>");
    // fills up the list of generators
    for (GeneratorSource generator : generators) {
        genList.addItem(generator.getName());
        setGridStyle(generator.getWidget());
    }
    sizeList.addItem("Small", "120");
    sizeList.addItem("Medium", "230");
    sizeList.addItem("Large", "350");
    sizeList.setSelectedIndex(2);
    ecLevelList.addItem("L");
    ecLevelList.addItem("M");
    ecLevelList.addItem("Q");
    ecLevelList.addItem("H");
    ecLevelList.setSelectedIndex(0);
    encodingList.addItem("UTF-8");
    encodingList.addItem("ISO-8859-1");
    encodingList.addItem("Shift_JIS");
    encodingList.setSelectedIndex(0);
    // updates the second row of the table with the content of the selected generator
    genList.addChangeHandler(new ChangeHandler() {

        @Override
        public void onChange(ChangeEvent Event) {
            int i = genList.getSelectedIndex();
            setWidget(i);
        }
    });
    // grid for the generator picker
    HTMLTable selectionTable = new Grid(1, 2);
    selectionTable.setText(0, 0, "Contents");
    selectionTable.setWidget(0, 1, genList);
    setGridStyle(selectionTable);
    topPanel.setWidget(0, 0, selectionTable);
    // grid for the generate button
    HTMLTable generateGrid = new Grid(1, 2);
    setGridStyle(generateGrid);
    Button generateButton = new Button("Generate &rarr;");
    generateButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            generate();
        }
    });
    generateGrid.setWidget(0, 1, generateButton);
    topPanel.setWidget(4, 0, generateGrid);
    HTMLTable configTable = new Grid(3, 2);
    configTable.setText(0, 0, "Barcode size");
    configTable.setWidget(0, 1, sizeList);
    configTable.setText(1, 0, "Error correction");
    configTable.setWidget(1, 1, ecLevelList);
    configTable.setText(2, 0, "Character encoding");
    configTable.setWidget(2, 1, encodingList);
    setGridStyle(configTable);
    topPanel.setWidget(3, 0, configTable);
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) Button(com.google.gwt.user.client.ui.Button) Grid(com.google.gwt.user.client.ui.Grid) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) HTMLTable(com.google.gwt.user.client.ui.HTMLTable)

Example 58 with ChangeEvent

use of com.google.gwt.event.dom.client.ChangeEvent 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)

Aggregations

ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)58 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)58 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)31 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)31 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)31 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)28 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)27 ArrayList (java.util.ArrayList)21 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)20 PerunError (cz.metacentrum.perun.webgui.model.PerunError)16 ListBoxWithObjects (cz.metacentrum.perun.webgui.widgets.ListBoxWithObjects)15 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)13 HashMap (java.util.HashMap)10 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)8 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)8 Map (java.util.Map)7 GetVos (cz.metacentrum.perun.webgui.json.vosManager.GetVos)6 VirtualOrganization (cz.metacentrum.perun.webgui.model.VirtualOrganization)6 SetNewAttributeTabItem (cz.metacentrum.perun.webgui.tabs.attributestabs.SetNewAttributeTabItem)6 ListBox (com.google.gwt.user.client.ui.ListBox)5