本文整理汇总了Java中com.google.gwt.event.logical.shared.ValueChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java ValueChangeEvent类的具体用法?Java ValueChangeEvent怎么用?Java ValueChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueChangeEvent类属于com.google.gwt.event.logical.shared包,在下文中一共展示了ValueChangeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setValue
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
/**
* Checks or unchecks the text box, firing {@link ValueChangeEvent} if appropriate.
* <p/>
* Note that this <em>does not</em> set the value property of the AccessibleCheckBox input element wrapped by this widget. For access to that property, see
* {@link #setFormValue(String)}
*
* @param value true to check, false to uncheck; must not be null
* @param fireEvents If true, and value has changed, fire a {@link ValueChangeEvent}
* @throws IllegalArgumentException if value is null
*/
@Override
public void setValue(Boolean value, boolean fireEvents) {
if (value == null) {
throw new IllegalArgumentException("value must not be null");
}
Boolean oldValue = getValue();
inputElem.setChecked(value);
inputElem.setDefaultChecked(value);
if (value.equals(oldValue)) {
return;
}
if (fireEvents) {
ValueChangeEvent.fire(this, value);
}
}
示例2: initializeWMTSFields
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public void initializeWMTSFields() {
urlWMTSField.setEmptyText("http://...");
nameWMTSField.setEmptyText(UIMessages.INSTANCE
.lrasterdLayerNameField("WMTS"));
formatWMTSField.setEmptyText("image/png, image/jpg...");
tileMatrixSetField.setEmptyText("matrix set identifier");
urlWMTSField.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
if (!event.getValue().startsWith("http")) {
showAlert("URL");
}
}
});
}
示例3: setInstructors
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public void setInstructors(List<InstructorInterface> instructors) {
iInstructors.clearTable(1);
iInstructors.resetVisibility();
iHeader.clearMessage();
ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
iHeader.clearMessage();
}
};
if (instructors != null)
for (InstructorInterface i: instructors) {
int row = iInstructors.addInstructor(i);
boolean selected = i.hasAttribute(iAttribute.getId());
iInstructors.selectInstructor(row, selected);
iInstructors.setSelected(row, selected);
iInstructors.getInstructorSelection(row).addValueChangeHandler(clearErrorMessage);
}
int sort = InstructorCookie.getInstance().getSortInstructorsBy();
if (sort != 0)
iInstructors.setSortBy(sort);
iInstructors.setVisible(iInstructors.getRowCount() > 1);
}
示例4: getFoot
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
private VerticalPanel getFoot() {
slider.setWidth("290px");
slider.disable();
slider.setIncrement(1);
slider.addValueChangeHandler(new ValueChangeHandler<Integer>() {
@Override
public void onValueChange(final ValueChangeEvent<Integer> event) {
final Layer layer = getSelectedLayer(getSelectedTabName());
layer.setOpacity((float) (event.getValue().intValue() / 100.0));
}
});
final VerticalPanel panel = new VerticalPanel();
panel.setWidth("300px");
panel.addStyleName(ThemeStyles.get().style().borderTop());
panel.add(new HTML(UIMessages.INSTANCE.lmOpacityHtmlLabel()));
panel.add(slider);
panel.add(statusBar);
return panel;
}
示例5: Item
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
Item(T id, String name, boolean asHTML) {
super(name, asHTML);
iId = id;
addStyleName("item");
addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
ValueChangeEvent.fire(MultiSelect.this, MultiSelect.this.getValue());
}
});
}
示例6: onChange
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
private void onChange(ValueChangeEvent<String> event) {
Integer travel = null;
try {
if (!event.getValue().isEmpty())
travel = Integer.valueOf(event.getValue());
} catch (Exception e) {}
iR1.setTravelTime(iR2, travel);
if (travel != null) {
if (iDefault) {
iDefault = false;
removeStyleName("default");
}
} else {
Integer distance = iR1.getDistance(iR2.getId());
if (distance != null) {
setValue(distance.toString());
iDefault = true;
addStyleName("default");
}
}
}
示例7: setRooms
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public void setRooms(List<Entity> rooms) {
iRooms.clearTable(1);
iHeader.clearMessage();
ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
iHeader.clearMessage();
}
};
for (Entity e: rooms) {
RoomDetailInterface room = (RoomDetailInterface)e;
int row = iRooms.addRoom(room);
boolean selected = room.hasGroup(iGroup.getId());
iRooms.selectRoom(row, selected);
iRooms.setSelected(row, selected);
iRooms.getRoomSelection(row).addValueChangeHandler(clearErrorMessage);
}
int sort = RoomCookie.getInstance().getRoomsSortBy();
if (sort != 0)
iRooms.setSortBy(sort);
}
示例8: setRooms
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public void setRooms(List<Entity> rooms) {
iRooms.clearTable(1);
iHeader.clearMessage();
ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
iHeader.clearMessage();
}
};
for (Entity e: rooms) {
RoomDetailInterface room = (RoomDetailInterface)e;
int row = iRooms.addRoom(room);
boolean selected = room.hasFeature(iFeature.getId());
iRooms.selectRoom(row, selected);
iRooms.setSelected(row, selected);
iRooms.getRoomSelection(row).addValueChangeHandler(clearErrorMessage);
}
int sort = RoomCookie.getInstance().getRoomsSortBy();
if (sort != 0)
iRooms.setSortBy(sort);
}
示例9: setRooms
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public void setRooms(List<Entity> rooms, Integer sortBy) {
iRooms.clearTable(1);
iHeader.clearMessage();
ValueChangeHandler<Boolean> clearErrorMessage = new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
iHeader.clearMessage();
}
};
for (Entity e: rooms) {
RoomDetailInterface room = (RoomDetailInterface)e;
int row = iRooms.addRoom(room);
boolean selected = false;
if (iDepartment != null) {
selected = (room.getDepartment(iDepartment.getId()) != null);
} else if (iExamType != null) {
selected = (room.getExamType(iExamType.getId()) != null);
}
iRooms.selectRoom(row, selected);
iRooms.setSelected(row, selected);
iRooms.getRoomSelection(row).addValueChangeHandler(clearErrorMessage);
}
if (sortBy != null)
iRooms.setSortBy(sortBy);
}
示例10: PeriodPreferencesWidget
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public PeriodPreferencesWidget(boolean editable) {
iEditable = editable;
iPanel = new AbsolutePanel();
iHorizontal = new CheckBox(MESSAGES.periodPreferenceHorizontal());
iHorizontal.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
RoomCookie.getInstance().setHorizontal(iHorizontal.getValue());
render();
}
});
initWidget(iPanel);
}
示例11: setValue
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
@Override
public void setValue(final Integer value, boolean fireEvents) {
iValue = value;
if (value != null && value.intValue() != 0) {
final int column = (value > 0 ? value - 1 : -value - 1);
final UniTimeTableHeader h = getHeader(column);
if (h != null)
sort(h, new Comparator<TableInterface.TableRowInterface>() {
@Override
public int compare(TableInterface.TableRowInterface r1, TableInterface.TableRowInterface r2) {
return r1.compareTo(r2, column, true);
}
}, value > 0);
}
if (fireEvents)
ValueChangeEvent.fire(this, getValue());
}
示例12: PageFilter
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public PageFilter() {
addStyleName("unitime-PageFilter");
iHeader = new UniTimeHeaderPanel(MESSAGES.sectFilter());
iHeader.setCollapsible(true);
iHeader.addCollapsibleHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
for (int row: iCollapsibleRows) {
getRowFormatter().setVisible(row, event.getValue());
}
}
});
iFilterHeaderRow = addHeaderRow(iHeader);
iFilterLastRow = iFilterHeaderRow;
iFooter = iHeader.clonePanel(null);
}
示例13: initAppDesc
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
/**
* Helper method called by constructor to initialize the app's description
* @param c1 The container that description resides (editable state)
* @param c2 The container that description resides (public state)
*/
private void initAppDesc(Panel c1, Panel c2) {
desc.getElement().setPropertyString("placeholder", MESSAGES.galleryDescriptionHint());
if (newOrUpdateApp()) {
desc.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
app.setDescription(desc.getText());
}
});
if(editStatus==UPDATEAPP){
desc.setText(app.getDescription());
}
desc.addStyleName("app-desc-textarea");
c1.add(desc);
} else {
Label description = new Label(app.getDescription());
c2.add(description);
c2.addStyleName("app-description");
}
}
示例14: addChip
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
@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());
}
示例15: insert
import com.google.gwt.event.logical.shared.ValueChangeEvent; //导入依赖的package包/类
public static AriaSuggestBox insert(RootPanel panel) {
String config = panel.getElement().getAttribute("configuration");
final String onchange = panel.getElement().getAttribute("onchange");
AriaTextBox text = new AriaTextBox(panel.getElement().getFirstChildElement());
text.getElement().setAttribute("autocomplete", "off");
AriaSuggestBox box = new AriaSuggestBox(text, new CourseNumbersSuggestBox(config));
if (onchange != null)
box.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
ToolBox.eval(onchange);
}
});
panel.add(box);
return box;
}