本文整理汇总了Java中org.zkoss.zk.ui.event.Events类的典型用法代码示例。如果您正苦于以下问题:Java Events类的具体用法?Java Events怎么用?Java Events使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Events类属于org.zkoss.zk.ui.event包,在下文中一共展示了Events类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doAfterCompose
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Override
public final void doAfterCompose(final Component compEntorno) {
super.doAfterCompose(compEntorno);
padre = compEntorno.getParent();
usuarioLogado = ConsolaUtil.recuperarUsuarioLogado();
treeUA.setItemRenderer(new UnidadAdministrativaItemRenderer());
treeUA.setModel(createModelUA());
treeUA.addEventListener(Events.ON_DOUBLE_CLICK,
new EventListener() {
public void onEvent(final Event pEvent) {
onClick$btnAceptar();
}
});
}
示例2: Event
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
/**
* M�todo para On click$btn aceptar de la clase EntornoWModal.
*/
public final void onClick$btnAceptar() {
if (treeUA.getSelectedItem() == null ) {
mostrarMessageBox(Labels.getLabel("error.noSeleccion"),
Labels.getLabel(ConstantesWEB.INFO), Messagebox.OK,
Messagebox.EXCLAMATION);
return;
}
UnidadAdministrativa value = (UnidadAdministrativa) ((DefaultTreeNode) treeUA.getSelectedItem().getValue()).getData();
// Generamos evento de seleccion
final Event event = new Event(ConstantesZK.EVENTO_SELECCION_SELECTOR, padre,
new SeleccionSelector(ConstantesWEB.SELECTOR_UNIDAD_ADMINISTRATIVA, value));
Events.postEvent(event);
wSelectorUnidadAdministrativa.detach();
}
示例3: confirmarBorrado
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
/**
* Muestra mensaje de confirmacion de borrado. En caso de aceptar lanza
* funcion confirmacionBorrado que deber� ser sobreescrita en la
* implementacion.
*
* @param obj
* Objeto a ser pasado a la funcion postConfirmarBorrado en caso
* de que se confirme el borrado (opcional). Por si se quiere
* pasar algo para particularizar funcionamiento
* postConfirmarBorrado.
*
*/
protected final void confirmarBorrado(final Object obj) {
mostrarMessageBox(Labels.getLabel("mensaje.confirmacionBorrado"),
Labels.getLabel("mensaje.atencion"), Messagebox.YES
+ Messagebox.NO, Messagebox.EXCLAMATION,
new EventListener() {
public void onEvent(final Event event) {
if (((Integer) event.getData()).intValue() == Messagebox.YES) {
// Invocamos evento confirmacion borrado
final Event ev = new Event(
ConstantesZK.EVENTO_POST_CONFIRMAR_BORRADO,
componentCompose, obj);
Events.postEvent(ev);
}
}
});
}
示例4: initFieldsMenu
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
/**
* Initialize field select menu
*/
private void initFieldsMenu() {
fieldsPopup = new Menupopup();
fieldsPopup.setStyle("overflow: auto; max-height: 100vh;");
detailsView.appendChild(fieldsPopup);
for (IField<?> c : fields) {
final ConditionFieldMenuitem i = new ConditionFieldMenuitem(c);
i.setLabel(c.getId() + " (" + c.getLabel() + ")");
/** Add item event listener **/
i.addEventListener(Events.ON_CLICK, new EventListener<MouseEvent>() {
@Override
public void onEvent(MouseEvent arg0) throws Exception {
txtAdditionalSearch.setText(txtAdditionalSearch.getText() +
"'" + i.getField().getId() + "'");
}
});
/** add item **/
fieldsPopup.appendChild(i);
}
}
示例5: tbbNewSearchMenu_onClick
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Listen("onClick = #tbbNewSearchMenu")
public void tbbNewSearchMenu_onClick() {
final SearchMenu menu = new SearchMenu();
final SearchMenuProperties dialog = new SearchMenuProperties(menu, true);
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedAction() == SearchMenuProperties.DD_OK) {
ConfigLoader.getInstance().getSearchMenus().create(menu);
}
}
});
designer.appendChild(dialog);
dialog.doModal();
}
示例6: formNameDialog
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
private void formNameDialog() {
final FormNameDialog dialog = new FormNameDialog(
currentForm.getName());
designer.appendChild(dialog);
dialog.addEventListener(Events.ON_CLOSE,
new EventListener<Event>() {
@Override
public void onEvent(Event evnt) throws Exception {
currentForm.setName(dialog.getName());
saveForm();
}
});
dialog.doModal();
}
示例7: btnChangeRoles_onClick
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Listen("onClick = #btnChangeRoles")
public void btnChangeRoles_onClick() throws SQLException {
if (selectedUser != null) {
final ChangeUserRoleDialog dialog = new ChangeUserRoleDialog(selectedUser);
wndMain.appendChild(dialog);
dialog.setHeight("50%");
dialog.setWidth("60%");
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedAction() == ChangeUserRoleDialog.DD_OK) {
refreshRoles();
}
}
});
dialog.doModal();
}
}
示例8: btnAddRole_onClick
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Listen("onClick = #btnAddRole")
public void btnAddRole_onClick() {
final AddRoleDialog dialog = new AddRoleDialog();
wndMain.appendChild(dialog);
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
// ok button clicked
if (dialog.getSelectedAction() == AddUserDialog.DD_OK) {
Role r = dialog.getRole();
// save new role
ConfigLoader.getInstance().getRoles().create(r);
// update UI
refreshRoleList();
}
}
});
dialog.setWidth("50%");
// show dialog window
dialog.doModal();
}
示例9: btnAddUser_onClick
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Listen("onClick = #btnAddUser")
public void btnAddUser_onClick() {
final AddUserDialog dialog = new AddUserDialog();
wndMain.appendChild(dialog);
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedAction() == AddUserDialog.DD_OK) {
User user = dialog.getUser();
// save new user
ConfigLoader.getInstance().getUsers().create(user);
// refresh UI
refreshUserList();
}
}
});
dialog.setWidth("50%");
dialog.doModal();
}
示例10: getSpecialProperty
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Override
public Component getSpecialProperty(final Component cmp, String name, IDeveloperStudio dev) {
Button edit = new Button("Edit");
final IDeveloperStudio developer = dev;
edit.addEventListener(Events.ON_CLICK, new EventListener<MouseEvent>() {
@Override
public void onEvent(MouseEvent arg0) throws Exception {
TableFieldProperties dialog = new TableFieldProperties((TableField)cmp);
developer.getDesigner().appendChild(dialog);
dialog.doModal();
}
});
return edit;
}
示例11: btnAddConnection_Click
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
private void btnAddConnection_Click() {
final AddConnectionDialog dialog = new AddConnectionDialog();
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedAction() == AddConnectionDialog.DD_OK) {
DBConnection conn = new DBConnection(dialog.getName(),
dialog.getConnectionString(), dialog.getClassName());
ConfigLoader.getInstance().getDBConnections().create(conn);
RefreshTree();
}
}
});
this.appendChild(dialog);
dialog.doModal();
}
示例12: btnSelectForm_onClick
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Listen("onClick = #btnSelectForm")
public void btnSelectForm_onClick() throws SQLException {
final SelectFormDialog dialog = new SelectFormDialog();
this.getParent().appendChild(dialog);
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedAction() == SelectFormDialog.DD_OK) {
form = dialog.getSelectedForm();
txtFormName.setText(form.getName());
}
}
});
dialog.doModal();
}
示例13: btnSelectForm_onClick
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Listen("onClick = #btnSelectForm")
public void btnSelectForm_onClick() throws SQLException {
final SelectFormDialog dialog = new SelectFormDialog();
this.appendChild(dialog);
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedForm() != null) {
txtFormName.setText(dialog.getSelectedForm().getName());
txtFormName_onChange();
}
}
});
dialog.doModal();
}
示例14: onEvent
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Override
public void onEvent(MouseEvent evnt) throws Exception {
Treeitem item = (Treeitem) evnt.getTarget();
final DBConnection dbc = (DBConnection) item.getValue();
final AddConnectionDialog dialog = new AddConnectionDialog(dbc);
developer.getDesigner().appendChild(dialog);
dialog.addEventListener(Events.ON_CLOSE, new EventListener<Event>() {
@Override
public void onEvent(Event arg0) throws Exception {
if (dialog.getSelectedAction() == AddConnectionDialog.DD_OK) {
dbc.setClassName(dialog.getClassName());
dbc.setConnectionString(dialog.getConnectionString());
ConfigLoader.getInstance().getDBConnections().update(dbc);
}
}
});
dialog.doModal();
}
示例15: render
import org.zkoss.zk.ui.event.Events; //导入依赖的package包/类
@Override
public void render(Row row, final Cost cost, int index) throws Exception {
row.appendChild(new Label(cost.getDescription()));
row.appendChild(new Label(DateHelper.getDate(cost.getDate())));
row.appendChild(new Label(AmountHelper.formatDecimal(cost.getAmount())));
row.appendChild(new Label(AmountHelper.formatDecimal(cost.getVat())));
row.appendChild(new Label(cost.getCostType().getOmschrijving()));
row.addEventListener(Events.ON_CLICK, new EventListener<Event>() {
public void onEvent(Event event) throws Exception {
Map<String, Object> arguments = new HashMap<>();
arguments.put("cost", cost);
String template = "edit-cost.zul";
Window window = (Window) Executions.createComponents(template, null, arguments);
window.doModal();
}
});
}