本文整理汇总了Java中com.google.gwt.event.shared.GwtEvent.getSource方法的典型用法代码示例。如果您正苦于以下问题:Java GwtEvent.getSource方法的具体用法?Java GwtEvent.getSource怎么用?Java GwtEvent.getSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.event.shared.GwtEvent
的用法示例。
在下文中一共展示了GwtEvent.getSource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: itemStateChanged
import com.google.gwt.event.shared.GwtEvent; //导入方法依赖的package包/类
public void itemStateChanged(GwtEvent e) {
Object src = e.getSource();
int i;
boolean changed = false;
for (i = 0; i != einfocount; i++) {
EditInfo ei = einfos[i];
if (ei.choice == src || ei.checkbox == src || ei.button == src) {
// if we're pressing a button, make sure to apply changes first
if (ei.button == src)
apply();
elm.setEditValue(i, ei);
if (ei.newDialog)
changed = true;
cframe.needAnalyze();
}
}
if (changed) {
clearDialog();
buildDialog();
}
}
示例2: on
import com.google.gwt.event.shared.GwtEvent; //导入方法依赖的package包/类
private void on(GwtEvent<?> e) {
if (widget.isEnabled()
|| !(e.getSource() instanceof FocusWidget)
|| !((FocusWidget) e.getSource()).isEnabled()) {
if (e.getSource() instanceof ValueBoxBase) {
final TextBoxBase box = ((TextBoxBase) e.getSource());
Scheduler.get()
.scheduleDeferred(
new ScheduledCommand() {
@Override
public void execute() {
if (box.getValue().trim().equals(originalValue)) {
widget.setEnabled(false);
}
}
});
}
return;
}
if (e.getSource() instanceof TextBoxBase) {
onTextBoxBase((TextBoxBase) e.getSource());
} else {
// For many widgets, we can assume that a change is an edit. If
// a widget does not work that way, it should be special cased
// above.
widget.setEnabled(true);
}
}
示例3: PressEvent
import com.google.gwt.event.shared.GwtEvent; //导入方法依赖的package包/类
public PressEvent(GwtEvent<? extends EventHandler> sourceEvent) {
time = new Date().getTime();
source = (Widget)sourceEvent.getSource();
}