});
bookCtrl.addEventListener(Events.ON_STOP_EDITING,
new EventListener() {
public void onEvent(Event event) throws Exception {
StopEditingEvent evt = (StopEditingEvent)event;
//setText((String) evt.getEditingValue());
//chart not implement yet
// // to notify all widgets there is a cell changed
// for (int i = 0; i < chartKey; i++) {
// try {
// Window win = (Window) mainWin.getFellow("chartWin" + i);
// if (win != null) {
// Chart myChart = (Chart) win.getFellow("myChart");
// CellEvent event = new StopEditingEvent(
// org.zkoss.zss.ui.event.Events.ON_STOP_EDITING,
// myChart, evt.getSheet(), evt.getRow(), evt
// .getColumn(), (String) evt.getData());
// org.zkoss.zk.ui.event.Events.postEvent(event);
// }
// } catch (Exception e) {
// // the chart may be deleted
// }
// }
}
});
//TODO: add ON_START_EDITING, add cell focus if cell is formula
// bookCtrl.addEventListener(Events.ON_START_EDITING,
// new EventListener() {
// public void onEvent(Event event) throws Exception {
// StartEditingEvent evt = (StartEditingEvent)event;
// newEdit = (String) evt.getClientValue();
// if (isStartEditingFormula(newEdit)) {
// cacheFormulaEditingInfo();
// }
// if (isComposingFormula(newEdit)) {
// int left = bookCtrl.getSelection().getLeft();
// int top = bookCtrl.getSelection().getTop();
// formulaCell = Utils.getCell(bookCtrl.getSelectedSheet(), top, left);
//
// addedFocusNames.add(FORMULA_FOCUS_NAME);
// bookCtrl.moveEditorFocus(FORMULA_FOCUS_NAME, FORMULA_COLOR, top, left);
// }
// setText((String) evt.getEditingValue());
// }
// });
bookCtrl.addEventListener(Events.ON_EDITBOX_EDITING,
new EventListener() {
public void onEvent(Event event) throws Exception {
EditboxEditingEvent evt = (EditboxEditingEvent)event;
setText((String) evt.getEditingValue());
}
});
final DesktopWorkbenchContext cnt = getDesktopWorkbenchContext();
cnt.addEventListener(Consts.ON_SHEET_CHANGED, new EventListener() {
public void onEvent(Event event) throws Exception {