@UiHandler("daysOfWeek") protected void onChange(ChangeEvent event) { if (presenter != null) { MListBox source = (MListBox) event.getSource(); presenter.onDayOfWeekSelected(source.getSelectedIndex()); } }
public void onChange(ChangeEvent event) { Object source = event.getSource(); if (source == sortMode) { int i = sortMode.getSelectedIndex(); app.getSettings().getAlgebra().setTreeMode(supportedModes.get(i).ordinal()); } }
@Override public void onChange(ChangeEvent event) { Widget sender = (Widget) event.getSource(); if (sender == wbConfigTextBox) { enableSubmitButton(); } }
public void onChange(ChangeEvent event) { Widget sender = (Widget) event.getSource(); if (sender == tbS1) { countCharacters(3, tbS1); } else if (sender == tbS2) { countCharacters(4, tbS2); } }
@Override public final void onChange(ChangeEvent changeEvent) { updateValue(changeEvent.getSource()); validate(); if (getState() != State.Initial) { setState(validate() ? State.Valid : State.Invalid); } }
public void onChange(ChangeEvent event) { Object sender = event.getSource(); if (sender == instances) { updateBosses(); } else if (sender == roles) { addRole(roles.getItemText(roles.getSelectedIndex())); } else if (sender == badges) { addBadge(badges.getItemText(badges.getSelectedIndex())); } }
@Override public HandlerRegistration addValueChangeHandler(ValueChangeHandler<List<M>> handler) { if (!valueChangeHandlerInitialized) { valueChangeHandlerInitialized = true; addDomHandler( new ChangeHandler() { @Override public void onChange(ChangeEvent event) { ValueChangeEvent.fire(ListWidget.this, getValue()); } }, ChangeEvent.getType()); } return addHandler(handler, ValueChangeEvent.getType()); }
public InputWidget(String type) { super(DOM.createElement("input")); getElement().setAttribute("type", type); // fire a change event on change or blur addDomHandler( new ChangeHandler() { @Override public void onChange(ChangeEvent event) { fireValueChangeHandler(getValue()); } }, ChangeEvent.getType()); addBlurHandler( new BlurHandler() { @Override public void onBlur(BlurEvent event) { fireValueChangeHandler(getValue()); } }); }
@Override public HandlerRegistration addChangeHandler(final ChangeHandler handler) { if (!changeHandlerAdded) { changeHandlerAdded = true; this.codeMirror.on( this.editorOverlay, CHANGE, new EventHandlers.EventHandlerOneParameter<CMChangeEventOverlay>() { @Override public void onEvent(final CMChangeEventOverlay param) { LOG.fine( "Change event - state clean=" + editorOverlay.getDoc().isClean(getGenerationMarker()) + " (generation=" + getGenerationMarker() + ")."); fireChangeEvent(); } }); } return addHandler(handler, ChangeEvent.getType()); }
@Override public HandlerRegistration addChangeHandler(final ChangeHandler handler) { return handlerManager_.addHandler(ChangeEvent.getType(), handler); }
public HandlerRegistration addChangeHandler(ChangeHandler handler) { return addDomHandler(handler, ChangeEvent.getType()); }
public void onChange(ChangeEvent event) { Widget source = (Widget) event.getSource(); if (source == lbProjects) { txtProject.setValue(lbProjects.getItemText(lbProjects.getSelectedIndex())); } }
/** * Fired whenever something in this widget changes. * * <p>Subclasses that override this method must call <tt>super.onChange(sender)</tt> to ensure * that the Widget recieves its events. * * @param sender the widget that has changed. */ public void onChange(Widget sender) { if (sender == tbHexColor) { // Figure out colors // Color class will do bounds check on hex input try { Color color = new Color(); color.setHex(tbHexColor.getText()); tbHue.setText(Integer.toString(color.getHue())); tbSaturation.setText(Integer.toString(color.getSaturation())); tbBrightness.setText(Integer.toString(color.getValue())); tbRed.setText(Integer.toString(color.getRed())); tbGreen.setText(Integer.toString(color.getGreen())); tbBlue.setText(Integer.toString(color.getBlue())); tbHexColor.setText(color.getHex()); setPreview(color.getHex()); } catch (Exception e) { } } if (sender == tbRed || sender == tbGreen || sender == tbBlue) { // Don't allow this value to overflow or underflow try { if (Integer.parseInt(((TextBox) sender).getText()) > 255) { ((TextBox) sender).setText("255"); } if (Integer.parseInt(((TextBox) sender).getText()) < 0) { ((TextBox) sender).setText("0"); } } catch (Exception e) { } red = Integer.parseInt(tbRed.getText()); green = Integer.parseInt(tbGreen.getText()); blue = Integer.parseInt(tbBlue.getText()); hue = Integer.parseInt(tbHue.getText()); saturation = Integer.parseInt(tbSaturation.getText()); brightness = Integer.parseInt(tbBrightness.getText()); // Figure out the colors try { Color color = new Color(); color.setRGB(red, green, blue); tbHue.setText(Integer.toString(color.getHue())); tbSaturation.setText(Integer.toString(color.getSaturation())); tbBrightness.setText(Integer.toString(color.getValue())); tbHexColor.setText(color.getHex()); setPreview(color.getHex()); } catch (Exception e) { } } else if (sender == tbHue || sender == tbSaturation || sender == tbBrightness) { // Don't allow this value to overflow try { if (Integer.parseInt(tbHue.getText()) > 359) { tbHue.setText("359"); } if (Integer.parseInt(tbSaturation.getText()) > 100) { tbSaturation.setText("100"); } if (Integer.parseInt(tbBrightness.getText()) > 100) { tbBrightness.setText("100"); } } catch (Exception e) { } red = Integer.parseInt(tbRed.getText()); green = Integer.parseInt(tbGreen.getText()); blue = Integer.parseInt(tbBlue.getText()); hue = Integer.parseInt(tbHue.getText()); saturation = Integer.parseInt(tbSaturation.getText()); brightness = Integer.parseInt(tbBrightness.getText()); // Figure out colors try { Color color = new Color(); color.setHSV(hue, saturation, brightness); tbRed.setText(Integer.toString(color.getRed())); tbGreen.setText(Integer.toString(color.getGreen())); tbBlue.setText(Integer.toString(color.getBlue())); tbHexColor.setText(color.getHex()); setPreview(color.getHex()); } catch (Exception e) { } } // Let the sliders know something's changed updateSliders(); ChangeEvent.fireNativeEvent(Document.get().createChangeEvent(), this); }
/* * (non-Javadoc) * @see com.google.gwt.event.dom.client.ChangeHandler#onChange(com.google.gwt.event.dom.client.ChangeEvent) */ public void onChange(ChangeEvent event) { onChange((Widget) event.getSource()); }