Changeset 3841


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

Refs #698. Removed getImportHitsWizardStep3Form method from FormFactory

Location:
trunk/client/servlet/src/org/proteios
Files:
3 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/action/file/CreateMsInspectDetailsJobs.java

    r2442 r3841  
    44package org.proteios.action.file;
    55
     6import java.util.List;
    67import org.proteios.action.ProteiosAction;
    78import org.proteios.action.job.ListJobs;
     
    1516import org.proteios.core.Project;
    1617import org.proteios.core.StringParameterType;
    17 import org.proteios.gui.form.FormFactory;
    18 
     18import org.proteios.gui.form.*;
    1919import se.lu.thep.waf.ActionException;
    2020import se.lu.thep.waf.constraints.InvalidParameterValue;
    21 
    22 import java.util.List;
    2321
    2422/**
     
    3836     */
    3937    List<Integer> files = getValidIntegerList(FormFactory.VID);
    40     String capture = getValidString(FormFactory.VDUMMY);
     38    String capture = getValidString(DummyField.VPARAM);
    4139    /*
    4240     * execute the plugin on the selected files
  • trunk/client/servlet/src/org/proteios/action/file/MsInspectDetailsForm.java

    r2451 r3841  
    2222package org.proteios.action.file;
    2323
     24import java.util.ArrayList;
     25import java.util.List;
    2426import org.proteios.ActionLink;
    2527import org.proteios.Context;
     
    2931import org.proteios.gui.TitledWindow;
    3032import org.proteios.gui.Toolbar;
    31 import org.proteios.gui.form.Fieldset;
    32 import org.proteios.gui.form.Form;
    33 import org.proteios.gui.form.FormFactory;
    34 import org.proteios.gui.form.TextField;
     33import org.proteios.gui.form.*;
    3534import org.proteios.gui.layout.RowLayout;
    36 
    3735import se.lu.thep.waf.ActionException;
    3836import se.lu.thep.waf.constraints.InvalidParameterValue;
    39 
    40 import java.util.ArrayList;
    41 import java.util.List;
    4237
    4338/**
     
    9994    instructionArea.setTitle("Grouping pattern");
    10095    TextField<String> captureField = new TextField<String>(
    101       FormFactory.VDUMMY);
     96      DummyField.VPARAM);
    10297    captureField.setValue(".*_(\\d)\\w\\..*");
    10398    captureField.setLabel("Pattern");
  • trunk/client/servlet/src/org/proteios/action/hit/ImportHitsNonGelWizardStep1a.java

    r3821 r3841  
    6262    String selectedLocalSampleId = getString(FormFactory.VLOCALSAMPLEIDSELECTED);
    6363    Boolean useRegexPattern = getValidBoolean(ImportHitsNonGelWizardStep1b.VUSEREGEXPATTERN);
    64     String regexPattern = getValidString(ImportHitsNonGelWizardStep1b.VREGEXPATTERN);
     64    String regexPattern = getValidString(RegexField.VPARAM);
    6565    log.debug("enteredLocalSampleId = \"" + enteredLocalSampleId + "\"");
    6666    log.debug("selectedLocalSampleId = \"" + selectedLocalSampleId + "\"");
     
    8585    saveToSession(FormFactory.VLOCALSAMPLEID);
    8686    setSessionAttribute(ImportHitsNonGelWizardStep1b.VUSEREGEXPATTERN, useRegexPattern);
    87     saveToSession(ImportHitsNonGelWizardStep1b.VREGEXPATTERN);
     87    saveToSession(RegexField.VPARAM);
    8888    saveToSession(ForwardField.VPARAM);
    8989    saveToSession(PluginIdField.VPARAM);
  • trunk/client/servlet/src/org/proteios/action/hit/ImportHitsNonGelWizardStep1b.java

    r3821 r3841  
    5454{
    5555  public static final VBoolean VUSEREGEXPATTERN = new VBoolean("useRegexPattern", false);
    56   public static final VString VREGEXPATTERN = new VString("regexPattern", 0, 255, false);
    5756 
    5857  /*
     
    7473    List<Integer> fileIds = getValidIntegerList(ItemIdField.VPARAM);
    7574    Boolean useRegexPattern = getSessionAttribute(VUSEREGEXPATTERN);
    76     String regexPattern = getSessionAttribute(VREGEXPATTERN);
     75    String regexPattern = getSessionAttribute(RegexField.VPARAM);
    7776    // Set default value of regex pattern use flag to false
    7877    if (useRegexPattern == null)
  • trunk/client/servlet/src/org/proteios/action/hit/ImportHitsWizard.java

    r3840 r3841  
    2828package org.proteios.action.hit;
    2929
     30import java.util.ArrayList;
     31import java.util.List;
    3032import org.proteios.ActionLink;
    3133import org.proteios.Context;
     
    3638import org.proteios.core.Hit;
    3739import org.proteios.core.Project;
     40import org.proteios.gui.ColumnContainer;
     41import org.proteios.gui.RowContainer;
    3842import org.proteios.gui.Title;
    3943import org.proteios.gui.TitledWindow;
    4044import org.proteios.gui.Toolbar;
    41 import org.proteios.gui.ColumnContainer;
    42 import org.proteios.gui.RowContainer;
    4345import org.proteios.gui.form.*;
    4446import org.proteios.gui.layout.RowLayout;
    4547import se.lu.thep.waf.ActionException;
    4648import se.lu.thep.waf.constraints.InvalidParameterValue;
    47 import java.util.ArrayList;
    48 import java.util.List;
    4949
    5050/**
     
    137137   
    138138  { // Step 3
    139     step3 = getFormFactory().getImportHitsWizardStep3Form(project);
     139    step3 = new ImportHitsWizardStep3Form(dc, getActionFactory().getId(ImportHitsWizardStep3b.class) );
    140140    toolbar = new Toolbar();
    141141    step3.setToolbar(toolbar);
  • trunk/client/servlet/src/org/proteios/action/hit/ImportHitsWizardStep3a.java

    r3821 r3841  
    5656    DbControl dc = newDbControl();
    5757    Project project = isProjectActive(dc);
    58     Form impForm = getFormFactory().getImportHitsWizardStep3Form(project);
     58    Form impForm = new ImportHitsWizardStep3Form(dc, getActionFactory().getId(ImportHitsWizardStep3b.class) );
    5959    verifyParameters(impForm);
    6060    saveToSession(ForwardField.VPARAM);
  • trunk/client/servlet/src/org/proteios/gui/form/Fieldset.java

    r3793 r3841  
    4343 
    4444  private List<GUIElement> fields = null;
    45   private Title legendTitle = null;
    46   /**
    47    * @deprecated replaced by Title legendTitle
    48    */
    49   private String legend = "";
     45  private Title title = null;
    5046
    5147
    52   // TODO #439 olle add a Title here, let the old legend be the Title.title and
    53   // deprecate the legend field and its methods
    54  
     48 public Fieldset()
     49 {
     50 }
     51
     52 public Fieldset(String title)
     53 {
     54  this.title = new Title(title);
     55 } 
     56
    5557  /**
    5658   * Get the fieldset legend Title object.
     
    6870  public Title getLegendTitle()
    6971  {
    70     if (this.legendTitle == null)
     72    if (this.title == null)
    7173    {
    72       this.legendTitle = new Title("");
     74      this.title = new Title("");
    7375    }
    74     return this.legendTitle;
     76    return this.title;
    7577  }
    7678
     
    8183   * @param legendTitle Title The legend Title to set.
    8284   */
    83   public void setLegendTitle(Title legendTitle)
     85  public void setLegendTitle(Title title)
    8486  {
    85     this.legendTitle = legendTitle;
     87    this.title = title;
    8688  }
    8789
  • trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java

    r3840 r3841  
    145145  public static final VString VFILTERVALUELIST = new VString("filterValueList", 0, 255, false);
    146146  public static final VString VSORTCOLUMNKEY = new VString("sortColumnKey",0, 255, false);
    147   public static final VString VDUMMY = new VString("dummy", 0, 255, false);
    148147  public static final VString VCOMMENT = new VString("comment", 0, 255, false);
    149148  public static final VDate VENTRYDATE = new VDate("entryDate", false,Format.DATETIME);
     
    21542153 // Cleaning up from here
    21552154
    2156   public Form getImportHitsWizardStep3Form(Project project)
    2157   {
    2158     DbControl dc = project.getDbControl();
    2159     Form form = new Form("importHitsWizardStep3Form");
    2160     if (dc != null && dc.isConnected())
    2161     {
    2162       // Properties fieldset
    2163       Fieldset properties = new Fieldset();
    2164       properties.getLegendTitle().setTitle(
    2165         "ImportHitsWizardStep3FormLegend");
    2166       form.addFieldset(properties);
    2167       /*
    2168        * Disabled text field with info.
    2169        */
    2170       TextField<String> infoF = new TextField<String>(VDUMMY);
    2171       infoF.setDisabled(true);
    2172       infoF.setLabel("SearchResults");
    2173    infoF.setValue("");
    2174       properties.add(infoF);
    2175       /*
    2176        * Hidden text field for storing plugin id to use.
    2177        */
    2178       TextField<Integer> pluginIdF = new PluginIdField();
    2179       PluginDefinition pluginDef = PluginDefinition.getByClassName(
    2180         project.getDbControl(),
    2181         "org.proteios.plugins.SearchResultsImporter");
    2182       pluginIdF.setValue(pluginDef.getId());
    2183       properties.add(pluginIdF);
    2184       /*
    2185        * This hidden text field sets title to be used for file selection
    2186        * form.
    2187        */
    2188       TextField<String> titleF = new TitleField();
    2189       titleF.setValue("Step 3a. Select Search Result File[s]");
    2190       properties.add(titleF);
    2191       /*
    2192        * This hidden text field sets name to be used for the "Next" button
    2193        * in the file selection form.
    2194        */
    2195       TextField<String> buttonNameF = new NextButtonNameField();
    2196       buttonNameF.setValue("Import");
    2197       properties.add(buttonNameF);
    2198       /*
    2199        * This hidden forward field sets action id used by the file
    2200        * selection action called by ImportHitsWizardStep1a.
    2201        */
    2202       TextField<String> forwardF = new ForwardField();
    2203       forwardF
    2204         .setValue(actionFactory.getId(ImportHitsWizardStep3b.class));
    2205       properties.add(forwardF);
    2206     }
    2207     return form;
    2208   }
    2209 
    2210 
    22112155  public Form getImportHitsNonGelWizardStep1Form(Project project)
    22122156  {
     
    22332177       * form.
    22342178       */
    2235       TextField<String> titleF = new TitleField();
    2236       titleF.setValue("Step 1a. Select PeakList File[s]");
     2179      TextField<String> titleF = new TitleField("Step 1a. Select PeakList File[s]");
    22372180      properties.add(titleF);
    22382181      /*
     
    22672210      properties.add(useRegexPatternCB);
    22682211      // Optional regex pattern entry field
    2269       TextField<String> regexPatternF = createField(ImportHitsNonGelWizardStep1b.VREGEXPATTERN);
     2212      TextField<String> regexPatternF = new RegexField();
    22702213      regexPatternF.setLabel("ImportHitsNonGelWizardRegexPattern");
    22712214      regexPatternF.setValue(".+\\_(.+)\\..+");
     
    22902233       * Disabled text field with info.
    22912234       */
    2292       TextField<String> infoF = new TextField<String>(VDUMMY);
     2235      TextField<String> infoF = new DummyField();
    22932236      infoF.setDisabled(true);
    22942237      infoF.setLabel("SearchResults");
     
    26822625    project1IdF.setValue(project1.getId());
    26832626    //
    2684     TextField<String> project1NameF = createField(VDUMMY);
     2627    TextField<String> project1NameF = new DummyField();
    26852628    project1FilterSettingsFS.add(project1NameF);
    26862629    project1NameF.setDisabled(true);
     
    27692712    project2IdF.setValue(project2.getId());
    27702713    //
    2771     TextField<String> project2NameF = createField(VDUMMY);
     2714    TextField<String> project2NameF = new DummyField();
    27722715    project2FilterSettingsFS.add(project2NameF);
    27732716    project2NameF.setDisabled(true);
     
    76597602    String mascotServerURLStr = pf.getProperty("mascot.server.url");
    76607603    // Mascot server URL string (disabled)
    7661     TextField<String> mascotServerUrlF = createField(VDUMMY);
     7604    TextField<String> mascotServerUrlF = new DummyField();
    76627605    mascotServerUrlF.setDisabled(true);
    76637606    mascotServerUrlF.setLabel("MascotServerURL");
     
    76657608    mascotServerUrlF.setValue(mascotServerURLStr);
    76667609    // Mascot output directory (disabled)
    7667     TextField<String> dirF = createField(VDUMMY);
     7610    TextField<String> dirF = new DummyField();
    76687611    dirF.setDisabled(true);
    76697612    dirF.setLabel("MascotOutputDirectory");
     
    78117754    Fieldset fs = new Fieldset();
    78127755    fs.getLegendTitle().setTitle("UsedSample");
    7813     TextField<String> sampleIdF = new TextField<String>(VDUMMY);
     7756    TextField<String> sampleIdF = new DummyField();
    78147757    sampleIdF.setDisabled(true);
    78157758    sampleIdF.setLabel("SampleExternalId");
     
    78307773    Fieldset fs = new Fieldset();
    78317774    fs.getLegendTitle().setTitle("UsedExtract");
    7832     TextField<String> extractIdF = new TextField<String>(VDUMMY);
     7775    TextField<String> extractIdF = new DummyField();
    78337776    extractIdF.setDisabled(true);
    78347777    extractIdF.setLabel("ExtractExternalId");
     
    78497792    Fieldset fs = new Fieldset();
    78507793    fs.getLegendTitle().setTitle("UsedLabeledExtract");
    7851     TextField<String> extractIdF = new TextField<String>(VDUMMY);
     7794    TextField<String> extractIdF = new DummyField();
    78527795    extractIdF.setDisabled(true);
    78537796    extractIdF.setLabel("ExtractExternalId");
     
    80537996    properties.add(filterNameF);
    80547997    // Filter name display field (disabled - for display of value as label)
    8055     TextField<String> filterNameDisplayF = new TextField<String>(VDUMMY);
     7998    TextField<String> filterNameDisplayF = new DummyField();
    80567999    filterNameDisplayF.setLabel(filterName);
    80578000    filterNameDisplayF.setValue("");
     
    89458888    if (count == 0)
    89468889    {
    8947       TextField<String> itemsCount = new TextField<String>(VDUMMY);
     8890      TextField<String> itemsCount = new DummyField();
    89488891      itemsCount.setLabel("Empty");
    89498892      itemsCount.setValue("");
     
    96339576      if (obj != null)
    96349577      {
    9635         TextField<String> removedF = new TextField<String>(VDUMMY);
     9578        TextField<String> removedF = new DummyField();
    96369579        fs.add(removedF);
    96379580        removedF.setDisabled(true);
Note: See TracChangeset for help on using the changeset viewer.