From 7e87c05d92cf3f15d7fae8641e2c76725bc50a36 Mon Sep 17 00:00:00 2001 From: Franta Pribyl Date: Wed, 16 Jul 2014 14:35:24 +0200 Subject: [PATCH] Refaktorizace RequirementService. --- .../isspst/ui/requirement/RequirementSubpage.java | 15 ++++++--------- .../ui/requirement/TripRequirementListAll.java | 1 - .../ui/requirement/TripRequirementListCentre.java | 1 - .../requirement/TripRequirementListWorkgroup.java | 1 - 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java b/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java index bf6eee07..576ee5d5 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/RequirementSubpage.java @@ -9,22 +9,21 @@ import org.zkoss.bind.annotation.NotifyChange; public class RequirementSubpage extends ListViewModel { - protected RequirementBaseService reqService; - @SuppressWarnings("unchecked") - public void init() { - reqService = (RequirementBaseService) service; + private RequirementBaseService getReqService() + { + return (RequirementBaseService) service; } @Override protected void loadLazyData(T data) { - reqService.loadAuthItems(data); + this.getReqService().loadAuthItems(data); } @Command @NotifyChange("dataBean") public void approve() { - reqService.approve(getDataBean()); + this.getReqService().approve(getDataBean()); } @Override @@ -35,11 +34,9 @@ public class RequirementSubpage extends ListViewModel public boolean isCanApprove() { if (getDataBean() != null) { - return reqService.canApprove(getDataBean()); + return this.getReqService().canApprove(getDataBean()); } return false; } - - } diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java index 0d1262ee..3d527af2 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListAll.java @@ -32,7 +32,6 @@ public class TripRequirementListAll extends RequirementSubpage allCentres = workgroupService.getCentres(); allWorkgroups = workgroupService.getWorkgroups(); - super.init(); } @Override diff --git a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java index f8833c8a..2304a186 100644 --- a/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java +++ b/src/main/java/info/bukova/isspst/ui/requirement/TripRequirementListCentre.java @@ -33,7 +33,6 @@ public class TripRequirementListCentre extends RequirementSubpage