本文整理汇总了Java中org.zkoss.zk.ui.select.annotation.Listen类的典型用法代码示例。如果您正苦于以下问题:Java Listen类的具体用法?Java Listen怎么用?Java Listen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Listen类属于org.zkoss.zk.ui.select.annotation包,在下文中一共展示了Listen类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: toggleProtection
import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #toggleProtection")
public void toggleProtection(){
Sheet selectedSheet = ss.getSelectedSheet();
if (selectedSheet.isProtected()){
Ranges.range(selectedSheet).unprotectSheet("mypass");
}else{
Ranges.range(selectedSheet).protectSheet("mypass",
true, //allowSelectingLockedCells
true, //allowSelectingUnlockedCells,
false, //allowFormattingCells
false, //allowFormattingColumns
false, //allowFormattingRows
false, //allowInsertColumns
false, //allowInsertRows
false, //allowInsertingHyperlinks
false, //allowDeletingColumns
false, //boolean allowDeletingRows
false, //allowSorting
false, //allowFiltering
false, //allowUsingPivotTables
false, //drawingObjects
false //boolean scenarios
);
}
updateSheetProtectionStatus(selectedSheet);
}
开发者ID:zkoss,项目名称:zssessentials,代码行数:27,代码来源:ProtectionComposer.java
示例17: doExport
import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onClick = #exportExcel")
public void doExport() throws IOException{
Exporter exporter = Exporters.getExporter();
Book book = ss.getBook();
File file = File.createTempFile(Long.toString(System.currentTimeMillis()),"temp");
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
exporter.export(book, fos);
}finally{
if(fos!=null){
fos.close();
}
}
//generate file name upon book type (2007,2003)
String dlname = BookUtil.suggestName(book);
Filedownload.save(new AMedia(dlname, "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", file, true));
}
开发者ID:zkoss,项目名称:zssessentials,代码行数:19,代码来源:ExportComposer.java
示例18: onEditboxChange
import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onChange = #cellEditTextBox")
public void onEditboxChange(){
CellRef pos = ss.getCellFocus();
Range range = Ranges.range(ss.getSelectedSheet(),pos.getRow(),pos.getColumn());
CellData data = range.getCellData();
if(data.validateEditText(cellEditTextBox.getValue())){
try{
data.setEditText(cellEditTextBox.getValue());
}catch (IllegalFormulaException e){
//handle illegal formula input
}
}else{
ClientUtil.showWarn("not a valid value");
}
refreshCellInfo(pos.getRow(),pos.getColumn());
}
开发者ID:zkoss,项目名称:zssessentials,代码行数:18,代码来源:CellDataComposer.java
示例19: onCtrlKey
import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onCtrlKey = #ss")
public void onCtrlKey(KeyEvent event){
StringBuilder info = new StringBuilder();
info.append("Keys : ").append(event.getKeyCode())
.append(", Ctrl:").append(event.isCtrlKey())
.append(", Alt:").append(event.isAltKey())
.append(", Shift:").append(event.isShiftKey());
if(isShowEventInfo(event.getName())){
addInfo(info.toString());
}
if (isUndoPressed(event)){
isUndo = true;
}
}
开发者ID:zkoss,项目名称:zssessentials,代码行数:18,代码来源:EventsComposer.java
示例20: onHeaderClick
import org.zkoss.zk.ui.select.annotation.Listen; //导入依赖的package包/类
@Listen("onHeaderClick = #ss")
public void onHeaderClick(HeaderMouseEvent event){
StringBuilder info = new StringBuilder();
info.append("Click on ").append(event.getType()).append(" ");
switch(event.getType()){
case COLUMN:
info.append(Ranges.getColumnRefString(event.getIndex()));
break;
case ROW:
info.append(Ranges.getRowRefString(event.getIndex()));
break;
}
if(isShowEventInfo(event.getName())){
addInfo(info.toString());
}
}
开发者ID:zkoss,项目名称:zssessentials,代码行数:19,代码来源:EventsComposer.java
注:本文中的org.zkoss.zk.ui.select.annotation.Listen类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论