当前位置: 首页>>代码示例>>Java>>正文


Java Listen类代码示例

本文整理汇总了Java中org.zkoss.zk.ui.select.annotation.Listen的典型用法代码示例。如果您正苦于以下问题:Java Listen类的具体用法?Java Listen怎么用?Java Listen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Listen类属于org.zkoss.zk.ui.select.annotation包,在下文中一共展示了Listen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: btnCreate_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #btnCreate")
public void btnCreate_onClick() {
	if (scanForNulls()) {
		return;
	}
	// get values
	Entry e = new Entry();
	
	for(Component c : fieldList) {
		IField<?> f = (IField<?>) c;
		if (f.getDBValue().getValue() != null && !f.isDisplayOnly())
			e.getValues().add(f.getDBValue());
	}
	// if no user values
	if (e.getValues().size() == 0)
		return;
	// create new entry
	try {
		db.insertEntry(e);
		clearAllFields(detailsView);
	} catch (DatabaseOperationException e1) {
		Messagebox.show("Unable to create entry");
		e1.printStackTrace();
	}
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:26,代码来源:SearchComposer.java

示例2: tbbNewForm_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #tbbNewForm")
public void tbbNewForm_onClick() {
	TableTreeNode table = modelTree.getSelectedTable();
	if (table == null) {
		Messagebox.show("Select a table first.", "Error", Messagebox.OK,
				Messagebox.EXCLAMATION);
		return;
	}
	if (currentForm != null) {
		Messagebox.show("Close form before creating the new one.");
	}
	if (currentForm == null) {
		currentForm = new Form();
		currentForm.setDBConnection(table.getConnection());
		currentForm.setName("New untitled form");
		currentForm.setTitle("Untitled Form");
		currentForm.setTableName(table.getTable().getName());
		currentForm.setCatalog(table.getTable().getCatalog());
		currentForm.setView("");
		currentForm.setJoin(false); // regular form
		setDefaultResultList(currentForm);
		checkStudioStates();
	}
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:25,代码来源:BuilderComposer.java

示例3: tbbNewSearchMenu_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的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();
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:18,代码来源:BuilderComposer.java

示例4: tbbCloseForm_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #tbbCloseForm")
public void tbbCloseForm_onClick() {
	if (currentForm == null)
		return;
	if (designerCanvas.isCanvasDirty()) {
		Messagebox.show("Do you want to save changes?", "Save changes", 
				Messagebox.YES | Messagebox.NO | Messagebox.CANCEL, 
				Messagebox.QUESTION, new EventListener<Event>() {

					@Override
					public void onEvent(Event evnt) throws Exception {
						if (Messagebox.ON_YES.equals(evnt.getName())) {
							saveForm();
							closeForm();
						} else if (Messagebox.ON_NO.equals(evnt.getName())) {
							closeForm();
						}
					}
		});
	} else {
		closeForm();
	}
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:24,代码来源:BuilderComposer.java

示例5: lstUsers_onSelect

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onSelect = #lstUsers")
public void lstUsers_onSelect() throws SQLException {
	if (isUserDirty) {
		Messagebox.show("User was modified. Save changes?", "User", 
				Messagebox.YES | Messagebox.NO
				, Messagebox.QUESTION, new EventListener<Event>() {

					@Override
					public void onEvent(Event e) throws Exception {
						if(Messagebox.ON_YES.equals(e.getName())){
							UpdateUser();
							userSelected();
						}else if(Messagebox.ON_NO.equals(e.getName())){
							userSelected();
						}
					}				
		});
		return;
	} else {
		userSelected();
	}
	
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:24,代码来源:AdministrationConsoleComposer.java

示例6: lstRoles_onSelect

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onSelect = #lstRoles")
public void lstRoles_onSelect() {
	if (isRoleDirty) {
		Messagebox.show("Role was modified. Save changes?", "Role", 
				Messagebox.YES | Messagebox.NO
				, Messagebox.QUESTION, new EventListener<Event>() {

					@Override
					public void onEvent(Event e) throws Exception {
						if(Messagebox.ON_YES.equals(e.getName())){
							UpdateRole();
							roleSelected();
						}else if(Messagebox.ON_NO.equals(e.getName())){
							roleSelected();
						}
					}
		});
		return;
	} else {
		roleSelected();
	}
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:23,代码来源:AdministrationConsoleComposer.java

示例7: btnChangeRoles_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的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();
	}
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:23,代码来源:AdministrationConsoleComposer.java

示例8: btnDeleteUser_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #btnDeleteUser")
public void btnDeleteUser_onClick() {
	if (selectedUser == null)
		return;

	Messagebox.show("You are shure, that you want to delete user?", "User delete", 
			Messagebox.YES | Messagebox.NO
			, Messagebox.QUESTION, new EventListener<Event>() {

		@Override
		public void onEvent(Event e) throws Exception {
			if(Messagebox.ON_YES.equals(e.getName())){
				ConfigLoader.getInstance().getUsers().delete(selectedUser);
				selectedUser = null;
				refreshUserList();
			}
		}
	});
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:20,代码来源:AdministrationConsoleComposer.java

示例9: btnDeleteRole_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #btnDeleteRole")
public void btnDeleteRole_onClick() {
	if (selectedRole == null)
		return;
	
	Messagebox.show("You are shure, that you want to delete role?", "Role delete", 
			Messagebox.YES | Messagebox.NO
			, Messagebox.QUESTION, new EventListener<Event>() {

		@Override
		public void onEvent(Event e) throws Exception {
			if(Messagebox.ON_YES.equals(e.getName())){
				ConfigLoader.getInstance().getRoles().delete(selectedRole);
				selectedRole = null;
				refreshRoleList();
			}
		}
	});
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:20,代码来源:AdministrationConsoleComposer.java

示例10: btnAddRole_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的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();
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:25,代码来源:AdministrationConsoleComposer.java

示例11: btnAddUser_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的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();
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:23,代码来源:AdministrationConsoleComposer.java

示例12: btnSelectForm_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的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();
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:20,代码来源:SearchMenuProperties.java

示例13: btnSelectForm_onClick

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的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();
}
 
开发者ID:sinnlabs,项目名称:dbvim,代码行数:20,代码来源:TableFieldProperties.java

示例14: importTransactions

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick=#importBtn")
public void importTransactions(Event event) throws Exception {
	auditLogger.log(IMPORT_TRANSACTIONS, user);
	ListModel<Cost> result = costGrid.getModel();
	if (result != null) {
		Cost kost = null;

		for (int i = 0; i < result.getSize(); i++) {
			kost = (Cost) result.getElementAt(i);
			if (!kost.getCostType().equals(EXPENSE_OTHER_ACCOUNT_IGNORE)) {
				kost.setUser(user);
				costDao.persistEntity(kost);
			}
		}
	}
	clearMatchListAfterImporting();
}
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:18,代码来源:VatViewCtrl.java

示例15: createEvent

import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onEventCreate = #calendars; onEventEdit = #calendars")
public void createEvent(CalendarsEvent event) {
	calendarsEvent = event;

	// to display a shadow when editing
	calendarsEvent.stopClearGhost();

	BusinessCalendarEvent data = (BusinessCalendarEvent) event.getCalendarEvent();

	if (data == null) {
		data = new BusinessCalendarEvent();
		data.setHeaderColor("#3366ff");
		data.setContentColor("#6699ff");
		data.setBeginDate(event.getBeginDate());
		data.setEndDate(event.getEndDate());
	} else {
		data = (BusinessCalendarEvent) event.getCalendarEvent();
	}
	// notify the editor
	QueueUtil.lookupQueue().publish(

	new QueueMessage(QueueMessage.Type.EDIT, data));
}
 
开发者ID:beemsoft,项目名称:techytax-zk,代码行数:24,代码来源:CalendarController.java


注:本文中的org.zkoss.zk.ui.select.annotation.Listen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。