edu.mayo.bsi.ngsportal.client
Class AddSampleDialog

java.lang.Object
  extended by edu.mayo.bsi.ngsportal.client.AddSampleDialog
All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler, com.smartgwt.client.widgets.form.fields.events.KeyPressHandler, Validate

public class AddSampleDialog
extends Object
implements com.smartgwt.client.widgets.form.fields.events.KeyPressHandler, Validate

Class to put up and handle a dialog box that lets the user add a new Sample

@author Gregory Dougherty


Constructor Summary
AddSampleDialog(String species, String captureKit, String rlimsProject, String diseaseType, RunEditPanel editor, com.smartgwt.client.data.Record newRecord, com.google.gwt.user.client.Command followUp)
          Create and show a dialog box that lets the user add a new Sample to the DB
 
Method Summary
 void onKeyPress(com.smartgwt.client.widgets.form.fields.events.KeyPressEvent event)
          Fire off doSave if the user hits Enter or Return after filling in the name and species
 boolean validate()
          Make sure have a name and species
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddSampleDialog

public AddSampleDialog(String species,
                       String captureKit,
                       String rlimsProject,
                       String diseaseType,
                       RunEditPanel editor,
                       com.smartgwt.client.data.Record newRecord,
                       com.google.gwt.user.client.Command followUp)
Create and show a dialog box that lets the user add a new Sample to the DB

Parameters:
species - The Species specified in the Sample's row
captureKit - The Capture Kit used to obtain the sequencing results
rlimsProject - The RLIMS Project where the sample was sequences
diseaseType - The Disease Type specified in the Sample's row
editor - RunEditPanel to send the results of the user's actions
newRecord - The ListGrid Record that contains the new Sample
followUp - Command to be executed by doneCommand. Can be null
Method Detail

onKeyPress

public void onKeyPress(com.smartgwt.client.widgets.form.fields.events.KeyPressEvent event)
Fire off doSave if the user hits Enter or Return after filling in the name and species

Specified by:
onKeyPress in interface com.smartgwt.client.widgets.form.fields.events.KeyPressHandler
Parameters:
event - Key Press event. Nothing happens if this isn't Enter

validate

public boolean validate()
Make sure have a name and species

Specified by:
validate in interface Validate
Returns:
True if everything is correct, else false