JAL-2028 improvment to the displayed column customisation
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 16 Mar 2016 12:24:24 +0000 (12:24 +0000)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Wed, 16 Mar 2016 12:24:24 +0000 (12:24 +0000)
resources/lang/Messages.properties
src/jalview/jbgui/GPDBSearchPanel.java
src/jalview/jbgui/GStructureChooser.java
src/jalview/jbgui/PDBDocFieldPreferences.java
src/jalview/ws/dbsources/PDBRestClient.java

index e428989..f228b5d 100644 (file)
@@ -1248,7 +1248,7 @@ info.select_filter_option = Select Filter Option/Manual Entry
 info.associate_wit_sequence = Associate with Sequence
 label.search_result = Search Result
 label.found_structures_summary = Found Structures Summary
-label.configure_displayed_columns = Configure Displayed Columns
+label.configure_displayed_columns = Customise Displayed Options
 label.start_jalview = Start Jalview
 label.biojs_html_export = BioJS
 label.scale_as_cdna = Scale protein residues to codons
index a105999..ec08102 100644 (file)
@@ -79,6 +79,7 @@ public abstract class GPDBSearchPanel extends JPanel
 
   protected JTable tbl_summary = new JTable()
   {
+    @Override
     public String getToolTipText(MouseEvent evt)
     {
       String toolTipText = null;
@@ -160,11 +161,13 @@ public abstract class GPDBSearchPanel extends JPanel
     tbl_summary.getTableHeader().setReorderingAllowed(false);
     tbl_summary.addMouseListener(new MouseAdapter()
     {
+      @Override
       public void mouseClicked(MouseEvent e)
       {
         validateSelection();
       }
 
+      @Override
       public void mouseReleased(MouseEvent e)
       {
         validateSelection();
@@ -209,6 +212,7 @@ public abstract class GPDBSearchPanel extends JPanel
     btn_back.setText(MessageManager.getString("action.back"));
     btn_back.addActionListener(new java.awt.event.ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         btn_back_ActionPerformed();
@@ -231,6 +235,7 @@ public abstract class GPDBSearchPanel extends JPanel
     btn_ok.setText(MessageManager.getString("action.ok"));
     btn_ok.addActionListener(new java.awt.event.ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         btn_ok_ActionPerformed();
@@ -252,6 +257,7 @@ public abstract class GPDBSearchPanel extends JPanel
     btn_cancel.setText(MessageManager.getString("action.cancel"));
     btn_cancel.addActionListener(new java.awt.event.ActionListener()
     {
+      @Override
       public void actionPerformed(ActionEvent e)
       {
         btn_cancel_ActionPerformed();
@@ -356,13 +362,21 @@ public abstract class GPDBSearchPanel extends JPanel
             .getString("label.configure_displayed_columns");
     ChangeListener changeListener = new ChangeListener()
     {
+      @Override
       public void stateChanged(ChangeEvent changeEvent)
       {
         JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
                 .getSource();
         int index = sourceTabbedPane.getSelectedIndex();
+
+        btn_back.setVisible(true);
+        btn_cancel.setVisible(true);
+        btn_ok.setVisible(true);
         if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
         {
+          btn_back.setVisible(false);
+          btn_cancel.setVisible(false);
+          btn_ok.setVisible(false);
           btn_back.setEnabled(false);
           btn_cancel.setEnabled(false);
           btn_ok.setEnabled(false);
index d8cff06..efc3062 100644 (file)
@@ -461,10 +461,14 @@ public abstract class GStructureChooser extends JPanel implements
         JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent
                 .getSource();
         int index = sourceTabbedPane.getSelectedIndex();
+        btn_view.setVisible(true);
+        btn_cancel.setVisible(true);
         if (sourceTabbedPane.getTitleAt(index).equals(configureCols))
         {
           btn_view.setEnabled(false);
           btn_cancel.setEnabled(false);
+          btn_view.setVisible(false);
+          btn_cancel.setVisible(false);
           previousWantedFields = PDBDocFieldPreferences
                   .getStructureSummaryFields().toArray(
                           new PDBRestClient.PDBDocField[0]);
index e9fc4fc..875eb2e 100644 (file)
@@ -22,13 +22,19 @@ package jalview.jbgui;
 
 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
+import java.util.List;
 
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
+import javax.swing.RowSorter;
+import javax.swing.SortOrder;
 import javax.swing.table.AbstractTableModel;
+import javax.swing.table.TableModel;
+import javax.swing.table.TableRowSorter;
 
 @SuppressWarnings("serial")
 public class PDBDocFieldPreferences extends JScrollPane
@@ -63,6 +69,9 @@ public class PDBDocFieldPreferences extends JScrollPane
   public PDBDocFieldPreferences(PreferenceSource source)
   {
     tbl_pdbDocFieldConfig.setAutoCreateRowSorter(true);
+
+
+
     this.getViewport().add(tbl_pdbDocFieldConfig);
     this.currentSource = source;
 
@@ -70,10 +79,10 @@ public class PDBDocFieldPreferences extends JScrollPane
     switch (source)
     {
     case SEARCH_SUMMARY:
-      columnNames = new String[] { "PDB Field", "Show in search summary" };
+      columnNames = new String[] { "", "Display", "Group" };
       break;
     case STRUCTURE_CHOOSER:
-      columnNames = new String[] { "PDB Field", "Show in structure summary" };
+      columnNames = new String[] { " ", "Display", "Group" };
       break;
     case PREFERENCES:
       columnNames = new String[] { "PDB Field", "Show in search summary",
@@ -95,12 +104,12 @@ public class PDBDocFieldPreferences extends JScrollPane
       switch (source)
       {
       case SEARCH_SUMMARY:
-        data[x++] = new Object[] { field.getName(),
-            searchSummaryFields.contains(field) };
+        data[x++] = new Object[] { searchSummaryFields.contains(field),
+            field.getName(), field.getGroup() };
         break;
       case STRUCTURE_CHOOSER:
-        data[x++] = new Object[] { field.getName(),
-            structureSummaryFields.contains(field) };
+        data[x++] = new Object[] { structureSummaryFields.contains(field),
+            field.getName(), field.getGroup() };
         break;
       case PREFERENCES:
         data[x++] = new Object[] { field.getName(),
@@ -115,6 +124,38 @@ public class PDBDocFieldPreferences extends JScrollPane
 
     PDBFieldTableModel model = new PDBFieldTableModel(columnNames, data);
     tbl_pdbDocFieldConfig.setModel(model);
+
+    // DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
+    // rightRenderer.setHorizontalAlignment(SwingConstants.LEFT);
+    // tbl_pdbDocFieldConfig.getColumn("Show in structure summary")
+    // .setCellRenderer(rightRenderer);
+    switch (source)
+    {
+    case SEARCH_SUMMARY:
+    case STRUCTURE_CHOOSER:
+      tbl_pdbDocFieldConfig.getColumnModel().getColumn(0)
+              .setPreferredWidth(5);
+      tbl_pdbDocFieldConfig.getColumnModel().getColumn(1)
+              .setPreferredWidth(195);
+      tbl_pdbDocFieldConfig.getColumnModel().getColumn(2)
+              .setPreferredWidth(200);
+
+      TableRowSorter<TableModel> sorter = new TableRowSorter<>(
+              tbl_pdbDocFieldConfig.getModel());
+      tbl_pdbDocFieldConfig.setRowSorter(sorter);
+      List<RowSorter.SortKey> sortKeys = new ArrayList<>();
+      int columnIndexToSort = 2;
+      sortKeys.add(new RowSorter.SortKey(columnIndexToSort,
+              SortOrder.ASCENDING));
+      sorter.setSortKeys(sortKeys);
+      sorter.sort();
+      break;
+    case PREFERENCES:
+    default:
+      break;
+    }
+
+
   }
 
   public static Collection<PDBDocField> getSearchSummaryFields()
@@ -152,21 +193,25 @@ public class PDBDocFieldPreferences extends JScrollPane
 
     private String[] columnNames;
 
+    @Override
     public int getColumnCount()
     {
       return columnNames.length;
     }
 
+    @Override
     public int getRowCount()
     {
       return data.length;
     }
 
+    @Override
     public String getColumnName(int col)
     {
       return columnNames[col];
     }
 
+    @Override
     public Object getValueAt(int row, int col)
     {
       return data[row][col];
@@ -177,6 +222,7 @@ public class PDBDocFieldPreferences extends JScrollPane
      * each cell. If we didn't implement this method, then the last column would
      * contain text ("true"/"false"), rather than a check box.
      */
+    @Override
     public Class getColumnClass(int c)
     {
       return getValueAt(0, c).getClass();
@@ -185,13 +231,24 @@ public class PDBDocFieldPreferences extends JScrollPane
     /*
      * Don't need to implement this method unless your table's editable.
      */
+    @Override
     public boolean isCellEditable(int row, int col)
     {
       // Note that the data/cell address is constant,
       // no matter where the cell appears onscreen.
       // !isPDBID(row, col) ensures the PDB_Id cell is never editable as it
       // serves as a unique id for each row.
-      return (col == 1 || col == 2) && !isPDBID(row, col);
+      // return (col == 1 || col == 2) && !isPDBID(row, col);
+      switch (currentSource)
+      {
+      case SEARCH_SUMMARY:
+      case STRUCTURE_CHOOSER:
+        return (col == 0) && !isPDBID(row, 1);
+      case PREFERENCES:
+        return (col == 1 || col == 2) && !isPDBID(row, 0);
+      default:
+        return false;
+      }
 
     }
 
@@ -206,7 +263,7 @@ public class PDBDocFieldPreferences extends JScrollPane
     public boolean isPDBID(int row, int col)
     {
       boolean matched = false;
-      String name = getValueAt(row, 0).toString();
+      String name = getValueAt(row, col).toString();
       PDBDocField pdbField = map.get(name);
       if (pdbField == PDBDocField.PDB_ID)
       {
@@ -218,12 +275,25 @@ public class PDBDocFieldPreferences extends JScrollPane
     /*
      * Don't need to implement this method unless your table's data can change.
      */
+    @Override
     public void setValueAt(Object value, int row, int col)
     {
       data[row][col] = value;
       fireTableCellUpdated(row, col);
 
-      String name = getValueAt(row, 0).toString();
+      String name = null;
+      switch (currentSource)
+      {
+      case SEARCH_SUMMARY:
+      case STRUCTURE_CHOOSER:
+        name = getValueAt(row, 1).toString();
+        break;
+      case PREFERENCES:
+        name = getValueAt(row, 0).toString();
+        break;
+      default:
+        break;
+      }
       boolean selected = ((Boolean) value).booleanValue();
 
       PDBDocField pdbField = map.get(name);
index a36fdd4..ebe18f7 100644 (file)
@@ -369,89 +369,159 @@ public class PDBRestClient
    */
   public enum PDBDocField
   {
-    PDB_ID("PDB Id", "pdb_id"), TITLE("Title", "title"), MOLECULE_NAME(
-            "Molecule", "molecule_name"), MOLECULE_TYPE("Molecule Type",
-            "molecule_type"), MOLECULE_SEQUENCE("Sequence",
-            "molecule_sequence"), PFAM_ACCESSION("PFAM Accession",
-            "pfam_accession"), PFAM_NAME("PFAM Name", "pfam_name"), INTERPRO_NAME(
-            "InterPro Name", "interpro_name"), INTERPRO_ACCESSION(
-            "InterPro Accession", "interpro_accession"), UNIPROT_ID(
-            "UniProt Id", "uniprot_id"), UNIPROT_ACCESSION(
-            "UniProt Accession", "uniprot_accession"), UNIPROT_COVERAGE(
-            "UniProt Coverage", "uniprot_coverage"), UNIPROT_FEATURES(
-            "Uniprot Features", "uniprot_features"), R_FACTOR("R Factor",
-            "r_factor"), RESOLUTION("Resolution", "resolution"), DATA_QUALITY(
-            "Data Quality", "data_quality"), OVERALL_QUALITY(
-            "Overall Quality", "overall_quality"), POLYMER_COUNT(
-            "Number of Polymers", "number_of_polymers"), PROTEIN_CHAIN_COUNT(
-            "Number of Protein Chains", "number_of_protein_chains"), BOUND_MOLECULE_COUNT(
-            "Number of Bound Molecule", "number_of_bound_molecules"), POLYMER_RESIDUE_COUNT(
-            "Number of Polymer Residue", "number_of_polymer_residues"), GENUS(
-            "GENUS", "genus"), GENE_NAME("Gene Name", "gene_name"), EXPERIMENTAL_METHOD(
-            "Experimental Method", "experimental_method"), GO_ID("GO Id",
-            "go_id"), ASSEMBLY_ID("Assembly Id", "assembly_form"), ASSEMBLY_FORM(
-            "Assembly Form", "assembly_id"), ASSEMBLY_TYPE("Assembly Type",
-            "assembly_type"), SPACE_GROUP("Space Group", "spacegroup"), CATH_CODE(
-            "Cath Code", "cath_code"), TAX_ID("Tax Id", "tax_id"), TAX_QUERY(
-            "Tax Query", "tax_query"), INTERACTING_ENTRY_ID(
-            "Interacting Entry Id", "interacting_entry_id"), INTERACTING_ENTITY_ID(
-            "Interacting Entity Id", "interacting_entity_id"), INTERACTING_MOLECULES(
-            "Interacting Molecules", "interacting_molecules"), PUBMED_ID(
-            "Pubmed Id", "pubmed_id"), STATUS("Status", "status"), MODEL_QUALITY(
-            "Model Quality", "model_quality"), PIVOT_RESOLUTION(
-            "Pivot Resolution", "pivot_resolution"), DATA_REDUCTION_SOFTWARE(
-            "Data reduction software", "data_reduction_software"), MAX_OBSERVED_RES(
-            "Max observed residues", "max_observed_residues"), ORG_SCI_NAME(
-            "Organism scientific name", "organism_scientific_name"), SUPER_KINGDOM(
-            "Super kingdom", "superkingdom"), RANK("Rank", "rank"), CRYSTALLISATION_PH(
-            "Crystallisation Ph", "crystallisation_ph"), BIOLOGICAL_FUNCTION(
-            "Biological Function", "biological_function"), BIOLOGICAL_PROCESS(
-            "Biological Process", "biological_process"), BIOLOGICAL_CELL_COMPONENT(
-            "Biological Cell Component", "biological_cell_component"), COMPOUND_NAME(
-            "Compound Name", "compound_name"), COMPOUND_ID("Compound Id",
-            "compound_id"), COMPOUND_WEIGHT("Compound Weight",
-            "compound_weight"), COMPOUND_SYSTEMATIC_NAME(
-            "Compound Systematic Name", "compound_systematic_name"), INTERACTING_LIG(
-            "Interacting Ligands", "interacting_ligands"), JOURNAL(
-            "Journal", "journal"), ALL_AUTHORS("All Authors", "all_authors"), EXPERIMENTAL_DATA_AVAILABLE(
-            "Experiment Data Available", "experiment_data_available"), DIFFRACTION_PROTOCOL(
-            "Diffraction Protocol", "diffraction_protocol"), REFINEMENT_SOFTWARE(
-            "Refinement Software", "refinement_software"), STRUCTURE_DETERMINATION_METHOD(
+    PDB_ID("PDB Id", "pdb_id", Group.CROSS_REFS), TITLE(
+            "Title",
+            "title", Group.MISCELLENOUS), MOLECULE_NAME("Molecule",
+            "molecule_name",
+            Group.NAMES_AND_TAXONOMY), MOLECULE_TYPE(
+            "Molecule Type", "molecule_type", Group.NAMES_AND_TAXONOMY), MOLECULE_SEQUENCE(
+            "Sequence", "molecule_sequence", Group.MISCELLENOUS), PFAM_ACCESSION(
+            "PFAM Accession", "pfam_accession",
+            Group.CROSS_REFS), PFAM_NAME(
+            "PFAM Name", "pfam_name", Group.NAMES_AND_TAXONOMY), INTERPRO_NAME(
+            "InterPro Name", "interpro_name", Group.NAMES_AND_TAXONOMY), INTERPRO_ACCESSION(
+            "InterPro Accession", "interpro_accession",
+            Group.CROSS_REFS), UNIPROT_ID("UniProt Id",
+            "uniprot_id", Group.CROSS_REFS), UNIPROT_ACCESSION(
+            "UniProt Accession", "uniprot_accession",
+            Group.CROSS_REFS),
+
+    UNIPROT_COVERAGE(
+            "UniProt Coverage", "uniprot_coverage", Group.MISCELLENOUS), UNIPROT_FEATURES(
+            "Uniprot Features", "uniprot_features", Group.MISCELLENOUS), R_FACTOR(
+"R Factor",
+            "r_factor", Group.QUALITY_MEASURES), RESOLUTION("Resolution",
+            "resolution", Group.QUALITY_MEASURES), DATA_QUALITY(
+            "Data Quality", "data_quality", Group.QUALITY_MEASURES), OVERALL_QUALITY(
+            "Overall Quality", "overall_quality", Group.QUALITY_MEASURES), POLYMER_COUNT(
+            "Number of Polymers", "number_of_polymers", Group.MISCELLENOUS), PROTEIN_CHAIN_COUNT(
+            "Number of Protein Chains", "number_of_protein_chains",
+            Group.MISCELLENOUS), BOUND_MOLECULE_COUNT(
+            "Number of Bound Molecule", "number_of_bound_molecules",
+            Group.MISCELLENOUS), POLYMER_RESIDUE_COUNT(
+            "Number of Polymer Residue", "number_of_polymer_residues",
+            Group.MISCELLENOUS), GENUS("GENUS", "genus",
+            Group.NAMES_AND_TAXONOMY), GENE_NAME("Gene Name", "gene_name",
+            Group.NAMES_AND_TAXONOMY), EXPERIMENTAL_METHOD(
+            "Experimental Method", "experimental_method",
+            Group.PROCEDURE_AND_SOFTWARE), GO_ID("GO Id", "go_id",
+            Group.CROSS_REFS), ASSEMBLY_ID("Assembly Id",
+            "assembly_id", Group.CROSS_REFS), ASSEMBLY_FORM(
+            "Assembly Form", "assembly_form", Group.MISCELLENOUS), ASSEMBLY_TYPE(
+            "Assembly Type", "assembly_type", Group.MISCELLENOUS), SPACE_GROUP(
+            "Space Group", "spacegroup", Group.MISCELLENOUS), CATH_CODE(
+            "Cath Code", "cath_code", Group.CROSS_REFS), TAX_ID(
+            "Tax Id", "tax_id", Group.CROSS_REFS), TAX_QUERY(
+            "Tax Query", "tax_query", Group.CROSS_REFS), INTERACTING_ENTITY_ID(
+            "Interacting Entity Id", "interacting_entity_id",
+            Group.CROSS_REFS), INTERACTING_MOLECULES(
+            "Interacting Molecules", "interacting_molecules",
+            Group.MISCELLENOUS), PUBMED_ID("Pubmed Id", "pubmed_id",
+            Group.CROSS_REFS), STATUS("Status", "status",
+            Group.MISCELLENOUS), MODEL_QUALITY("Model Quality",
+            "model_quality", Group.QUALITY_MEASURES), PIVOT_RESOLUTION(
+            "Pivot Resolution", "pivot_resolution", Group.QUALITY_MEASURES), DATA_REDUCTION_SOFTWARE(
+            "Data reduction software", "data_reduction_software",
+            Group.PROCEDURE_AND_SOFTWARE), MAX_OBSERVED_RES(
+            "Max observed residues",
+            "max_observed_residues", Group.MISCELLENOUS), ORG_SCI_NAME(
+            "Organism scientific name", "organism_scientific_name",
+            Group.NAMES_AND_TAXONOMY), SUPER_KINGDOM("Super kingdom",
+            "superkingdom", Group.NAMES_AND_TAXONOMY), RANK("Rank", "rank",
+            Group.NAMES_AND_TAXONOMY), CRYSTALLISATION_PH(
+            "Crystallisation Ph",
+            "crystallisation_ph", Group.MISCELLENOUS), BIOLOGICAL_FUNCTION(
+            "Biological Function", "biological_function",
+            Group.MISCELLENOUS), BIOLOGICAL_PROCESS("Biological Process",
+            "biological_process", Group.MISCELLENOUS), BIOLOGICAL_CELL_COMPONENT(
+            "Biological Cell Component", "biological_cell_component",
+            Group.MISCELLENOUS), COMPOUND_NAME("Compound Name",
+            "compound_name", Group.NAMES_AND_TAXONOMY), COMPOUND_ID(
+            "Compound Id", "compound_id", Group.CROSS_REFS), COMPOUND_WEIGHT(
+            "Compound Weight", "compound_weight", Group.MISCELLENOUS), COMPOUND_SYSTEMATIC_NAME(
+            "Compound Systematic Name", "compound_systematic_name",
+            Group.NAMES_AND_TAXONOMY), INTERACTING_LIG(
+            "Interacting Ligands",
+            "interacting_ligands", Group.MISCELLENOUS), JOURNAL("Journal",
+            "journal", Group.MISCELLENOUS), ALL_AUTHORS("All Authors",
+            "all_authors", Group.MISCELLENOUS), EXPERIMENTAL_DATA_AVAILABLE(
+            "Experiment Data Available", "experiment_data_available",
+            Group.MISCELLENOUS), DIFFRACTION_PROTOCOL(
+            "Diffraction Protocol", "diffraction_protocol",
+            Group.PROCEDURE_AND_SOFTWARE), REFINEMENT_SOFTWARE(
+            "Refinement Software", "refinement_software",
+            Group.PROCEDURE_AND_SOFTWARE), STRUCTURE_DETERMINATION_METHOD(
             "Structure Determination Method",
-            "structure_determination_method"), SYNCHROTON_SITE(
-            "Synchrotron Site", "synchrotron_site"), SAMPLE_PREP_METHOD(
-            "Sample Preparation Method", "sample_preparation_method"), ENTRY_AUTHORS(
-            "Entry Authors", "entry_authors"), CITATION_TITLE(
-            "Citation Title", "citation_title"), STRUCTURE_SOLUTION_SOFTWARE(
-            "Structure Solution Software", "structure_solution_software"), ENTRY_ENTITY(
-            "Entry Entity", "entry_entity"), R_FREE("R Free", "r_free"), NO_OF_POLYMER_ENTITIES(
-            "Number of Polymer Entities", "number_of_polymer_entities"), NO_OF_BOUND_ENTITIES(
-            "Number of Bound Entities", "number_of_bound_entities"), CRYSTALLISATION_RESERVOIR(
-            "Crystallisation Reservoir", "crystallisation_reservoir"), DATA_SCALING_SW(
-            "Data Scalling Software", "data_scaling_software"), DETECTOR(
-            "Detector", "detector"), DETECTOR_TYPE("Detector Type",
-            "detector_type"), MODIFIED_RESIDUE_FLAG(
-            "Modified Residue Flag", "modified_residue_flag"), NUMBER_OF_COPIES(
-            "Number of Copies", "number_of_copies"), STRUCT_ASYM_ID(
-            "Struc Asym Id", "struct_asym_id"), HOMOLOGUS_PDB_ENTITY_ID(
-            "Homologus PDB Entity Id", "homologus_pdb_entity_id"), MOLECULE_SYNONYM(
-            "Molecule Synonym", "molecule_synonym"), DEPOSITION_SITE(
-            "Deposition Site", "deposition_site"), SYNCHROTRON_BEAMLINE(
-            "Synchrotron Beamline", "synchrotron_beamline"), ENTITY_ID(
-            "Entity Id", "entity_id"), BEAM_SOURCE_NAME("Beam Source Name",
-            "beam_source_name"), PROCESSING_SITE("Processing Site",
-            "processing_site"), ENTITY_WEIGHT("Entity Weight",
-            "entity_weight"), VERSION("Version", "_version_"), ALL("ALL",
-            "text");
+            "structure_determination_method", Group.PROCEDURE_AND_SOFTWARE), SYNCHROTON_SITE(
+            "Synchrotron Site", "synchrotron_site", Group.MISCELLENOUS), SAMPLE_PREP_METHOD(
+            "Sample Preparation Method", "sample_preparation_method",
+            Group.PROCEDURE_AND_SOFTWARE), ENTRY_AUTHORS("Entry Authors",
+            "entry_authors", Group.MISCELLENOUS), CITATION_TITLE(
+            "Citation Title", "citation_title", Group.MISCELLENOUS), STRUCTURE_SOLUTION_SOFTWARE(
+            "Structure Solution Software", "structure_solution_software",
+            Group.PROCEDURE_AND_SOFTWARE), ENTRY_ENTITY("Entry Entity",
+            "entry_entity", Group.MISCELLENOUS), R_FREE("R Free", "r_free",
+            Group.QUALITY_MEASURES), NO_OF_POLYMER_ENTITIES(
+            "Number of Polymer Entities", "number_of_polymer_entities",
+            Group.MISCELLENOUS), NO_OF_BOUND_ENTITIES(
+            "Number of Bound Entities", "number_of_bound_entities",
+            Group.MISCELLENOUS), CRYSTALLISATION_RESERVOIR(
+            "Crystallisation Reservoir", "crystallisation_reservoir",
+            Group.MISCELLENOUS), DATA_SCALING_SW("Data Scalling Software",
+            "data_scaling_software", Group.PROCEDURE_AND_SOFTWARE), DETECTOR(
+            "Detector", "detector", Group.MISCELLENOUS), DETECTOR_TYPE(
+            "Detector Type", "detector_type", Group.MISCELLENOUS), MODIFIED_RESIDUE_FLAG(
+            "Modified Residue Flag", "modified_residue_flag",
+            Group.MISCELLENOUS), NUMBER_OF_COPIES("Number of Copies",
+            "number_of_copies", Group.MISCELLENOUS), STRUCT_ASYM_ID(
+            "Struc Asym Id", "struct_asym_id",
+            Group.CROSS_REFS), HOMOLOGUS_PDB_ENTITY_ID(
+            "Homologus PDB Entity Id", "homologus_pdb_entity_id",
+            Group.CROSS_REFS), MOLECULE_SYNONYM(
+            "Molecule Synonym",
+            "molecule_synonym", Group.MISCELLENOUS), DEPOSITION_SITE(
+            "Deposition Site", "deposition_site", Group.MISCELLENOUS), SYNCHROTRON_BEAMLINE(
+            "Synchrotron Beamline", "synchrotron_beamline",
+            Group.MISCELLENOUS), ENTITY_ID("Entity Id", "entity_id",
+            Group.CROSS_REFS), BEAM_SOURCE_NAME(
+            "Beam Source Name",
+ "beam_source_name",
+            Group.NAMES_AND_TAXONOMY), PROCESSING_SITE(
+            "Processing Site", "processing_site", Group.MISCELLENOUS), ENTITY_WEIGHT(
+            "Entity Weight", "entity_weight", Group.MISCELLENOUS), VERSION(
+            "Version", "_version_", Group.MISCELLENOUS), ALL("ALL", "text",
+            Group.MISCELLENOUS);
+
+    private enum Group
+    {
+      DATE_OF("Date Of"), NAMES_AND_TAXONOMY("Names & Taxonomy"), MISCELLENOUS(
+              "Miscellenous"), QUALITY_MEASURES("Quality Measures"), CROSS_REFS(
+              "Cross References"), PROCEDURE_AND_SOFTWARE(
+              "Procedures & Softwares");
+
+      Group(String name)
+      {
+        this.name = name;
+      }
+
+      private String name;
 
+      public String getName()
+      {
+        return this.name;
+      }
+    };
     private String name;
 
     private String code;
 
-    PDBDocField(String name, String code)
+    private Group group;
+
+    PDBDocField(String name, String code, Group group)
     {
       this.name = name;
       this.code = code;
+      this.group = group;
     }
 
     public String getName()
@@ -464,6 +534,11 @@ public class PDBRestClient
       return code;
     }
 
+    public String getGroup()
+    {
+      return group.getName();
+    }
+
     @Override
     public String toString()
     {