Changeset 3839


Ignore:
Timestamp:
Sep 9, 2010, 1:22:49 PM (13 years ago)
Author:
Gregory Vincic
Message:

Refs #698. Removed getImportHitsWizardStep1Form method from FormFactory

Location:
trunk/client/servlet/src/org/proteios
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/servlet/src/org/proteios/action/hit/ImportHitsWizard.java

    r3711 r3839  
    4141import org.proteios.gui.ColumnContainer;
    4242import org.proteios.gui.RowContainer;
    43 import org.proteios.gui.form.Form;
     43import org.proteios.gui.form.*;
    4444import org.proteios.gui.layout.RowLayout;
    4545import se.lu.thep.waf.ActionException;
     
    8383    toolbar.add(next);
    8484
    85     step1 = getFormFactory().getImportHitsWizardStep1Form(project);
     85    step1 = new ImportHitsWizardStep1Form(dc, ImportHitsWizardStep1b.class.getName());
    8686     step1.setToolbar(toolbar);
    8787
  • trunk/client/servlet/src/org/proteios/action/hit/ImportHitsWizardStep1a.java

    r3821 r3839  
    5757    DbControl dc = newDbControl();
    5858    Project project = isProjectActive(dc);
    59     Form impForm = getFormFactory().getImportHitsWizardStep1Form(project);
     59    Form impForm = new ImportHitsWizardStep1Form(dc,ImportHitsWizardStep1b.class.getName());
    6060    verifyParameters(impForm);
    6161    saveToSession(ExternalGelIdField.VPARAM);
  • trunk/client/servlet/src/org/proteios/gui/form/FormFactory.java

    r3838 r3839  
    21532153
    21542154 // Cleaning up from here
    2155 
    2156   public Form getImportHitsWizardStep1Form(Project project)
    2157   {
    2158     DbControl dc = project.getDbControl();
    2159     Form form = new Form("importHitsWizardStep1Form");
    2160     if (dc != null && dc.isConnected())
    2161     {
    2162       // Properties fieldset
    2163       Fieldset properties = new Fieldset();
    2164       properties.getLegendTitle().setTitle("ImportHitsWizardStep1FormLegend");
    2165       form.addFieldset(properties);
    2166       /*
    2167        * Hidden text field for storing plugin id to use.
    2168        */
    2169       TextField<Integer> pluginIdF = new PluginIdField();
    2170       PluginDefinition pluginDef = PluginDefinition.getByClassName(
    2171         project.getDbControl(),
    2172         "org.proteios.plugins.GelSpotPlatePosToHitPlugin");
    2173       pluginIdF.setValue(pluginDef.getId());
    2174       properties.add(pluginIdF);
    2175       /*
    2176        * This hidden text field sets title to be used for file selection
    2177        * form.
    2178        */
    2179       TextField<String> titleF = new TitleField();
    2180       titleF.setValue("Step 1a. Select Robot Result File[s]");
    2181       properties.add(titleF);
    2182       /*
    2183        * This hidden text field sets name to be used for the "Next" button
    2184        * in the file selection form.
    2185        */
    2186       TextField<String> buttonNameF = new NextButtonNameField();
    2187       buttonNameF.setValue("Import");
    2188       properties.add(buttonNameF);
    2189       /*
    2190        * This hidden forward field sets action id used by the file
    2191        * selection action called by ImportHitsWizardStep1a.
    2192        */
    2193       TextField<String> forwardF = new ForwardField();
    2194       forwardF.setValue(actionFactory.getId(ImportHitsWizardStep1b.class));
    2195       properties.add(forwardF);
    2196       // Gel id (optional)
    2197       properties.add(new ExternalGelIdField(false));
    2198     }
    2199     return form;
    2200   }
    2201 
    22022155
    22032156  public Form getImportHitsWizardStep2Form(Project project)
  • trunk/client/servlet/src/org/proteios/gui/form/ImportHitsWizardStep1Form.java

    r3838 r3839  
    11/*
    2  $Id$
    3 
    4  Copyright (C) 2010 Gregory Vincic
    5 
    6  Files are copyright by their respective authors. The contributions to
    7  files where copyright is not explicitly stated can be traced with the
    8  source code revision system.
    9 
    10  This file is part of Proteios.
    11  Available at http://www.proteios.org/
    12 
    13  Proteios is free software; you can redistribute it and/or
    14  modify it under the terms of the GNU General Public License
    15  as published by the Free Software Foundation; either version 2
    16  of the License, or (at your option) any later version.
    17 
    18  Proteios is distributed in the hope that it will be useful,
    19  but WITHOUT ANY WARRANTY; without even the implied warranty of
    20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    21  GNU General Public License for more details.
    22 
    23  You should have received a copy of the GNU General Public License
    24  along with this program; if not, write to the Free Software
    25  Foundation, Inc., 59 Temple Place - Suite 339.
    26  Boston, MA 02111-1307, USA.
     2  $Id$
     3       
     4  Copyright (C) 2010 Gregory Vincic
     5       
     6  Files are copyright by their respective authors. The contributions to
     7  files where copyright is not explicitly stated can be traced with the
     8  source code revision system.
     9       
     10  This file is part of Proteios.
     11  Available at http://www.proteios.org/
     12       
     13  Proteios is free software; you can redistribute it and/or
     14  modify it under the terms of the GNU General Public License
     15  as published by the Free Software Foundation; either version 2
     16  of the License, or (at your option) any later version.
     17       
     18  Proteios is distributed in the hope that it will be useful,
     19  but WITHOUT ANY WARRANTY; without even the implied warranty of
     20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     21  GNU General Public License for more details.
     22       
     23  You should have received a copy of the GNU General Public License
     24  along with this program; if not, write to the Free Software
     25  Foundation, Inc., 59 Temple Place - Suite 339.
     26  Boston, MA 02111-1307, USA.
    2727*/
    2828
    2929package org.proteios.gui.form;
     30
     31import org.proteios.core.PluginDefinition;
     32import org.proteios.core.DbControl;
     33
    3034/**
    31  */
     35*/
    3236public class ImportHitsWizardStep1Form extends Form
    3337{
     38  public final Fieldset properties;
     39  public final TextField<Integer> pluginIdF;
     40  public final PluginDefinition pluginDef;
     41  public final TextField<String> titleF, buttonNameF, forwardF;
     42     
     43  /**
     44    @param dc DbControl used to get a plugin definition, must not be null nor disconnected
     45  */
     46  public ImportHitsWizardStep1Form(DbControl dc, String nextAction)
     47  {
     48    super("importHitsWizardStep1Form");
     49    /*
     50      * Hidden text field for storing plugin id to use.
     51    */
     52    pluginIdF = new PluginIdField();
     53    pluginDef = PluginDefinition.getByClassName(
     54    dc,
     55    "org.proteios.plugins.GelSpotPlatePosToHitPlugin");
     56    pluginIdF.setValue(pluginDef.getId());
     57    /*
     58      * This hidden text field sets title to be used for file selection
     59      * form.
     60    */
     61    titleF = new TitleField("Step 1a. Select Robot Result File[s]");
     62   
     63    /*
     64      * This hidden text field sets name to be used for the "Next" button
     65      * in the file selection form.
     66    */
     67    buttonNameF = new NextButtonNameField();
     68    buttonNameF.setValue("Import");
     69   
     70    /*
     71      * This hidden forward field sets action id used by the file
     72      * selection action called by ImportHitsWizardStep1a.
     73    */
     74    forwardF = new ForwardField();
     75    forwardF.setValue(nextAction);
     76   
     77    properties = new Fieldset();
     78    properties.getLegendTitle().setTitle("ImportHitsWizardStep1FormLegend");
     79    addFieldset(properties);
     80    properties.add(pluginIdF);
     81    properties.add(titleF);
     82    properties.add(buttonNameF);
     83    properties.add(forwardF);
     84    // Gel id (optional)
     85    properties.add(new ExternalGelIdField(false));
     86  }
    3487}
  • trunk/client/servlet/src/org/proteios/gui/form/TitleField.java

    r3823 r3839  
    4343  setHidden(true);
    4444 }
     45
     46 public TitleField(String title)
     47 {
     48   this();
     49  setValue(title);
     50 }
     51
    4552}
Note: See TracChangeset for help on using the changeset viewer.