Java Code Examples for com.google.gwt.event.logical.shared.ValueChangeEvent#fire()

The following examples show how to use com.google.gwt.event.logical.shared.ValueChangeEvent#fire() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: unitime   File: FilterBox.java    License: Apache License 2.0 6 votes vote down vote up
private SuggestionMenuItem(final Suggestion suggestion) {
	super(suggestion.getDisplayString() == null
			? suggestion.getChip().getLabel() + " <span class='item-command'>" + suggestion.getChip().getTranslatedCommand() + "</span>"
			: SafeHtmlUtils.htmlEscape(suggestion.getDisplayString()) + (suggestion.getHint() == null ? "" : " " + suggestion.getHint()),
		true,
		new Command() {
			@Override
			public void execute() {
				hideSuggestions();
				setStatus(ARIA.suggestionSelected(suggestion.toAriaString(FilterBox.this)));
				applySuggestion(suggestion);
				iLastValue = getValue();
				setAriaLabel(toAriaString());
				fireSelectionEvent(suggestion);
				ValueChangeEvent.fire(FilterBox.this, getValue());
			}
		});
	setStyleName("item");
	getElement().setAttribute("whiteSpace", "nowrap");
	iSuggestion = suggestion;
}
 
Example 2
Source Project: gwt-jackson   File: InputCheckbox.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void setValue( Boolean value, boolean fireEvents ) {
    if ( value == null ) {
        value = Boolean.FALSE;
    }

    Boolean oldValue = getValue();
    inputElem.setChecked( value );
    inputElem.setDefaultChecked( value );
    if ( value.equals( oldValue ) ) {
        return;
    }
    if ( fireEvents ) {
        ValueChangeEvent.fire( this, value );
    }
}
 
Example 3
Source Project: unitime   File: CourseRequestBox.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void addChip(Chip chip, boolean fireEvents) {
	final ChipPanel panel = new ChipPanel(chip, getChipColor(chip));
	panel.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			remove(panel);
			resizeFilterIfNeeded();
			setAriaLabel(toAriaString());
			ValueChangeEvent.fire(CourseRequestFilterBox.this, getValue());
		}
	});
	insert(panel, getWidgetIndex(iFilterFinder));
	resizeFilterIfNeeded();
	setAriaLabel(toAriaString());
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 4
Source Project: unitime   File: CourseFinderDialog.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(final RequestedCourse value, boolean fireEvents) {
	iFilter.setValue(value == null ? "" : value.toString(CONSTANTS), false);
	iLastFilter = iFilter.getValue();
	if (fireEvents)
		ValueChangeEvent.fire(this, value);
}
 
Example 5
Source Project: unitime   File: PeriodPreferencesWidget.java    License: Apache License 2.0 5 votes vote down vote up
public void setOption(PreferenceInterface preference) {
	if (!isEditable() || iPeriod == null) return;
	iModel.setPreference(iDay, iSlot, preference);
	if (preference == null) {
		getElement().getStyle().clearBackgroundColor();
		setTitle("");
	} else {
		getElement().getStyle().setBackgroundColor(preference.getColor());
		setTitle(DateTimeFormat.getFormat(CONSTANTS.examPeriodDateFormat()).format(iDate) + " " + slot2short(iSlot) + " - " + slot2short(iSlot + iPeriod.getLength()) + ": " + preference.getName());
	}
	ValueChangeEvent.fire(PeriodPreferencesWidget.this, getValue());
}
 
Example 6
/** {@inheritDoc} */
@Override
public void setValue(final Date value, final boolean fireEvents) {
    errorHandlerMixin.clearErrors();
    textBox.setValue(value != null ? dateTimeFormat.format(value) : null);
    update(textBox.getElement());

    if (fireEvents) {
        ValueChangeEvent.fire(DatePickerBase.this, value);
    }
}
 
Example 7
Source Project: unitime   File: EventMeetingTable.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(List<EventMeetingRow> value, boolean fireEvents) {
	clearTable(1);
	resetColumnVisibility();
	if (value != null)
		for (EventMeetingRow row: value)
			add(row);
	sort();
	if (fireEvents)
		ValueChangeEvent.fire(this, value);
}
 
Example 8
Source Project: unitime   File: MobilePageLabelImpl.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(PageNameInterface value, boolean fireEvents) {
	iUrl = value.getHelpUrl();
	iHelp.setVisible(iUrl != null && !iUrl.isEmpty());
	setText(value.getName());
	if (fireEvents)
		ValueChangeEvent.fire(this, value);
}
 
Example 9
Source Project: unitime   File: InstructorDetails.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(Integer value, boolean fireEvents) {
	if (value == null) {
		int row = iRequestsTable.getSelectedRow();
		if (row >= 0) iRequestsTable.setSelected(row, false);
	} else {
		iRequestsTable.setSelected(value + 1, true);
	}
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 10
Source Project: unitime   File: MultiSelect.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(List<T> value, boolean fireEvents) {
	for (Item item: iItems)
		item.setValue(value.contains(item.getId()));
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 11
Source Project: unitime   File: OpenCloseSectionImage.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(Boolean value, boolean fireEvents) {
	if (value == null) return;
	iValue = value;
	setResource(iValue ? RESOURCES.treeOpen() : RESOURCES.treeClosed());
	if (fireEvents)
		ValueChangeEvent.fire(this, iValue);
}
 
Example 12
Source Project: unitime   File: SingleDateSelector.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void setValue(Date value, boolean fireEvents) {
	if (value == null) {
		iPicker.setText("");
		iMonth.setValue(null);
	} else {
		iPicker.setText(iFormat.format(value));
		iMonth.setValue(value);
	}
	if (fireEvents)
		ValueChangeEvent.fire(this, value);
}
 
Example 13
Source Project: unitime   File: RoomSharingWidget.java    License: Apache License 2.0 5 votes vote down vote up
public void setOption(RoomSharingOption option) {
	if (!isEditable(iDay, iSlot)) return;
	iModel.setOption(iDay, iSlot, iMode.getStep(), option);
	if (option == null) {
		getElement().getStyle().clearBackgroundColor();
		setHTML("");
		setTitle("");
	} else {
		getElement().getStyle().setBackgroundColor(option.getColor());
		setHTML(option.getCode() == null ? "" : option.getCode());
		setTitle(CONSTANTS.longDays()[iDay] + " " + slot2short(iSlot) + " - " + slot2short(iSlot + iMode.getStep()) + ": " + option.getName());
	}
	ValueChangeEvent.fire(RoomSharingWidget.this, getValue());
}
 
Example 14
Source Project: unitime   File: PeriodPreferencesWidget.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setValue(PeriodPreferenceModel value, boolean fireEvents) {
	setModel(value);
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 15
Source Project: unitime   File: FreeTimePicker.java    License: Apache License 2.0 4 votes vote down vote up
private void processMouseEvent(int eventType, int day, int period) {
	if (!isEnabled()) return;
    switch (eventType) {
	case Event.ONMOUSEDOWN:
		iDownDay = day; iDownPeriod = period; iOverDay = day; iOverPeriod = period;
		break;
	case Event.ONMOUSEUP:
		if (iDownDay>=0 && iOverDay>=0) {
			int d0 = (iDownDay < iOverDay ? iDownDay : iOverDay);
			int d1 = (iDownDay < iOverDay ? iOverDay : iDownDay);
			int p0 = (iDownPeriod < iOverPeriod ? iDownPeriod : iOverPeriod);
			int p1 = (iDownPeriod < iOverPeriod ? iOverPeriod : iDownPeriod);
			boolean allSelected = true;
			boolean mwfDown = (iDownDay % 2 == 0);
			all: for (int d=d0; d<=d1; d++) {
				if (d1 - d0 <= 0 || (d % 2 == 0) == mwfDown) {
					for (int p=p0; p<=p1; p++)
						if (!iSelected[d][p]) {
							allSelected = false; break all;
						}
				}
			}
			long ts = iTime++;
			for (int d=d0; d<=d1; d++) {
				if (d1 - d0 <= 1 || (d % 2 == 0) == mwfDown) {
					for (int p=p0; p<=p1; p++) {
						iSelected[d][p] = !allSelected;
						iLastSelectedTime[d][p] = ts;
					}
				}
			}
		}
		iDownDay = -1; iDownPeriod = -1; iOverDay = -1; iOverPeriod = -1;
		generatePriorities();
		ValueChangeEvent.fire(this, getValue());
		break;
	case Event.ONMOUSEOVER:
		iOverDay = day; iOverPeriod = period;
		break;
	case Event.ONMOUSEOUT:
		iOverDay = -1; iOverPeriod = -1;
		break;
	}
	update();
}
 
Example 16
protected void setTime(Date start, Date end) {
  this.start = start;
  this.end = end;
  ValueChangeEvent.fire(config, config);
}
 
Example 17
@Override
public void onItemClick(T item) {
	this.selectedItem = item;
	ValueChangeEvent.fire(InputSwitch.this, this.selectedItem);
	InputSwitch.this.resetSlider(item);
}
 
Example 18
Source Project: unitime   File: UniTimeFilterBox.java    License: Apache License 2.0 4 votes vote down vote up
protected void fireValueChangeEvent() {
	ValueChangeEvent.fire(iFilter.getWidget(), iFilter.getWidget().getValue());
}
 
Example 19
Source Project: unitime   File: RoomSharingWidget.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void setValue(RoomSharingModel value, boolean fireEvents) {
	setModel(value);
	if (fireEvents)
		ValueChangeEvent.fire(this, getValue());
}
 
Example 20
Source Project: gwtbootstrap3-extras   File: SliderBase.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Fires a {@link ValueChangeEvent} event.
 *
 * @param value the new slide value
 */
protected void fireChangeEvent(final T value) {
    ValueChangeEvent.fire(this, value);
}