本文整理汇总了Java中org.zkoss.zk.ui.event.Event.getData方法的典型用法代码示例。如果您正苦于以下问题:Java Event.getData方法的具体用法?Java Event.getData怎么用?Java Event.getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.zkoss.zk.ui.event.Event
的用法示例。
在下文中一共展示了Event.getData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEditPlayer
import org.zkoss.zk.ui.event.Event; //导入方法依赖的package包/类
public void onEditPlayer(Event e){
Player oldPlayer = (Player) e.getData();
if(Executions.getCurrent().getBrowser("mobile") !=null || Executions.getCurrent().getUserAgent().indexOf("Phone")!=-1){
execution.setAttribute("oldPlayer", oldPlayer);
Executions.sendRedirect("/pages/add_player_mobile.zul");
} else {
Map<String, Object> map = new HashMap<String, Object>();
map.put("oldPlayer", oldPlayer);
Window window = (Window) Executions.createComponents("add_player.zul", null, map);
window.doModal();
}
onPlayerChange();
page.removeAttribute("oldPlayer");
}
示例2: onEditGame
import org.zkoss.zk.ui.event.Event; //导入方法依赖的package包/类
public void onEditGame(Event e){
Game game = (Game) e.getData();
if(game != null) {
Tournament tournament = (Tournament) session.getAttribute("tournament");
round.challenges.add(game);
tournament.roundsList.remove(round);
List<Player> toMatch = new ArrayList<Player>();
toMatch.addAll(tournament.players);
for(Game g : round.challenges){
toMatch.remove(g.player1);
toMatch.remove(g.player2);
}
round = MatchingUtils.doSingleMatch(tournament.rounds, tournament.roundsList, toMatch, round.challenges);
tournament.roundsList.add(round);
}
gridRound.setModel(new SimpleListModel<Game>(round.games));
gridRound.renderAll();
gridRound.invalidate();
binder.loadAll();
}
示例3: mostrarPropiedadesElemento
import org.zkoss.zk.ui.event.Event; //导入方法依赖的package包/类
/**
* Seleccion elemento en iframe.
*
* @param event
* Par�metro event
*/
public final void onSelect$iframeContenedorHTML(final Event event) {
final Event origin = ((ForwardEvent) event).getOrigin();
final String id = (String) origin.getData();
mostrarPropiedadesElemento(id) ;
}
示例4: onEvent
import org.zkoss.zk.ui.event.Event; //导入方法依赖的package包/类
@Override
public void onEvent(Event event) {
List<DataTableSelection> coords = new ArrayList<>();
Object data = event.getData();
if (data instanceof Object[]) {
coords.addAll(getCoordinates((Object[]) data));
} else {
coords.add(getCoordinates(data));
}
Events.sendEvent(new DataTableSelectionEvent(eventName, event.getTarget(), coords));
}
示例5: onDeletePlayer
import org.zkoss.zk.ui.event.Event; //导入方法依赖的package包/类
public void onDeletePlayer(Event e){
Player p = (Player) e.getData();
Tournament tournament = (Tournament) session.getAttribute("tournament");
tournament.players.remove(p);
tournament.playersCount--;
session.setAttribute("tournament", tournament);
playersList.renderAll();
binder.loadAll();
}