protected void doPrevious() { // TODO Auto-generated method stub if (isDataChanged()) { int num = JOptionPane.showConfirmDialog(this, "当前页面数据已修改,是否要保存", "保存确认", 0); if (num == JOptionPane.YES_OPTION) { if (!doSave()) { return; } } else { listCursor.setCurrentObject(oldSite); } } listCursor.previous(); refreshData(); setButtonStatus(); }
private void refreshData() { EbSite site = (EbSite) listCursor.getCurrentObject(); if (site == null) { // 新增页面 this.pageStatus = ZcSettingConstants.PAGE_STATUS_NEW; site = new EbSite(); setDefualtValue(site, ZcSettingConstants.PAGE_STATUS_NEW); List lst = new ArrayList(); lst.add(site); this.listCursor.setDataList(lst, -1); } else { site = ebayServiceDelegate.getebSiteByID(site.getSiteId(), requestMeta); } listCursor.setCurrentObject(site); this.setEditingObject(site); setOldObject(); updateFieldEditorsEditable(); setButtonStatus(); }
private void setOldObject() { oldSite = (EbSite) ObjectUtil.deepCopy(listCursor.getCurrentObject()); }
protected void doAdd() { // TODO Auto-generated method stub listCursor.setCurrentObject(null); refreshData(); }
public boolean isDataChanged() { return !DigestUtil.digest(oldSite).equals(DigestUtil.digest(listCursor.getCurrentObject())); }