Example #1
0
 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();
 }
Example #2
0
 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();
 }
Example #3
0
 private void setOldObject() {
   oldSite = (EbSite) ObjectUtil.deepCopy(listCursor.getCurrentObject());
 }
Example #4
0
 protected void doAdd() {
   // TODO Auto-generated method stub
   listCursor.setCurrentObject(null);
   refreshData();
 }
Example #5
0
 public boolean isDataChanged() {
   return !DigestUtil.digest(oldSite).equals(DigestUtil.digest(listCursor.getCurrentObject()));
 }