Changeset 3843


Ignore:
Timestamp:
Sep 10, 2010, 2:33:11 PM (13 years ago)
Author:
Gregory Vincic
Message:

Refs #698. Removed method selectLocalSampleId method from FormFactory

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  
    8787      // properties.add(forwardF);
    8888      //
    89       properties.add(getFormFactory().selectLocalSampleId(dc, project));
     89      properties.add(new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc)));
    9090      TextField<String> nameF = new TextField<String>(
    9191        FileNameField.VPARAM);
  • trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java

    r3842 r3843  
    21422142      //
    21432143      properties.add(new ExternalGelIdSelect(dc, project));
    2144       properties.add(selectLocalSampleId(dc, project));
     2144      properties.add(
     2145new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc))
     2146);
    21452147      TextField<String> nameF = new FileNameField();
    21462148      nameF.setValue("ProteinReport.tsv");
     
    21602162    {
    21612163      // Properties fieldset
    2162       Fieldset properties = new Fieldset();
    2163       properties.setTitle(
    2164         "ImportHitsNonGelWizardStep1FormLegend");
     2164      Fieldset properties = new Fieldset("ImportHitsNonGelWizardStep1FormLegend");
    21652165      form.addFieldset(properties);
    21662166      /*
     
    21692169      TextField<Integer> pluginIdF = new PluginIdField();
    21702170      PluginDefinition pluginDef = PluginDefinition.getByClassName(
    2171         project.getDbControl(),
     2171        dc,
    21722172        "org.proteios.plugins.PeakListToHitNonGelPlugin");
    21732173      pluginIdF.setValue(pluginDef.getId());
     
    21952195      properties.add(forwardF);
    21962196      // Local sample id select box
    2197       Select<VString> localSampleIdS = selectLocalSampleId(dc, project);
     2197      Select<VString> localSampleIdS = new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc));
    21982198      localSampleIdS.setLabel("SelectLocalSampleId");
    21992199      properties.add(localSampleIdS);
     
    23152315      Project project)
    23162316  {
    2317     Select<VString> select = selectLocalSampleId(dc, project);
     2317    Select<VString> select = new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc));
    23182318    // Will be disabled if no options available
    23192319    if (!select.isDisabled())
     
    23222322      allSampleIds.setContent("All in project");
    23232323      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 exist
    2339       boolean validValuesExist = false;
    2340       if (localSampleIdList != null)
    2341       {
    2342         log.debug("localSampleIdList.size() = " + localSampleIdList
    2343           .size());
    2344         for (int i = 0; i < localSampleIdList.size(); i++)
    2345         {
    2346           log
    2347             .debug("localSampleIdList.get(" + i + ") = " + localSampleIdList
    2348               .get(i));
    2349           // Get local sample id
    2350           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 value
    2360        */
    2361       Option dummyLocalSampleId = new Option("");
    2362       if (validValuesExist)
    2363       {
    2364         dummyLocalSampleId.setContent("None selected");
    2365       }
    2366       else
    2367       {
    2368         dummyLocalSampleId.setContent("No local sample ID available");
    2369       }
    2370       select.addOption(dummyLocalSampleId);
    2371       /*
    2372        * Add select options for unique local sample ids
    2373        */
    2374       for (int i = 0; i < localSampleIdList.size(); i++)
    2375       {
    2376         // Get local sample id
    2377         String localSampleId = localSampleIdList.get(i);
    2378         if (localSampleId != null)
    2379         {
    2380           // Add option for local sample id
    2381           Option o = new Option("" + localSampleId);
    2382           o.setContent(localSampleId);
    2383           select.addOption(o);
    2384         }
    2385       }
    2386       /*
    2387        * Disable select box if no valid options
    2388        */
    2389       if (!validValuesExist)
    2390       {
    2391         select.setDisabled(true);
    2392       }
    23932324    }
    23942325    return select;
     
    29312862    if (dc != null && dc.isConnected())
    29322863    {
    2933       prideFilterSettingsFS.add(selectLocalSampleId(dc, project));
     2864      prideFilterSettingsFS.add(
     2865new LocalSampleSelect(Hit.getUniqueLocalSampleIds(project, dc))
     2866);
    29342867    }
    29352868    //
Note: See TracChangeset for help on using the changeset viewer.