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();
}
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 →");
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);
}
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);
}
Aggregations