Produced by Araxis Merge on 12/5/2017 12:06:36 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheWeb\src\gov\va\med\cache\gui\client | CacheContentTreeModel.java | Mon Dec 4 21:34:22 2017 UTC |
| 2 | IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\CacheWeb\src\gov\va\med\cache\gui\client | CacheContentTreeModel.java | Mon Dec 4 21:57:55 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 338 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.med.c ache.gui.c lient; | |
| 2 | ||
| 3 | import gov .va.med.ca che.gui.sh ared.Abstr actNamedVO ; | |
| 4 | import gov .va.med.ca che.gui.sh ared.Cache ItemPath; | |
| 5 | import gov .va.med.ca che.gui.sh ared.Cache ManagerVO; | |
| 6 | import gov .va.med.ca che.gui.sh ared.Cache VO; | |
| 7 | import gov .va.med.ca che.gui.sh ared.Group VO; | |
| 8 | import gov .va.med.ca che.gui.sh ared.Insta nceVO; | |
| 9 | import gov .va.med.ca che.gui.sh ared.Regio nVO; | |
| 10 | import gov .va.med.ca che.gui.sh ared.RootV O; | |
| 11 | ||
| 12 | import org .apache.lo gging.log4 j.LogManag er; | |
| 13 | import org .apache.lo gging.log4 j.Logger; | |
| 14 | ||
| 15 | import com .google.gw t.cell.cli ent.Abstra ctCell; | |
| 16 | import com .google.gw t.cell.cli ent.Cell; | |
| 17 | import com .google.gw t.safehtml .shared.Sa feHtmlBuil der; | |
| 18 | import com .google.gw t.view.cli ent.AsyncD ataProvide r; | |
| 19 | import com .google.gw t.view.cli ent.Select ionModel; | |
| 20 | import com .google.gw t.view.cli ent.TreeVi ewModel; | |
| 21 | ||
| 22 | /** | |
| 23 | * | |
| 24 | * @author
|
|
| 25 | * | |
| 26 | */ | |
| 27 | public cla ss CacheCo ntentTreeM odel | |
| 28 | implements TreeViewM odel | |
| 29 | { | |
| 30 | fi nal Select ionModel<A bstractNam edVO> sele ctionModel ; | |
| 31 | ||
| 32 | pr ivate fina l CacheDat aProvider dataProvid er; | |
| 33 | Lo gger logge r = LogMan ager.getLo gger(Cache ContentTre eModel.cla ss); | |
| 34 | ||
| 35 | /* * | |
| 36 | * @param ca cheManager | |
| 37 | * - a refe rence to t he root of the data model | |
| 38 | * @param ca che | |
| 39 | * - a refe rence to t he cache w ithin the data model that this | |
| 40 | * instance is to mod el | |
| 41 | * / | |
| 42 | pu blic Cache ContentTre eModel(Cac heDataProv ider dataP rovider, S electionMo del<Abstra ctNamedVO> selection Model) | |
| 43 | { | |
| 44 | this .dataProvi der = data Provider; | |
| 45 | this .selection Model = se lectionMod el; | |
| 46 | } | |
| 47 | ||
| 48 | /* * | |
| 49 | * Get the N odeInfo th at will pr ovide the ProvidesKe y, Cell, a nd HasData | |
| 50 | * instances to retrie ve and dis play the c hildren of the speci fied value . | |
| 51 | * | |
| 52 | * Specified by: getNo deInfo(... ) in TreeV iewModel | |
| 53 | * @param va lue the va lue in the parent no de | |
| 54 | * @return t he NodeInf o | |
| 55 | * / | |
| 56 | @O verride | |
| 57 | pu blic <T> N odeInfo<?> getNodeIn fo(T value ) | |
| 58 | { | |
| 59 | Stri ng msg = " getNodeInf o(" + (val ue == null ? "<null> " : value. toString() ) + ")"; | |
| 60 | logg er.info(ms g); | |
| 61 | ||
| 62 | // R eturn a no de info th at pairs t he data wi th a cell. | |
| 63 | ||
| 64 | // i f value is null, the n this met hod is bei ng asked f or the | |
| 65 | // r oot node i nfo | |
| 66 | if ( value == n ull) | |
| 67 | { | |
| 68 | AsyncD ataProvide r<CacheMan agerVO> ca cheManager DataProvid er = dataP rovider.ge tOrCreateD ecorator(( RootVO) nu ll); | |
| 69 | // Lis tDataProvi der<CacheM anagerVO> dataProvid er = new | |
| 70 | // Lis tDataProvi der<CacheM anagerVO>( mockConten t); | |
| 71 | ||
| 72 | // Cre ate a cell to displa y a compos er. | |
| 73 | Cell<C acheManage rVO> cell = new Cach eManagerCe ll(this); | |
| 74 | ||
| 75 | // Ret urn a node info that pairs the data prov ider and t he cell. | |
| 76 | return new Defau ltNodeInfo <CacheMana gerVO>(cac heManagerD ataProvide r, cell); | |
| 77 | } | |
| 78 | ||
| 79 | else if (value instanceo f CacheMan agerVO) | |
| 80 | { | |
| 81 | // LEV EL 1. | |
| 82 | // We want the c hildren of the Cache Manager. R eturn the Caches. | |
| 83 | AsyncD ataProvide r<CacheVO> cacheData Provider = dataProvi der.getOrC reateDecor ator((Cach eManagerVO ) value); | |
| 84 | CacheC ell cacheC ell = new CacheCell( this); | |
| 85 | CacheD escription Cell cache Descriptio nCell = ne w CacheDes criptionCe ll(this); | |
| 86 | Cell<C acheVO> ce ll = | |
| 87 | new Acti onableName dItemCell< CacheVO>(t his, cache Cell, cach eDescripti onCell, tr ue, false, true); | |
| 88 | return new Defau ltNodeInfo <CacheVO>( cacheDataP rovider, c ell); | |
| 89 | ||
| 90 | } | |
| 91 | else if (value instanceo f CacheVO) | |
| 92 | { | |
| 93 | // LEV EL 2 | |
| 94 | // We want the c hildren of the Cache . Return t he Regions . | |
| 95 | AsyncD ataProvide r<RegionVO > regionDa taProvider = dataPro vider.getO rCreateDec orator((Ca cheVO) val ue); | |
| 96 | Region Cell regio nCell = ne w RegionCe ll(this); | |
| 97 | Region Descriptio nCell regi onDescript ionCell = new Region Descriptio nCell(this ); | |
| 98 | Cell<R egionVO> c ell = | |
| 99 | new Acti onableName dItemCell< RegionVO>( this, regi onCell, re gionDescri ptionCell, false, tr ue, true); | |
| 100 | return new Defau ltNodeInfo <RegionVO> (regionDat aProvider, cell); | |
| 101 | } | |
| 102 | else if (value instanceo f RegionVO ) | |
| 103 | { | |
| 104 | // LEV EL 3 | |
| 105 | // We want the c hildren of the Regio n. Return Groups. | |
| 106 | AsyncD ataProvide r<Abstract NamedVO> g roupDataPr ovider = d ataProvide r.getOrCre ateDecorat or((Region VO) value) ; | |
| 107 | GroupO rInstanceC ell groupC ell = new GroupOrIns tanceCell( this); | |
| 108 | GroupO rInstanceD escription Cell group Descriptio nCell = ne w GroupOrI nstanceDes criptionCe ll(this); | |
| 109 | Cell<A bstractNam edVO> cell = | |
| 110 | new Acti onableName dItemCell< AbstractNa medVO>(thi s, groupCe ll, groupD escription Cell, true , true, tr ue); | |
| 111 | return new Defau ltNodeInfo <AbstractN amedVO>(gr oupDataPro vider, cel l); | |
| 112 | } | |
| 113 | else if (value instanceo f GroupVO) | |
| 114 | { | |
| 115 | // LEV EL 4 | |
| 116 | // We want the c hildren of the Group . Return G roups and Instances | |
| 117 | AsyncD ataProvide r<Abstract NamedVO> g roupDataPr ovider = d ataProvide r.getOrCre ateDecorat or((GroupV O) value) ; | |
| 118 | GroupO rInstanceC ell groupC ell = new GroupOrIns tanceCell( this); | |
| 119 | GroupO rInstanceD escription Cell group Descriptio nCell = ne w GroupOrI nstanceDes criptionCe ll(this); | |
| 120 | Cell<A bstractNam edVO> cell = | |
| 121 | new Acti onableName dItemCell< AbstractNa medVO>(thi s, groupCe ll, groupD escription Cell, true , true, tr ue); | |
| 122 | return new Defau ltNodeInfo <AbstractN amedVO>(gr oupDataPro vider, cel l); | |
| 123 | } | |
| 124 | ||
| 125 | else return nu ll; | |
| 126 | } | |
| 127 | ||
| 128 | /* * | |
| 129 | * Check if the specif ied value represents a leaf no de. Leaf n odes canno t be | |
| 130 | * opened. A n instance is always a leaf no de. MAYBE ... A grou p may be a | |
| 131 | * leaf node , if the c hildren ha ve been re trieved fr om the ser ver and th ere | |
| 132 | * were none . ... stil l working on this, ' cause a gr oup may ge t populate d | |
| 133 | * after we check it. | |
| 134 | * / | |
| 135 | @O verride | |
| 136 | pu blic boole an isLeaf( Object val ue) | |
| 137 | { | |
| 138 | retu rn (value instanceof InstanceV O); | |
| 139 | } | |
| 140 | ||
| 141 | pu blic void clearCache (String ca cheName) | |
| 142 | { | |
| 143 | this .dataProvi der.clearC ache(cache Name); | |
| 144 | } | |
| 145 | ||
| 146 | pu blic void deleteGrou p(CacheIte mPath path ) | |
| 147 | { | |
| 148 | this .dataProvi der.delete Group(path ); | |
| 149 | } | |
| 150 | ||
| 151 | pu blic void deleteInst ance(Cache ItemPath p ath) | |
| 152 | { | |
| 153 | this .dataProvi der.delete Instance(p ath); | |
| 154 | } | |
| 155 | ||
| 156 | pu blic void getItemInf ormation(C acheItemPa th path) | |
| 157 | { | |
| 158 | this .dataProvi der.getIte mInformati on(path); | |
| 159 | } | |
| 160 | ||
| 161 | /* * | |
| 162 | * | |
| 163 | * @param pa th | |
| 164 | * / | |
| 165 | pu blic void refresh(Ca cheItemPat h path) | |
| 166 | { | |
| 167 | this .dataProvi der.refres h(path); | |
| 168 | } | |
| 169 | ||
| 170 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.