Changeset 3781
- Timestamp:
- Aug 23, 2010, 8:08:16 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/feature/ViewFeatureHits.java
r3777 r3781 47 47 48 48 /** 49 * List subhits for a combined hit50 49 * 51 * @author fredrik 50 * @author fredrik, gregory 52 51 */ 53 52 public class ViewFeatureHits … … 58 57 throws ActionException, InvalidParameterValue 59 58 { 60 /* 61 * Get hit id from valid parameter and set it as session attribute. 62 */ 63 Integer featureId = getValidInteger(FormFactory.VID); 64 log.debug("featureId = " + featureId); 65 /*********************************************************************** 66 * Get external id data 67 */ 68 // Define 59 Integer featureId; 69 60 Table tbl; 70 61 RowLayout layout; 71 62 Title title; 63 DbControl dc; 64 ItemFactory factory; 65 Feature feature; 66 List<Hit> hits; 67 68 featureId = getValidInteger(FormFactory.VID); 69 log.debug("featureId = " + featureId); 72 70 tbl = (Table) getRequest().getAttribute("table"); 73 71 if (tbl == null) 74 72 { 75 // Let ConfigureTableFactory2 action create the table for us 76 setAttribute(ConfigureTableFactory2.VWRAPPERCLASS, Hit.class 77 .getName()); 78 setAttribute(ConfigureTableFactory2.VDATACLASS, HitData.class 79 .getName()); 80 setAttribute(ConfigureTableFactory2.VFORWARDTO, 81 ViewFeatureHits.class.getName()); 73 // Use ConfigureTableFactory2 to configure TableFactory2 74 setAttribute(ConfigureTableFactory2.VWRAPPERCLASS, Hit.class.getName()); 75 setAttribute(ConfigureTableFactory2.VDATACLASS, HitData.class.getName()); 76 setAttribute(ConfigureTableFactory2.VFORWARDTO, ViewFeatureHits.class.getName()); 82 77 setAttribute(ConfigureTableFactory2.VONLYINPROJECT, true); 83 78 setAttribute(ConfigureTableFactory2.VUSEDEFAULT, false); 84 79 setForwardTo(ConfigureTableFactory2.class); 80 return; // Stop here 85 81 } 86 else 87 { 88 DbControl dc = newDbControl(); 89 ItemFactory factory = getItemFactory(dc); 90 Feature feature = factory.getById(Feature.class, featureId); 91 List<Hit> hits = new ArrayList<Hit>(); 92 hits.addAll(feature.getHits()); 93 getTableFactory2().setIterator(hits.iterator()); 94 tbl = getTableFactory2().build(); 95 tbl.setTitle("Hit"); 96 title = new Title("Hits matching feature (feature m/z:" + feature 97 .getMassToChargeRatio() + ", apex RT:" + feature 98 .getApexRetentionTimeInMinutes() + ")"); 99 layout = getLayoutFactory().getRowLayout(); 100 layout.add(title); 101 layout.add(tbl); 102 setLayout(layout); 103 } 82 83 dc = newDbControl(); 84 factory = getItemFactory(dc); 85 feature = factory.getById(Feature.class, featureId); 86 hits = new ArrayList<Hit>(); 87 hits.addAll(feature.getHits()); 88 89 // Use the preconfigured TableFactory2 to build a new table for us 90 getTableFactory2().setIterator(hits.iterator()); 91 tbl = getTableFactory2().build(); 92 93 tbl.setTitle("Hit"); 94 title = new Title("Hits matching feature (feature m/z:" + feature 95 .getMassToChargeRatio() + ", apex RT:" + feature 96 .getApexRetentionTimeInMinutes() + ")"); 97 layout = getLayoutFactory().getRowLayout(); 98 layout.add(title); 99 layout.add(tbl); 100 setLayout(layout); 104 101 } 105 102 }
Note: See TracChangeset
for help on using the changeset viewer.