Changeset 3843
- Timestamp:
- Sep 10, 2010, 2:33:11 PM (13 years ago)
- Location:
- trunk/client/servlet/src/org/proteios
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/hit/ExclusionList.java
r3842 r3843 87 87 // properties.add(forwardF); 88 88 // 89 properties.add( getFormFactory().selectLocalSampleId(dc, project));89 properties.add(new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc))); 90 90 TextField<String> nameF = new TextField<String>( 91 91 FileNameField.VPARAM); -
trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java
r3842 r3843 2142 2142 // 2143 2143 properties.add(new ExternalGelIdSelect(dc, project)); 2144 properties.add(selectLocalSampleId(dc, project)); 2144 properties.add( 2145 new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc)) 2146 ); 2145 2147 TextField<String> nameF = new FileNameField(); 2146 2148 nameF.setValue("ProteinReport.tsv"); … … 2160 2162 { 2161 2163 // Properties fieldset 2162 Fieldset properties = new Fieldset(); 2163 properties.setTitle( 2164 "ImportHitsNonGelWizardStep1FormLegend"); 2164 Fieldset properties = new Fieldset("ImportHitsNonGelWizardStep1FormLegend"); 2165 2165 form.addFieldset(properties); 2166 2166 /* … … 2169 2169 TextField<Integer> pluginIdF = new PluginIdField(); 2170 2170 PluginDefinition pluginDef = PluginDefinition.getByClassName( 2171 project.getDbControl(),2171 dc, 2172 2172 "org.proteios.plugins.PeakListToHitNonGelPlugin"); 2173 2173 pluginIdF.setValue(pluginDef.getId()); … … 2195 2195 properties.add(forwardF); 2196 2196 // Local sample id select box 2197 Select<VString> localSampleIdS = selectLocalSampleId(dc, project);2197 Select<VString> localSampleIdS = new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc)); 2198 2198 localSampleIdS.setLabel("SelectLocalSampleId"); 2199 2199 properties.add(localSampleIdS); … … 2315 2315 Project project) 2316 2316 { 2317 Select<VString> select = selectLocalSampleId(dc, project);2317 Select<VString> select = new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc)); 2318 2318 // Will be disabled if no options available 2319 2319 if (!select.isDisabled()) … … 2322 2322 allSampleIds.setContent("All in project"); 2323 2323 select.addOption(allSampleIds); 2324 }2325 return select;2326 }2327 2328 2329 public Select<VString> selectLocalSampleId(DbControl dc, Project project)2330 {2331 Select<VString> select = new Select<VString>(VLOCALSAMPLEIDSELECTED);2332 select.setLabel("LocalSampleId");2333 if (dc != null && dc.isConnected())2334 {2335 List<String> localSampleIdList = Hit.getUniqueLocalSampleIds(2336 project, dc);2337 log.debug("localSampleIdList = " + localSampleIdList);2338 // Check if valid local sample id values exist2339 boolean validValuesExist = false;2340 if (localSampleIdList != null)2341 {2342 log.debug("localSampleIdList.size() = " + localSampleIdList2343 .size());2344 for (int i = 0; i < localSampleIdList.size(); i++)2345 {2346 log2347 .debug("localSampleIdList.get(" + i + ") = " + localSampleIdList2348 .get(i));2349 // Get local sample id2350 String localSampleId = localSampleIdList.get(i);2351 if (localSampleId != null)2352 {2353 validValuesExist = true;2354 continue;2355 }2356 }2357 }2358 /*2359 * Add dummy option with empty string as value2360 */2361 Option dummyLocalSampleId = new Option("");2362 if (validValuesExist)2363 {2364 dummyLocalSampleId.setContent("None selected");2365 }2366 else2367 {2368 dummyLocalSampleId.setContent("No local sample ID available");2369 }2370 select.addOption(dummyLocalSampleId);2371 /*2372 * Add select options for unique local sample ids2373 */2374 for (int i = 0; i < localSampleIdList.size(); i++)2375 {2376 // Get local sample id2377 String localSampleId = localSampleIdList.get(i);2378 if (localSampleId != null)2379 {2380 // Add option for local sample id2381 Option o = new Option("" + localSampleId);2382 o.setContent(localSampleId);2383 select.addOption(o);2384 }2385 }2386 /*2387 * Disable select box if no valid options2388 */2389 if (!validValuesExist)2390 {2391 select.setDisabled(true);2392 }2393 2324 } 2394 2325 return select; … … 2931 2862 if (dc != null && dc.isConnected()) 2932 2863 { 2933 prideFilterSettingsFS.add(selectLocalSampleId(dc, project)); 2864 prideFilterSettingsFS.add( 2865 new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc)) 2866 ); 2934 2867 } 2935 2868 //
Note: See TracChangeset
for help on using the changeset viewer.